internal CdkPipelineStack(Construct scope, string id, CdkPipelineStackProps props = null) : base(scope, id, props)
        {
            var sourceArtifact = new Artifact_("SourceArtifact");
            var outputArtifact = new Artifact_("OutputArtifact");

            var sourceAction = new CodeCommitSourceAction(new CodeCommitSourceActionProps
            {
                ActionName = "CodeCommit",
                Output     = sourceArtifact,
                Repository = props.MyRepository,
                Branch     = "main",
            });

            // Self mutation
            var pipeline = new CdkPipeline(this, "CdkPipeline", new CdkPipelineProps
            {
                PipelineName          = "CrossAccountSourcePipeline",
                CloudAssemblyArtifact = outputArtifact,

                SourceAction = sourceAction,

                // It synthesizes CDK code to cdk.out directory which is picked by SelfMutate stage to mutate the pipeline
                SynthAction = new SimpleSynthAction(new SimpleSynthActionProps
                {
                    SourceArtifact        = sourceArtifact,
                    CloudAssemblyArtifact = outputArtifact,
                    InstallCommands       = new[]
                    {
                        "npm install -g aws-cdk",
                    },
                    BuildCommands = new[] { "dotnet build" },
                    SynthCommand  = "cdk synth",
                }),
            });
        }
        public static SecurityGroup CreateHostToRDS(Constructs.Construct construct, Vpc vpc, string name, string description, SecurityGroup elbSecurityGroup)
        {
            var ports = new Port[]
            {
                new Port(Utils.Ports.GetPortProps(3306, 3306, "MySQL/Auora"))
            };
            var sg = CreatePeer(construct, vpc, name, description, elbSecurityGroup, ports);

            return(sg);
        }
        public static SecurityGroup CreatePeer(Constructs.Construct construct, Vpc vpc, string name, string description, SecurityGroup peer, Port[] ports)
        {
            var sg = CreateHostSG(construct, vpc, name, description);

            foreach (var port in ports)
            {
                sg.AddIngressRule(peer, port);
            }

            return(sg);
        }
 public RouteToS3(Constructs.Construct scope, string id, RouteToS3Props props) : base(scope, id)
 {
     var method = props.Api.Root.AddResource(props.PathInApiGateway)
                  .AddResource("{proxy+}")
                  .AddMethod("GET", new AwsIntegration(new AwsIntegrationProps
     {
         Service = "s3",
         Path    = string.Join("/", (new[] { props.S3Bucket, props.S3Prefix, "{proxy}" }).Where(x => !string.IsNullOrWhiteSpace(x))),
         IntegrationHttpMethod = "GET",
         Options = new IntegrationOptions
         {
             CredentialsRole   = props.Role ?? CreateRole(),
             RequestParameters = new Dictionary <string, string>
             {
                 { "integration.request.path.proxy", "method.request.path.proxy" }
             },
             IntegrationResponses = new[]
             {
                 new IntegrationResponse
                 {
                     StatusCode         = "200",
                     ResponseParameters = new Dictionary <string, string>
                     {
                         { "method.response.header.Cache-Control", "integration.response.header.Cache-Control" },
                         { "method.response.header.ETag", "integration.response.header.ETag" },
                         { "method.response.header.Last-Modified", "integration.response.header.Last-Modified" },
                         { "method.response.header.Content-Type", "integration.response.header.Content-Type" }
                     }
                 }
             }
         }
     }), new MethodOptions
     {
         RequestParameters = new Dictionary <string, bool>
         {
             { "method.request.path.proxy", true }
         },
         MethodResponses = new[]
         {
             new MethodResponse
             {
                 StatusCode         = "200",
                 ResponseParameters = new Dictionary <string, bool>
                 {
                     { "method.response.header.Cache-Control", true },
                     { "method.response.header.Content-Type", true },
                     { "method.response.header.ETag", true },
                     { "method.response.header.Last-Modified", true },
                 }
             }
         }
     });
 }
        public static SecurityGroup CreateHostSG(Constructs.Construct construct, Vpc vpc, string name, string description)
        {
            var props = new SecurityGroupProps
            {
                Vpc               = vpc,
                Description       = description,
                SecurityGroupName = $"{name}",
            };

            // create some security groups
            var sg = new SecurityGroup(construct, name, props);

            Amazon.CDK.Tags.Of(sg).Add("Name", $"{name}");

            return(sg);
        }
        public static SecurityGroup CreateHttpHttps(Constructs.Construct construct, Vpc vpc, string name, string description, IPeer[] peers = null)
        {
            // create the security groups
            var sg = CreateHostSG(construct, vpc, name, description);

            // add the rules
            if (peers == null || peers.Length == 0)
            {
                var source = Peer.AnyIpv4();
                peers = new[] { source };
            }

            foreach (var peer in peers)
            {
                var http  = new Port(Utils.Ports.GetPortProps(80, 80, "http"));
                var https = new Port(Utils.Ports.GetPortProps(443, 443, "https"));
                sg.AddIngressRule(peer, http, "ipv4-http");
                sg.AddIngressRule(peer, https, "ipv4-https");
            }

            return(sg);
        }
