Skip to content

Instantly share code, notes, and snippets.

@josjaf
Created August 20, 2019 19:26
Show Gist options
  • Select an option

  • Save josjaf/a41c14f18a85364ff2a3c9f29504172f to your computer and use it in GitHub Desktop.

Select an option

Save josjaf/a41c14f18a85364ff2a3c9f29504172f to your computer and use it in GitHub Desktop.

Revisions

  1. josjaf created this gist Aug 20, 2019.
    25 changes: 25 additions & 0 deletions SG
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    from aws_cdk import (

    aws_iam as aws_iam,
    aws_s3 as aws_s3,
    aws_ecr,
    aws_ec2,
    core,

    )


    class Compute(core.Stack):
    def __init__(self, app: core.App, id: str, props, env, **kwargs) -> None:
    super().__init__(app, id, **kwargs)


    self.output_props = props
    # bucket.grant_read_write(codepipeline_role)
    sg = aws_ec2.SecurityGroup(
    self, 'SG',
    vpc=aws_ec2.Vpc.from_lookup(self, 'vpc', vpc_name='NAT'),
    allow_all_outbound=True,
    security_group_name=props.namespace

    )