Exemplo n.º 1
0
        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)
        {
            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);
        }
        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);
        }