Esempio n. 7
0
 public S3BucketNotification(Constructs.Construct scope, string id, aws.IS3BucketNotificationConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 8
0
 public EmrInstanceGroup(Constructs.Construct scope, string id, aws.IEmrInstanceGroupConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 9
0
 public BudgetsBudget(Constructs.Construct scope, string id, aws.IBudgetsBudgetConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
 public NetworkAcl(Constructs.Construct scope, string id, aws.INetworkAclConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
 public DataAwsElbServiceAccount(Constructs.Construct scope, string id, aws.IDataAwsElbServiceAccountConfig?config = null) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 12
0
 public RamResourceAssociation(Constructs.Construct scope, string id, aws.IRamResourceAssociationConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 13
0
 public WafRule(Constructs.Construct scope, string id, aws.IWafRuleConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 14
0
 public CognitoIdentityProvider(Constructs.Construct scope, string id, aws.ICognitoIdentityProviderConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
 public ApiGatewayMethodResponse(Constructs.Construct scope, string id, aws.IApiGatewayMethodResponseConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 16
0
 public SnsPlatformApplication(Constructs.Construct scope, string id, aws.ISnsPlatformApplicationConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 17
0
 public DataAwsSubnet(Constructs.Construct scope, string id, aws.IDataAwsSubnetConfig?config = null) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
 public DataAwsWafIpset(Constructs.Construct scope, string id, aws.IDataAwsWafIpsetConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 19
0
 public SagemakerEndpoint(Constructs.Construct scope, string id, aws.ISagemakerEndpointConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
 public AmiFromInstance(Constructs.Construct scope, string id, aws.IAmiFromInstanceConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
 public OpsworksHaproxyLayer(Constructs.Construct scope, string id, aws.IOpsworksHaproxyLayerConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 22
0
 public DataAwsElasticBeanstalkHostedZone(Constructs.Construct scope, string id, aws.IDataAwsElasticBeanstalkHostedZoneConfig?config = null) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 23
0
 public VpnConnection(Constructs.Construct scope, string id, aws.IVpnConnectionConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 24
0
 public SesDomainMailFrom(Constructs.Construct scope, string id, aws.ISesDomainMailFromConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 25
0
 public MediaStoreContainerPolicy(Constructs.Construct scope, string id, aws.IMediaStoreContainerPolicyConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 26
0
 public RedshiftSnapshotSchedule(Constructs.Construct scope, string id, aws.IRedshiftSnapshotScheduleConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
 public LightsailInstance(Constructs.Construct scope, string id, aws.ILightsailInstanceConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 28
0
 public DxGatewayAssociationProposal(Constructs.Construct scope, string id, aws.IDxGatewayAssociationProposalConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
Esempio n. 29
0
 public DataAwsEc2LocalGatewayVirtualInterfaceGroup(Constructs.Construct scope, string id, aws.IDataAwsEc2LocalGatewayVirtualInterfaceGroupConfig?config = null) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }
 public DirectoryServiceConditionalForwarder(Constructs.Construct scope, string id, aws.IDirectoryServiceConditionalForwarderConfig config) : base(new DeputyProps(new object?[] { scope, id, config }))
 {
 }