Ejemplo n.º 1
0
        public AwsCdkHandler(Construct scope, string id, string applicationName, string environmentName, IStackProps props = null) : base(scope, id, props)
        {
            if (string.IsNullOrEmpty(applicationName) || string.IsNullOrEmpty(environmentName))
            {
                throw new ArgumentException("The application name or the environment name can not be null");
            }

            ApplicationName = applicationName;
            EnvironmentName = environmentName;

            AwsCdkKmsHandler        = new AwsCdkKmsHandler(this, ApplicationName, EnvironmentName);
            EnvironmentProperties   = props?.Env;
            AwsCdkVpcHandler        = new AwsCdkVpcHandler(this, ApplicationName, EnvironmentName);
            AwsCdkS3Handler         = new AwsCdkS3Handler(this, ApplicationName, EnvironmentName);
            AwsSecurityGroupHandler = new AwsSecurityGroupHandler(this, ApplicationName, EnvironmentName, AwsCdkVpcHandler);
            AwsCdkSecretHandler     = new AwsCdkSecretHandler(this, ApplicationName, EnvironmentName, AwsCdkKmsHandler, EnvironmentProperties?.Region, EnvironmentProperties?.Account);
            AwsCdkDatabaseHandler   = new AwsCdkDatabaseHandler(this, ApplicationName, EnvironmentName, AwsSecurityGroupHandler, AwsCdkVpcHandler, AwsCdkSecretHandler);
        }
Ejemplo n.º 2
0
 public IBucket AddS3Bucket(string bucketName, int expirationDays = 0, IList <ILifecycleRule> lifecycleRules = null, RemovalPolicy removalPolicy = RemovalPolicy.DESTROY, BucketEncryption encryption = BucketEncryption.KMS_MANAGED, string webSiteRedirectHost = "", bool versioned = true)
 {
     return(AwsCdkS3Handler.Create(bucketName, expirationDays, lifecycleRules, removalPolicy, encryption, webSiteRedirectHost, versioned));
 }