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); }
/// <summary> /// Generates a secret with no KMS key /// </summary> /// <param name="secretName"></param> /// <param name="charsToExclude"></param> /// <param name="passwordLength"></param> /// <returns></returns> public ISecret AddSecret(string secretName, string charsToExclude = "^{}\"@/;-+=&\\/", int passwordLength = 16) { return(AwsCdkSecretHandler.Create(secretName, charsToExclude, passwordLength)); }
public string GetSecretValue(string secretId, string secretName, string secretManagerSuffix) { return(AwsCdkSecretHandler.GetSecretValue(secretId, secretName, secretManagerSuffix)); }
public AwsCdkDatabaseHandler(Construct scope, string applicationName, string environmentName, IAwsSecurityGroupHandler awsSecurityGroupHandler, AwsCdkVpcHandler awsCdkVpcHandler, AwsCdkSecretHandler awsCdkSecretHandler) : base(scope, applicationName, environmentName) { AwsSecurityGroupHandler = awsSecurityGroupHandler; AwsCdkVpcHandler = awsCdkVpcHandler; AwsCdkSecretHandler = awsCdkSecretHandler; }