Skip to content

Commit

Permalink
update integ test to destroy kms key
Browse files Browse the repository at this point in the history
  • Loading branch information
epoctic committed Oct 11, 2024
1 parent d589245 commit d137d34
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 122 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -195,42 +195,6 @@
"VPCVPCGW99B986DC"
]
},
"VPCPublicSubnet2EIP4947BC00": {
"Type": "AWS::EC2::EIP",
"Properties": {
"Domain": "vpc",
"Tags": [
{
"Key": "Name",
"Value": "integ-cluster-managed-password/VPC/PublicSubnet2"
}
]
}
},
"VPCPublicSubnet2NATGateway3C070193": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"AllocationId": {
"Fn::GetAtt": [
"VPCPublicSubnet2EIP4947BC00",
"AllocationId"
]
},
"SubnetId": {
"Ref": "VPCPublicSubnet2Subnet74179F39"
},
"Tags": [
{
"Key": "Name",
"Value": "integ-cluster-managed-password/VPC/PublicSubnet2"
}
]
},
"DependsOn": [
"VPCPublicSubnet2DefaultRouteB7481BBA",
"VPCPublicSubnet2RouteTableAssociation5A808732"
]
},
"VPCPrivateSubnet1Subnet8BCA10E0": {
"Type": "AWS::EC2::Subnet",
"Properties": {
Expand Down Expand Up @@ -362,7 +326,7 @@
"Properties": {
"DestinationCidrBlock": "0.0.0.0/0",
"NatGatewayId": {
"Ref": "VPCPublicSubnet2NATGateway3C070193"
"Ref": "VPCPublicSubnet1NATGatewayE0556630"
},
"RouteTableId": {
"Ref": "VPCPrivateSubnet2RouteTable0A19E10E"
Expand Down Expand Up @@ -423,8 +387,8 @@
"Version": "2012-10-17"
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"DatabaseSubnets56F17B9A": {
"Type": "AWS::RDS::DBSubnetGroup",
Expand Down Expand Up @@ -500,10 +464,6 @@
},
"MasterUsername": "testMasterUsername",
"Port": 5432,
"ServerlessV2ScalingConfiguration": {
"MaxCapacity": 2,
"MinCapacity": 0.5
},
"VpcSecurityGroupIds": [
{
"Fn::GetAtt": [
Expand All @@ -522,7 +482,7 @@
"DBClusterIdentifier": {
"Ref": "DatabaseB269D8BB"
},
"DBInstanceClass": "db.serverless",
"DBInstanceClass": "db.t4g.medium",
"Engine": "aurora-postgresql",
"PromotionTier": 0,
"PubliclyAccessible": true
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha';
class TestStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 2, restrictDefaultSecurityGroup: false });
const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 2, restrictDefaultSecurityGroup: false, natGateways: 1 });

const kmsKey = new kms.Key(this, 'DbSecurity');
const kmsKey = new kms.Key(this, 'DbSecurity', {
removalPolicy: cdk.RemovalPolicy.DESTROY,
});

const cluster = new DatabaseCluster(this, 'Database', {
engine: DatabaseClusterEngine.auroraPostgres({
Expand All @@ -19,11 +21,13 @@ class TestStack extends cdk.Stack {
manageMasterUserPassword: true,
vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },
vpc,
writer: ClusterInstance.serverlessV2('writer'),
writer: ClusterInstance.provisioned('writer', {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T4G, ec2.InstanceSize.MEDIUM),
}),
removalPolicy: cdk.RemovalPolicy.DESTROY,
});

cluster.connections.allowDefaultPortFromAnyIpv4('Open to the world');

}
}

Expand Down

0 comments on commit d137d34

Please sign in to comment.