예제 #1
0
 private void InitializeHandlers()
 {
     AwsCdkVpcHandler                 = new AwsCdkVpcHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkDynamoDBHandler            = new AwsCdkDynamoDBHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkRoleHandler                = new AwsCdkRoleHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkPolicyDocumentHandler      = new AwsCdkPolicyDocumentHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkKmsHandler                 = new AwsCdkKmsHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkSecretHandler              = new AwsCdkSecretHandler(Scope, ApplicationName, EnvironmentName, AwsCdkKmsHandler, EnvironmentProperties.Region, EnvironmentProperties.Account);
     AwsSecurityGroupHandler          = new AwsSecurityGroupHandler(Scope, ApplicationName, EnvironmentName, AwsCdkVpcHandler, EnvironmentProperties.Region);
     AwsCdkDatabaseHandler            = new AwsCdkDatabaseHandler(Scope, ApplicationName, EnvironmentName, AwsSecurityGroupHandler, AwsCdkVpcHandler, AwsCdkSecretHandler, EnvironmentProperties.Region);
     AwsCdkS3Handler                  = new AwsCdkS3Handler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkLambdaHandler              = new AwsCdkLambdaHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkECRHandler                 = new AwsCdkEcrHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkEventBridgeHandler         = new AwsCdkEventBridgeHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkApiGatewayHandler          = new AwsCdkApiGatewayHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkCodeBuildHandler           = new AwsCdkCodeBuildHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkSsmParameterStoreHandler   = new AwsCdkSsmParameterStoreHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkNetworkLoadBalancerHandler = new AwsCdkNetworkLoadBalancerHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkElbHandler                 = new AwsCdkElbHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkAutoScalingGroupHandler    = new AwsCdkAutoScalingGroupHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkEcsHandler                 = new AwsCdkEcsHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkPipelineHandler            = new AwsCdkPipelineHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkDmsHandler                 = new AwsCdkDmsHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkWafHandler                 = new AwsCdkWafHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
     AwsCdkSnsHandler                 = new AwsCdkSnsHandler(Scope, ApplicationName, EnvironmentName, EnvironmentProperties.Region);
 }
        private void BasicDatabaseInfraWithHardcodedPassword(IVpc vpc,
                                                             SubnetType subnetType, string defaultSubnetDomainSeparator, string subnets, out ISubnetSelection subnetSelection)
        {
            if (vpc == null)
            {
                throw new ArgumentException($"The VPC provided to create the database is not valid");
            }

            subnetSelection = AwsCdkVpcHandler.GetVpcSubnetSelection(vpc, subnets, defaultSubnetDomainSeparator, subnetType);
        }
예제 #3
0
        public ISecurityGroup Create(string identification, string groupName, string vpcId, string vpcIdentification, bool allowAllOutbound = false, bool disableInlineRules = false)
        {
            if (string.IsNullOrEmpty(vpcId))
            {
                throw new ArgumentException("The VPC id cannot be null ");
            }

            var vpc = AwsCdkVpcHandler.Locate(vpcIdentification, vpcId);

            if (vpc == null)
            {
                throw new ArgumentException($"The provided vpcId {vpcId} does not exists");
            }

            return(Create(identification, groupName, vpc, allowAllOutbound));
        }
        private void BasicDatabaseInfra(IVpc vpc, string secretName, string securityId, string securityGroupId, SubnetType subnetType, string defaultSubnetDomainSeparator, string subnets, out ISecurityGroup securityGroup, out ISecret secret, out ISubnetSelection subnetSelection)                         //NOSONAR number of params
        {
            if (vpc == null)
            {
                throw new ArgumentException("The VPC provided to create the database is not valid");
            }

            securityGroup = AwsSecurityGroupHandler.Locate(securityId, securityGroupId);

            if (securityGroup == null)
            {
                throw new ArgumentException($"The Security group id {securityGroupId} provided to create the database is not valid");
            }

            secret          = AwsCdkSecretHandler.Create(secretName);
            subnetSelection = AwsCdkVpcHandler.GetVpcSubnetSelection(vpc, subnets, defaultSubnetDomainSeparator, subnetType);
        }
 public AwsCdkDatabaseHandler(Construct scope, string applicationName, string environmentName, IAwsSecurityGroupHandler awsSecurityGroupHandler, AwsCdkVpcHandler awsCdkVpcHandler, AwsCdkSecretHandler awsCdkSecretHandler, string region) : base(scope, applicationName, environmentName, region)
 {
     AwsSecurityGroupHandler = awsSecurityGroupHandler;
     AwsCdkVpcHandler        = awsCdkVpcHandler;
     AwsCdkSecretHandler     = awsCdkSecretHandler;
 }
예제 #6
0
 public AwsSecurityGroupHandler(Construct scope, string applicationName, string environmentName, AwsCdkVpcHandler awsCdkVpcHandler, string region) : base(scope, applicationName, environmentName, region)
 {
     AwsCdkVpcHandler = awsCdkVpcHandler;
     TagHandler       = new TagHandler();
 }