From 944dc5f560d8d9042c637e8a5f2f99bf9a3a976b Mon Sep 17 00:00:00 2001 From: Juan Heyns Date: Thu, 16 Nov 2023 12:18:00 -0500 Subject: [PATCH] fix: specifying writer on DatabaseCluster publiclyAccessable is ignored for clusters in a public subnet --- .../__entrypoint__.js | 147 ++ .../index.js | 95 + .../cdk.out | 1 + .../integ-aurora-pub-sn-cluster.assets.json | 32 + .../integ-aurora-pub-sn-cluster.template.json | 1073 ++++++++++ .../integ.json | 12 + ...efaultTestDeployAssert24D5C536.assets.json | 19 + ...aultTestDeployAssert24D5C536.template.json | 36 + .../manifest.json | 407 ++++ .../tree.json | 1774 +++++++++++++++++ .../test/integ.cluster-public-subnets.ts | 72 + .../aws-rds/lib/aurora-cluster-instance.ts | 4 +- .../aws-cdk-lib/aws-rds/test/cluster.test.ts | 72 +- 13 files changed, 3741 insertions(+), 3 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/asset.1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed/__entrypoint__.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/asset.1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed/index.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ-aurora-pub-sn-cluster.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ-aurora-pub-sn-cluster.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integtestDefaultTestDeployAssert24D5C536.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/asset.1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/asset.1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed/__entrypoint__.js new file mode 100644 index 0000000000000..c83ecebaaadac --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/asset.1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed/__entrypoint__.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withRetries = exports.handler = exports.external = void 0; +const https = require("https"); +const url = require("url"); +// for unit tests +exports.external = { + sendHttpRequest: defaultSendHttpRequest, + log: defaultLog, + includeStackTraces: true, + userHandlerIndex: './index', +}; +const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; +const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; +async function handler(event, context) { + const sanitizedEvent = { ...event, ResponseURL: '...' }; + exports.external.log(JSON.stringify(sanitizedEvent, undefined, 2)); + // ignore DELETE event when the physical resource ID is the marker that + // indicates that this DELETE is a subsequent DELETE to a failed CREATE + // operation. + if (event.RequestType === 'Delete' && event.PhysicalResourceId === CREATE_FAILED_PHYSICAL_ID_MARKER) { + exports.external.log('ignoring DELETE event caused by a failed CREATE event'); + await submitResponse('SUCCESS', event); + return; + } + try { + // invoke the user handler. this is intentionally inside the try-catch to + // ensure that if there is an error it's reported as a failure to + // cloudformation (otherwise cfn waits). + // eslint-disable-next-line @typescript-eslint/no-require-imports + const userHandler = require(exports.external.userHandlerIndex).handler; + const result = await userHandler(sanitizedEvent, context); + // validate user response and create the combined event + const responseEvent = renderResponse(event, result); + // submit to cfn as success + await submitResponse('SUCCESS', responseEvent); + } + catch (e) { + const resp = { + ...event, + Reason: exports.external.includeStackTraces ? e.stack : e.message, + }; + if (!resp.PhysicalResourceId) { + // special case: if CREATE fails, which usually implies, we usually don't + // have a physical resource id. in this case, the subsequent DELETE + // operation does not have any meaning, and will likely fail as well. to + // address this, we use a marker so the provider framework can simply + // ignore the subsequent DELETE. + if (event.RequestType === 'Create') { + exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); + resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; + } + else { + // otherwise, if PhysicalResourceId is not specified, something is + // terribly wrong because all other events should have an ID. + exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); + } + } + // this is an actual error, fail the activity altogether and exist. + await submitResponse('FAILED', resp); + } +} +exports.handler = handler; +function renderResponse(cfnRequest, handlerResponse = {}) { + // if physical ID is not returned, we have some defaults for you based + // on the request type. + const physicalResourceId = handlerResponse.PhysicalResourceId ?? cfnRequest.PhysicalResourceId ?? cfnRequest.RequestId; + // if we are in DELETE and physical ID was changed, it's an error. + if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { + throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`); + } + // merge request event and result event (result prevails). + return { + ...cfnRequest, + ...handlerResponse, + PhysicalResourceId: physicalResourceId, + }; +} +async function submitResponse(status, event) { + const json = { + Status: status, + Reason: event.Reason ?? status, + StackId: event.StackId, + RequestId: event.RequestId, + PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, + LogicalResourceId: event.LogicalResourceId, + NoEcho: event.NoEcho, + Data: event.Data, + }; + exports.external.log('submit response to cloudformation', json); + const responseBody = JSON.stringify(json); + const parsedUrl = url.parse(event.ResponseURL); + const req = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + const retryOptions = { + attempts: 5, + sleep: 1000, + }; + await withRetries(retryOptions, exports.external.sendHttpRequest)(req, responseBody); +} +async function defaultSendHttpRequest(options, responseBody) { + return new Promise((resolve, reject) => { + try { + const request = https.request(options, _ => resolve()); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +function defaultLog(fmt, ...params) { + // eslint-disable-next-line no-console + console.log(fmt, ...params); +} +function withRetries(options, fn) { + return async (...xs) => { + let attempts = options.attempts; + let ms = options.sleep; + while (true) { + try { + return await fn(...xs); + } + catch (e) { + if (attempts-- <= 0) { + throw e; + } + await sleep(Math.floor(Math.random() * ms)); + ms *= 2; + } + } + }; +} +exports.withRetries = withRetries; +async function sleep(ms) { + return new Promise((ok) => setTimeout(ok, ms)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZWpzLWVudHJ5cG9pbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJub2RlanMtZW50cnlwb2ludC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBRTNCLGlCQUFpQjtBQUNKLFFBQUEsUUFBUSxHQUFHO0lBQ3RCLGVBQWUsRUFBRSxzQkFBc0I7SUFDd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AgICAgICAgbXMgKj0gMjtcbiAgICAgIH1cbiAgICB9XG4gIH07XG59XG5cbmFzeW5jIGZ1bmN0aW9uIHNsZWVwKG1zOiBudW1iZXIpOiBQcm9taXNlPHZvaWQ+IHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlKChvaykgPT4gc2V0VGltZW91dChvaywgbXMpKTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/asset.1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/asset.1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed/index.js new file mode 100644 index 0000000000000..2c32e2c82e3e9 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/asset.1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed/index.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handler = void 0; +/* eslint-disable-next-line import/no-extraneous-dependencies */ +const sdk = require("@aws-sdk/client-ec2"); +const ec2 = new sdk.EC2({}); +/** + * The default security group ingress rule. This can be used to both revoke and authorize the rules + */ +function ingressRuleParams(groupId, account) { + return { + GroupId: groupId, + IpPermissions: [{ + UserIdGroupPairs: [{ + GroupId: groupId, + UserId: account, + }], + IpProtocol: '-1', + }], + }; +} +/** + * The default security group egress rule. This can be used to both revoke and authorize the rules + */ +function egressRuleParams(groupId) { + return { + GroupId: groupId, + IpPermissions: [{ + IpRanges: [{ + CidrIp: '0.0.0.0/0', + }], + IpProtocol: '-1', + }], + }; +} +/** + * Process a custom resource request to restrict the default security group + * ingress & egress rules. + * + * When someone turns off the property then this custom resource will be deleted in which + * case we should add back the rules that were removed. + */ +async function handler(event) { + const securityGroupId = event.ResourceProperties.DefaultSecurityGroupId; + const account = event.ResourceProperties.Account; + switch (event.RequestType) { + case 'Create': + return revokeRules(securityGroupId, account); + case 'Update': + return onUpdate(event); + case 'Delete': + return authorizeRules(securityGroupId, account); + } +} +exports.handler = handler; +async function onUpdate(event) { + const oldSg = event.OldResourceProperties.DefaultSecurityGroupId; + const newSg = event.ResourceProperties.DefaultSecurityGroupId; + if (oldSg !== newSg) { + await authorizeRules(oldSg, event.ResourceProperties.Account); + await revokeRules(newSg, event.ResourceProperties.Account); + } + return; +} +/** + * Revoke both ingress and egress rules + */ +async function revokeRules(groupId, account) { + try { + await ec2.revokeSecurityGroupEgress(egressRuleParams(groupId)); + } + catch (e) { + if (e.name !== 'InvalidPermission.NotFound') { + throw (e); + } + } + try { + await ec2.revokeSecurityGroupIngress(ingressRuleParams(groupId, account)); + } + catch (e) { + if (e.name !== 'InvalidPermission.NotFound') { + throw (e); + } + } + return; +} +/** + * Authorize both ingress and egress rules + */ +async function authorizeRules(groupId, account) { + await ec2.authorizeSecurityGroupIngress(ingressRuleParams(groupId, account)); + await ec2.authorizeSecurityGroupEgress(egressRuleParams(groupId)); + return; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxnRUFBZ0U7QUFDaEUsMkNBQTJDO0FBRTNDLE1BQU0sR0FBRyxHQUFHLElBQUksR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUU1Qjs7R0FFRztBQUNILFNBQVMsaUJBQWlCLENBQUMsT0FBZSxFQUFFLE9BQWU7SUFHekQsT0FBTztRQUNMLE9BQU8sRUFBRSxPQUFPO1FBQ2hCLGFBQWEsRUFBRSxDQUFDO2dCQUNkLGdCQUFnQixFQUFFLENBQUM7d0JBQ2pCLE9BQU8sRUFBRSxPQ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ICBhd2FpdCBlYzIucmV2b2tlU2VjdXJpdHlHcm91cEVncmVzcyhlZ3Jlc3NSdWxlUGFyYW1zKGdyb3VwSWQpKTtcbiAgfSBjYXRjaCAoZTogYW55KSB7XG4gICAgaWYgKGUubmFtZSAhPT0gJ0ludmFsaWRQZXJtaXNzaW9uLk5vdEZvdW5kJykge1xuICAgICAgdGhyb3cgKGUpO1xuICAgIH1cbiAgfVxuICB0cnkge1xuICAgIGF3YWl0IGVjMi5yZXZva2VTZWN1cml0eUdyb3VwSW5ncmVzcyhpbmdyZXNzUnVsZVBhcmFtcyhncm91cElkLCBhY2NvdW50KSk7XG4gIH0gY2F0Y2ggKGU6IGFueSkge1xuICAgIGlmIChlLm5hbWUgIT09ICdJbnZhbGlkUGVybWlzc2lvbi5Ob3RGb3VuZCcpIHtcbiAgICAgIHRocm93IChlKTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuO1xufVxuXG4vKipcbiAqIEF1dGhvcml6ZSBib3RoIGluZ3Jlc3MgYW5kIGVncmVzcyBydWxlc1xuICovXG5hc3luYyBmdW5jdGlvbiBhdXRob3JpemVSdWxlcyhncm91cElkOiBzdHJpbmcsIGFjY291bnQ6IHN0cmluZyk6IFByb21pc2U8dm9pZD4ge1xuICBhd2FpdCBlYzIuYXV0aG9yaXplU2VjdXJpdHlHcm91cEluZ3Jlc3MoaW5ncmVzc1J1bGVQYXJhbXMoZ3JvdXBJZCwgYWNjb3VudCkpO1xuICBhd2FpdCBlYzIuYXV0aG9yaXplU2VjdXJpdHlHcm91cEVncmVzcyhlZ3Jlc3NSdWxlUGFyYW1zKGdyb3VwSWQpKTtcbiAgcmV0dXJuO1xufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/cdk.out new file mode 100644 index 0000000000000..c5cb2e5de6344 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"35.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ-aurora-pub-sn-cluster.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ-aurora-pub-sn-cluster.assets.json new file mode 100644 index 0000000000000..fc37b5300adab --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ-aurora-pub-sn-cluster.assets.json @@ -0,0 +1,32 @@ +{ + "version": "35.0.0", + "files": { + "1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed": { + "source": { + "path": "asset.1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "c56dab6af770314b3df625f39107b6601d2343f2cc772b0badb2edaa3066a81c": { + "source": { + "path": "integ-aurora-pub-sn-cluster.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "c56dab6af770314b3df625f39107b6601d2343f2cc772b0badb2edaa3066a81c.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ-aurora-pub-sn-cluster.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ-aurora-pub-sn-cluster.template.json new file mode 100644 index 0000000000000..fb53ac6d15d9d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ-aurora-pub-sn-cluster.template.json @@ -0,0 +1,1073 @@ +{ + "Resources": { + "IntegVPC2FF1AB0E": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC" + } + ] + } + }, + "IntegVPCPublicSubnet1SubnetE05F7E7D": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "IntegVPCPublicSubnet1RouteTable622895C7": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "IntegVPCPublicSubnet1RouteTableAssociation0E84800B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "IntegVPCPublicSubnet1RouteTable622895C7" + }, + "SubnetId": { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + } + } + }, + "IntegVPCPublicSubnet1DefaultRouteE885D95E": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "IntegVPCIGW02FC78B6" + }, + "RouteTableId": { + "Ref": "IntegVPCPublicSubnet1RouteTable622895C7" + } + }, + "DependsOn": [ + "IntegVPCVPCGW4DD476C7" + ] + }, + "IntegVPCPublicSubnet1EIP1AC057E9": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1" + } + ] + } + }, + "IntegVPCPublicSubnet1NATGateway380AC0A0": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "IntegVPCPublicSubnet1EIP1AC057E9", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "IntegVPCPublicSubnet1DefaultRouteE885D95E", + "IntegVPCPublicSubnet1RouteTableAssociation0E84800B" + ] + }, + "IntegVPCPublicSubnet2Subnet9648DE97": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "IntegVPCPublicSubnet2RouteTableB79B3910": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "IntegVPCPublicSubnet2RouteTableAssociation831EA0CC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "IntegVPCPublicSubnet2RouteTableB79B3910" + }, + "SubnetId": { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + } + } + }, + "IntegVPCPublicSubnet2DefaultRoute2FC4B163": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "IntegVPCIGW02FC78B6" + }, + "RouteTableId": { + "Ref": "IntegVPCPublicSubnet2RouteTableB79B3910" + } + }, + "DependsOn": [ + "IntegVPCVPCGW4DD476C7" + ] + }, + "IntegVPCPublicSubnet2EIPEA07DF99": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2" + } + ] + } + }, + "IntegVPCPublicSubnet2NATGateway912800A3": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "IntegVPCPublicSubnet2EIPEA07DF99", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "IntegVPCPublicSubnet2DefaultRoute2FC4B163", + "IntegVPCPublicSubnet2RouteTableAssociation831EA0CC" + ] + }, + "IntegVPCPrivateSubnet1SubnetD5B61223": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "IntegVPCPrivateSubnet1RouteTableF2678D77": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "IntegVPCPrivateSubnet1RouteTableAssociationAD4B0EBF": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "IntegVPCPrivateSubnet1RouteTableF2678D77" + }, + "SubnetId": { + "Ref": "IntegVPCPrivateSubnet1SubnetD5B61223" + } + } + }, + "IntegVPCPrivateSubnet1DefaultRoute140D7A84": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "IntegVPCPublicSubnet1NATGateway380AC0A0" + }, + "RouteTableId": { + "Ref": "IntegVPCPrivateSubnet1RouteTableF2678D77" + } + } + }, + "IntegVPCPrivateSubnet2SubnetFCC4EF23": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "IntegVPCPrivateSubnet2RouteTable4132D373": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "IntegVPCPrivateSubnet2RouteTableAssociation9A15DAD6": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "IntegVPCPrivateSubnet2RouteTable4132D373" + }, + "SubnetId": { + "Ref": "IntegVPCPrivateSubnet2SubnetFCC4EF23" + } + } + }, + "IntegVPCPrivateSubnet2DefaultRouteAE44E307": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "IntegVPCPublicSubnet2NATGateway912800A3" + }, + "RouteTableId": { + "Ref": "IntegVPCPrivateSubnet2RouteTable4132D373" + } + } + }, + "IntegVPCIGW02FC78B6": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-aurora-pub-sn-cluster/Integ-VPC" + } + ] + } + }, + "IntegVPCVPCGW4DD476C7": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "IntegVPCIGW02FC78B6" + }, + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "IntegVPCRestrictDefaultSecurityGroupCustomResource42DF8AB1": { + "Type": "Custom::VpcRestrictDefaultSG", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E", + "Arn" + ] + }, + "DefaultSecurityGroupId": { + "Fn::GetAtt": [ + "IntegVPC2FF1AB0E", + "DefaultSecurityGroup" + ] + }, + "Account": { + "Ref": "AWS::AccountId" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ], + "Policies": [ + { + "PolicyName": "Inline", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "ec2:AuthorizeSecurityGroupIngress", + "ec2:AuthorizeSecurityGroupEgress", + "ec2:RevokeSecurityGroupIngress", + "ec2:RevokeSecurityGroupEgress" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":security-group/", + { + "Fn::GetAtt": [ + "IntegVPC2FF1AB0E", + "DefaultSecurityGroup" + ] + } + ] + ] + } + ] + } + ] + } + } + ] + } + }, + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "1be0bac6581864b510bdbf0a114f1d3429244758da7657cc365f73d371fe70ed.zip" + }, + "Timeout": 900, + "MemorySize": 128, + "Handler": "__entrypoint__.handler", + "Role": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Description": "Lambda function for removing all inbound/outbound rules from the VPC default security group" + }, + "DependsOn": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0" + ] + }, + "integauroraserverlessv20IntegClusterSubnets2462DA9D": { + "Type": "AWS::RDS::DBSubnetGroup", + "Properties": { + "DBSubnetGroupDescription": "Subnets for Integ-Cluster database", + "SubnetIds": [ + { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + }, + { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + } + ] + } + }, + "integauroraserverlessv20IntegClusterSecurityGroup0FF1F93F": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "RDS security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "integauroraserverlessv20IntegClusterSecretB9E432EB": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Generated by the CDK for stack: ", + { + "Ref": "AWS::StackName" + } + ] + ] + }, + "GenerateSecretString": { + "ExcludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "integauroraserverlessv20IntegClusterSecretAttachmentABF2342B": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "integauroraserverlessv20IntegClusterSecretB9E432EB" + }, + "TargetId": { + "Ref": "integauroraserverlessv20IntegCluster5133790E" + }, + "TargetType": "AWS::RDS::DBCluster" + } + }, + "integauroraserverlessv20IntegCluster5133790E": { + "Type": "AWS::RDS::DBCluster", + "Properties": { + "CopyTagsToSnapshot": true, + "DBClusterParameterGroupName": "default.aurora-mysql8.0", + "DBSubnetGroupName": { + "Ref": "integauroraserverlessv20IntegClusterSubnets2462DA9D" + }, + "Engine": "aurora-mysql", + "EngineVersion": "8.0.mysql_aurora.3.03.0", + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv20IntegClusterSecretB9E432EB" + }, + ":SecretString:password::}}" + ] + ] + }, + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv20IntegClusterSecretB9E432EB" + }, + ":SecretString:username::}}" + ] + ] + }, + "ServerlessV2ScalingConfiguration": { + "MaxCapacity": 2, + "MinCapacity": 0.5 + }, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "integauroraserverlessv20IntegClusterSecurityGroup0FF1F93F", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "integauroraserverlessv20IntegClusterwriter68858AE9": { + "Type": "AWS::RDS::DBInstance", + "Properties": { + "DBClusterIdentifier": { + "Ref": "integauroraserverlessv20IntegCluster5133790E" + }, + "DBInstanceClass": "db.serverless", + "Engine": "aurora-mysql", + "PromotionTier": 0, + "PubliclyAccessible": true + }, + "DependsOn": [ + "IntegVPCPublicSubnet1DefaultRouteE885D95E", + "IntegVPCPublicSubnet1RouteTableAssociation0E84800B", + "IntegVPCPublicSubnet2DefaultRoute2FC4B163", + "IntegVPCPublicSubnet2RouteTableAssociation831EA0CC" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "integauroraserverlessv20capacity09BB04C7": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "DBClusterIdentifier", + "Value": { + "Ref": "integauroraserverlessv20IntegCluster5133790E" + } + } + ], + "EvaluationPeriods": 3, + "MetricName": "ServerlessDatabaseCapacity", + "Namespace": "AWS/RDS", + "Period": 600, + "Statistic": "Average", + "Threshold": 1.5 + } + }, + "integauroraserverlessv20alarmA67BFE09": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "DBClusterIdentifier", + "Value": { + "Ref": "integauroraserverlessv20IntegCluster5133790E" + } + } + ], + "EvaluationPeriods": 3, + "MetricName": "ACUUtilization", + "Namespace": "AWS/RDS", + "Period": 600, + "Statistic": "Average", + "Threshold": 90 + } + }, + "integauroraserverlessv21IntegClusterSubnetsAEE71920": { + "Type": "AWS::RDS::DBSubnetGroup", + "Properties": { + "DBSubnetGroupDescription": "Subnets for Integ-Cluster database", + "SubnetIds": [ + { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + }, + { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + } + ] + } + }, + "integauroraserverlessv21IntegClusterSecurityGroup483E60E7": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "RDS security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "integauroraserverlessv21IntegClusterSecretA8DA28CB": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Generated by the CDK for stack: ", + { + "Ref": "AWS::StackName" + } + ] + ] + }, + "GenerateSecretString": { + "ExcludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "integauroraserverlessv21IntegClusterSecretAttachmentB7E69BEA": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "integauroraserverlessv21IntegClusterSecretA8DA28CB" + }, + "TargetId": { + "Ref": "integauroraserverlessv21IntegClusterDFF12F00" + }, + "TargetType": "AWS::RDS::DBCluster" + } + }, + "integauroraserverlessv21IntegClusterDFF12F00": { + "Type": "AWS::RDS::DBCluster", + "Properties": { + "CopyTagsToSnapshot": true, + "DBClusterParameterGroupName": "default.aurora-mysql8.0", + "DBSubnetGroupName": { + "Ref": "integauroraserverlessv21IntegClusterSubnetsAEE71920" + }, + "Engine": "aurora-mysql", + "EngineVersion": "8.0.mysql_aurora.3.03.0", + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv21IntegClusterSecretA8DA28CB" + }, + ":SecretString:password::}}" + ] + ] + }, + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv21IntegClusterSecretA8DA28CB" + }, + ":SecretString:username::}}" + ] + ] + }, + "ServerlessV2ScalingConfiguration": { + "MaxCapacity": 2, + "MinCapacity": 0.5 + }, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "integauroraserverlessv21IntegClusterSecurityGroup483E60E7", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "integauroraserverlessv21IntegClusterwriterD87D3A20": { + "Type": "AWS::RDS::DBInstance", + "Properties": { + "DBClusterIdentifier": { + "Ref": "integauroraserverlessv21IntegClusterDFF12F00" + }, + "DBInstanceClass": "db.serverless", + "Engine": "aurora-mysql", + "PromotionTier": 0, + "PubliclyAccessible": true + }, + "DependsOn": [ + "IntegVPCPublicSubnet1DefaultRouteE885D95E", + "IntegVPCPublicSubnet1RouteTableAssociation0E84800B", + "IntegVPCPublicSubnet2DefaultRoute2FC4B163", + "IntegVPCPublicSubnet2RouteTableAssociation831EA0CC" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "integauroraserverlessv21capacityAFD8D6D1": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "DBClusterIdentifier", + "Value": { + "Ref": "integauroraserverlessv21IntegClusterDFF12F00" + } + } + ], + "EvaluationPeriods": 3, + "MetricName": "ServerlessDatabaseCapacity", + "Namespace": "AWS/RDS", + "Period": 600, + "Statistic": "Average", + "Threshold": 1.5 + } + }, + "integauroraserverlessv21alarmE70B8A00": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "DBClusterIdentifier", + "Value": { + "Ref": "integauroraserverlessv21IntegClusterDFF12F00" + } + } + ], + "EvaluationPeriods": 3, + "MetricName": "ACUUtilization", + "Namespace": "AWS/RDS", + "Period": 600, + "Statistic": "Average", + "Threshold": 90 + } + }, + "integauroraserverlessv22IntegClusterSubnets241DB50C": { + "Type": "AWS::RDS::DBSubnetGroup", + "Properties": { + "DBSubnetGroupDescription": "Subnets for Integ-Cluster database", + "SubnetIds": [ + { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + }, + { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + } + ] + } + }, + "integauroraserverlessv22IntegClusterSecurityGroup0EDBBE37": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "RDS security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "integauroraserverlessv22IntegClusterSecretBF74DBA3": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "Description": { + "Fn::Join": [ + "", + [ + "Generated by the CDK for stack: ", + { + "Ref": "AWS::StackName" + } + ] + ] + }, + "GenerateSecretString": { + "ExcludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "integauroraserverlessv22IntegClusterSecretAttachment4864E40A": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "integauroraserverlessv22IntegClusterSecretBF74DBA3" + }, + "TargetId": { + "Ref": "integauroraserverlessv22IntegCluster1F86F0C6" + }, + "TargetType": "AWS::RDS::DBCluster" + } + }, + "integauroraserverlessv22IntegCluster1F86F0C6": { + "Type": "AWS::RDS::DBCluster", + "Properties": { + "CopyTagsToSnapshot": true, + "DBClusterParameterGroupName": "default.aurora-mysql8.0", + "DBSubnetGroupName": { + "Ref": "integauroraserverlessv22IntegClusterSubnets241DB50C" + }, + "Engine": "aurora-mysql", + "EngineVersion": "8.0.mysql_aurora.3.03.0", + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv22IntegClusterSecretBF74DBA3" + }, + ":SecretString:password::}}" + ] + ] + }, + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv22IntegClusterSecretBF74DBA3" + }, + ":SecretString:username::}}" + ] + ] + }, + "ServerlessV2ScalingConfiguration": { + "MaxCapacity": 2, + "MinCapacity": 0.5 + }, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "integauroraserverlessv22IntegClusterSecurityGroup0EDBBE37", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "integauroraserverlessv22IntegClusterwriter4C20F6E7": { + "Type": "AWS::RDS::DBInstance", + "Properties": { + "DBClusterIdentifier": { + "Ref": "integauroraserverlessv22IntegCluster1F86F0C6" + }, + "DBInstanceClass": "db.serverless", + "Engine": "aurora-mysql", + "PromotionTier": 0, + "PubliclyAccessible": false + }, + "DependsOn": [ + "IntegVPCPublicSubnet1DefaultRouteE885D95E", + "IntegVPCPublicSubnet1RouteTableAssociation0E84800B", + "IntegVPCPublicSubnet2DefaultRoute2FC4B163", + "IntegVPCPublicSubnet2RouteTableAssociation831EA0CC" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "integauroraserverlessv22capacityCC6A400C": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "DBClusterIdentifier", + "Value": { + "Ref": "integauroraserverlessv22IntegCluster1F86F0C6" + } + } + ], + "EvaluationPeriods": 3, + "MetricName": "ServerlessDatabaseCapacity", + "Namespace": "AWS/RDS", + "Period": 600, + "Statistic": "Average", + "Threshold": 1.5 + } + }, + "integauroraserverlessv22alarmA8DB3F10": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "DBClusterIdentifier", + "Value": { + "Ref": "integauroraserverlessv22IntegCluster1F86F0C6" + } + } + ], + "EvaluationPeriods": 3, + "MetricName": "ACUUtilization", + "Namespace": "AWS/RDS", + "Period": 600, + "Statistic": "Average", + "Threshold": 90 + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ.json new file mode 100644 index 0000000000000..f74be57fa0f6b --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "35.0.0", + "testCases": { + "integ-test/DefaultTest": { + "stacks": [ + "integ-aurora-pub-sn-cluster" + ], + "assertionStack": "integ-test/DefaultTest/DeployAssert", + "assertionStackName": "integtestDefaultTestDeployAssert24D5C536" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json new file mode 100644 index 0000000000000..72a74237471ae --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json @@ -0,0 +1,19 @@ +{ + "version": "35.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "integtestDefaultTestDeployAssert24D5C536.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integtestDefaultTestDeployAssert24D5C536.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integtestDefaultTestDeployAssert24D5C536.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/integtestDefaultTestDeployAssert24D5C536.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/manifest.json new file mode 100644 index 0000000000000..b14518977b3ee --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/manifest.json @@ -0,0 +1,407 @@ +{ + "version": "35.0.0", + "artifacts": { + "integ-aurora-pub-sn-cluster.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-aurora-pub-sn-cluster.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-aurora-pub-sn-cluster": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-aurora-pub-sn-cluster.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c56dab6af770314b3df625f39107b6601d2343f2cc772b0badb2edaa3066a81c.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-aurora-pub-sn-cluster.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-aurora-pub-sn-cluster.assets" + ], + "metadata": { + "/integ-aurora-pub-sn-cluster/Integ-VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPC2FF1AB0E" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet1SubnetE05F7E7D" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet1RouteTable622895C7" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet1RouteTableAssociation0E84800B" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet1DefaultRouteE885D95E" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet1EIP1AC057E9" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet1NATGateway380AC0A0" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet2Subnet9648DE97" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet2RouteTableB79B3910" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet2RouteTableAssociation831EA0CC" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet2DefaultRoute2FC4B163" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet2EIPEA07DF99" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPublicSubnet2NATGateway912800A3" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPrivateSubnet1SubnetD5B61223" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPrivateSubnet1RouteTableF2678D77" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPrivateSubnet1RouteTableAssociationAD4B0EBF" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPrivateSubnet1DefaultRoute140D7A84" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPrivateSubnet2SubnetFCC4EF23" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPrivateSubnet2RouteTable4132D373" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPrivateSubnet2RouteTableAssociation9A15DAD6" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCPrivateSubnet2DefaultRouteAE44E307" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCIGW02FC78B6" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCVPCGW4DD476C7" + } + ], + "/integ-aurora-pub-sn-cluster/Integ-VPC/RestrictDefaultSecurityGroupCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "IntegVPCRestrictDefaultSecurityGroupCustomResource42DF8AB1" + } + ], + "/integ-aurora-pub-sn-cluster/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0" + } + ], + "/integ-aurora-pub-sn-cluster/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv20IntegClusterSubnets2462DA9D" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv20IntegClusterSecurityGroup0FF1F93F" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv20IntegClusterSecretB9E432EB" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv20IntegClusterSecretAttachmentABF2342B" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv20IntegCluster5133790E" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/writer/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv20IntegClusterwriter68858AE9" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/capacity/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv20capacity09BB04C7" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/alarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv20alarmA67BFE09" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv21IntegClusterSubnetsAEE71920" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv21IntegClusterSecurityGroup483E60E7" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv21IntegClusterSecretA8DA28CB" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv21IntegClusterSecretAttachmentB7E69BEA" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv21IntegClusterDFF12F00" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/writer/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv21IntegClusterwriterD87D3A20" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/capacity/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv21capacityAFD8D6D1" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/alarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv21alarmE70B8A00" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv22IntegClusterSubnets241DB50C" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv22IntegClusterSecurityGroup0EDBBE37" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv22IntegClusterSecretBF74DBA3" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv22IntegClusterSecretAttachment4864E40A" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv22IntegCluster1F86F0C6" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/writer/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv22IntegClusterwriter4C20F6E7" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/capacity/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv22capacityCC6A400C" + } + ], + "/integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/alarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "integauroraserverlessv22alarmA8DB3F10" + } + ], + "/integ-aurora-pub-sn-cluster/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-aurora-pub-sn-cluster/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-aurora-pub-sn-cluster" + }, + "integtestDefaultTestDeployAssert24D5C536.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integtestDefaultTestDeployAssert24D5C536.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integtestDefaultTestDeployAssert24D5C536": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integtestDefaultTestDeployAssert24D5C536.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integtestDefaultTestDeployAssert24D5C536.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integtestDefaultTestDeployAssert24D5C536.assets" + ], + "metadata": { + "/integ-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-test/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/tree.json new file mode 100644 index 0000000000000..b85a2e0acd596 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.js.snapshot/tree.json @@ -0,0 +1,1774 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-aurora-pub-sn-cluster": { + "id": "integ-aurora-pub-sn-cluster", + "path": "integ-aurora-pub-sn-cluster", + "children": { + "Integ-VPC": { + "id": "Integ-VPC", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "IntegVPCPublicSubnet1RouteTable622895C7" + }, + "subnetId": { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "IntegVPCIGW02FC78B6" + }, + "routeTableId": { + "Ref": "IntegVPCPublicSubnet1RouteTable622895C7" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "IntegVPCPublicSubnet1EIP1AC057E9", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + }, + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "IntegVPCPublicSubnet2RouteTableB79B3910" + }, + "subnetId": { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "IntegVPCIGW02FC78B6" + }, + "routeTableId": { + "Ref": "IntegVPCPublicSubnet2RouteTableB79B3910" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "IntegVPCPublicSubnet2EIPEA07DF99", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + }, + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "IntegVPCPrivateSubnet1RouteTableF2678D77" + }, + "subnetId": { + "Ref": "IntegVPCPrivateSubnet1SubnetD5B61223" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "IntegVPCPublicSubnet1NATGateway380AC0A0" + }, + "routeTableId": { + "Ref": "IntegVPCPrivateSubnet1RouteTableF2678D77" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "IntegVPCPrivateSubnet2RouteTable4132D373" + }, + "subnetId": { + "Ref": "IntegVPCPrivateSubnet2SubnetFCC4EF23" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "IntegVPCPublicSubnet2NATGateway912800A3" + }, + "routeTableId": { + "Ref": "IntegVPCPrivateSubnet2RouteTable4132D373" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-aurora-pub-sn-cluster/Integ-VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "IntegVPCIGW02FC78B6" + }, + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + }, + "RestrictDefaultSecurityGroupCustomResource": { + "id": "RestrictDefaultSecurityGroupCustomResource", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/RestrictDefaultSecurityGroupCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "integ-aurora-pub-sn-cluster/Integ-VPC/RestrictDefaultSecurityGroupCustomResource/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "Custom::VpcRestrictDefaultSGCustomResourceProvider": { + "id": "Custom::VpcRestrictDefaultSGCustomResourceProvider", + "path": "integ-aurora-pub-sn-cluster/Custom::VpcRestrictDefaultSGCustomResourceProvider", + "children": { + "Staging": { + "id": "Staging", + "path": "integ-aurora-pub-sn-cluster/Custom::VpcRestrictDefaultSGCustomResourceProvider/Staging", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "integ-aurora-pub-sn-cluster/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + }, + "Handler": { + "id": "Handler", + "path": "integ-aurora-pub-sn-cluster/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResourceProvider", + "version": "0.0.0" + } + }, + "integ-aurora-serverlessv2-0": { + "id": "integ-aurora-serverlessv2-0", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0", + "children": { + "Integ-Cluster": { + "id": "Integ-Cluster", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBSubnetGroup", + "aws:cdk:cloudformation:props": { + "dbSubnetGroupDescription": "Subnets for Integ-Cluster database", + "subnetIds": [ + { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + }, + { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.SubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "RDS security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "AuroraMySqlDatabaseClusterEngineDefaultParameterGroup": { + "id": "AuroraMySqlDatabaseClusterEngineDefaultParameterGroup", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/AuroraMySqlDatabaseClusterEngineDefaultParameterGroup", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "description": { + "Fn::Join": [ + "", + [ + "Generated by the CDK for stack: ", + { + "Ref": "AWS::StackName" + } + ] + ] + }, + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "integauroraserverlessv20IntegClusterSecretB9E432EB" + }, + "targetId": { + "Ref": "integauroraserverlessv20IntegCluster5133790E" + }, + "targetType": "AWS::RDS::DBCluster" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", + "aws:cdk:cloudformation:props": { + "copyTagsToSnapshot": true, + "dbClusterParameterGroupName": "default.aurora-mysql8.0", + "dbSubnetGroupName": { + "Ref": "integauroraserverlessv20IntegClusterSubnets2462DA9D" + }, + "engine": "aurora-mysql", + "engineVersion": "8.0.mysql_aurora.3.03.0", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv20IntegClusterSecretB9E432EB" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv20IntegClusterSecretB9E432EB" + }, + ":SecretString:password::}}" + ] + ] + }, + "serverlessV2ScalingConfiguration": { + "minCapacity": 0.5, + "maxCapacity": 2 + }, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "integauroraserverlessv20IntegClusterSecurityGroup0FF1F93F", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBCluster", + "version": "0.0.0" + } + }, + "writer": { + "id": "writer", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/writer", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/Integ-Cluster/writer/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBInstance", + "aws:cdk:cloudformation:props": { + "dbClusterIdentifier": { + "Ref": "integauroraserverlessv20IntegCluster5133790E" + }, + "dbInstanceClass": "db.serverless", + "engine": "aurora-mysql", + "promotionTier": 0, + "publiclyAccessible": true + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBInstance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.DatabaseCluster", + "version": "0.0.0" + } + }, + "capacity": { + "id": "capacity", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/capacity", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/capacity/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "DBClusterIdentifier", + "value": { + "Ref": "integauroraserverlessv20IntegCluster5133790E" + } + } + ], + "evaluationPeriods": 3, + "metricName": "ServerlessDatabaseCapacity", + "namespace": "AWS/RDS", + "period": 600, + "statistic": "Average", + "threshold": 1.5 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" + } + }, + "alarm": { + "id": "alarm", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/alarm", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-0/alarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "DBClusterIdentifier", + "value": { + "Ref": "integauroraserverlessv20IntegCluster5133790E" + } + } + ], + "evaluationPeriods": 3, + "metricName": "ACUUtilization", + "namespace": "AWS/RDS", + "period": 600, + "statistic": "Average", + "threshold": 90 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "integ-aurora-serverlessv2-1": { + "id": "integ-aurora-serverlessv2-1", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1", + "children": { + "Integ-Cluster": { + "id": "Integ-Cluster", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBSubnetGroup", + "aws:cdk:cloudformation:props": { + "dbSubnetGroupDescription": "Subnets for Integ-Cluster database", + "subnetIds": [ + { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + }, + { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.SubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "RDS security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "AuroraMySqlDatabaseClusterEngineDefaultParameterGroup": { + "id": "AuroraMySqlDatabaseClusterEngineDefaultParameterGroup", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/AuroraMySqlDatabaseClusterEngineDefaultParameterGroup", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "description": { + "Fn::Join": [ + "", + [ + "Generated by the CDK for stack: ", + { + "Ref": "AWS::StackName" + } + ] + ] + }, + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "integauroraserverlessv21IntegClusterSecretA8DA28CB" + }, + "targetId": { + "Ref": "integauroraserverlessv21IntegClusterDFF12F00" + }, + "targetType": "AWS::RDS::DBCluster" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", + "aws:cdk:cloudformation:props": { + "copyTagsToSnapshot": true, + "dbClusterParameterGroupName": "default.aurora-mysql8.0", + "dbSubnetGroupName": { + "Ref": "integauroraserverlessv21IntegClusterSubnetsAEE71920" + }, + "engine": "aurora-mysql", + "engineVersion": "8.0.mysql_aurora.3.03.0", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv21IntegClusterSecretA8DA28CB" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv21IntegClusterSecretA8DA28CB" + }, + ":SecretString:password::}}" + ] + ] + }, + "serverlessV2ScalingConfiguration": { + "minCapacity": 0.5, + "maxCapacity": 2 + }, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "integauroraserverlessv21IntegClusterSecurityGroup483E60E7", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBCluster", + "version": "0.0.0" + } + }, + "writer": { + "id": "writer", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/writer", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/Integ-Cluster/writer/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBInstance", + "aws:cdk:cloudformation:props": { + "dbClusterIdentifier": { + "Ref": "integauroraserverlessv21IntegClusterDFF12F00" + }, + "dbInstanceClass": "db.serverless", + "engine": "aurora-mysql", + "promotionTier": 0, + "publiclyAccessible": true + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBInstance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.DatabaseCluster", + "version": "0.0.0" + } + }, + "capacity": { + "id": "capacity", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/capacity", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/capacity/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "DBClusterIdentifier", + "value": { + "Ref": "integauroraserverlessv21IntegClusterDFF12F00" + } + } + ], + "evaluationPeriods": 3, + "metricName": "ServerlessDatabaseCapacity", + "namespace": "AWS/RDS", + "period": 600, + "statistic": "Average", + "threshold": 1.5 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" + } + }, + "alarm": { + "id": "alarm", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/alarm", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-1/alarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "DBClusterIdentifier", + "value": { + "Ref": "integauroraserverlessv21IntegClusterDFF12F00" + } + } + ], + "evaluationPeriods": 3, + "metricName": "ACUUtilization", + "namespace": "AWS/RDS", + "period": 600, + "statistic": "Average", + "threshold": 90 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "integ-aurora-serverlessv2-2": { + "id": "integ-aurora-serverlessv2-2", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2", + "children": { + "Integ-Cluster": { + "id": "Integ-Cluster", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBSubnetGroup", + "aws:cdk:cloudformation:props": { + "dbSubnetGroupDescription": "Subnets for Integ-Cluster database", + "subnetIds": [ + { + "Ref": "IntegVPCPublicSubnet1SubnetE05F7E7D" + }, + { + "Ref": "IntegVPCPublicSubnet2Subnet9648DE97" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.SubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "RDS security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "IntegVPC2FF1AB0E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "AuroraMySqlDatabaseClusterEngineDefaultParameterGroup": { + "id": "AuroraMySqlDatabaseClusterEngineDefaultParameterGroup", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/AuroraMySqlDatabaseClusterEngineDefaultParameterGroup", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "description": { + "Fn::Join": [ + "", + [ + "Generated by the CDK for stack: ", + { + "Ref": "AWS::StackName" + } + ] + ] + }, + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "integauroraserverlessv22IntegClusterSecretBF74DBA3" + }, + "targetId": { + "Ref": "integauroraserverlessv22IntegCluster1F86F0C6" + }, + "targetType": "AWS::RDS::DBCluster" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", + "aws:cdk:cloudformation:props": { + "copyTagsToSnapshot": true, + "dbClusterParameterGroupName": "default.aurora-mysql8.0", + "dbSubnetGroupName": { + "Ref": "integauroraserverlessv22IntegClusterSubnets241DB50C" + }, + "engine": "aurora-mysql", + "engineVersion": "8.0.mysql_aurora.3.03.0", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv22IntegClusterSecretBF74DBA3" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "integauroraserverlessv22IntegClusterSecretBF74DBA3" + }, + ":SecretString:password::}}" + ] + ] + }, + "serverlessV2ScalingConfiguration": { + "minCapacity": 0.5, + "maxCapacity": 2 + }, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "integauroraserverlessv22IntegClusterSecurityGroup0EDBBE37", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBCluster", + "version": "0.0.0" + } + }, + "writer": { + "id": "writer", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/writer", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/Integ-Cluster/writer/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBInstance", + "aws:cdk:cloudformation:props": { + "dbClusterIdentifier": { + "Ref": "integauroraserverlessv22IntegCluster1F86F0C6" + }, + "dbInstanceClass": "db.serverless", + "engine": "aurora-mysql", + "promotionTier": 0, + "publiclyAccessible": false + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBInstance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.DatabaseCluster", + "version": "0.0.0" + } + }, + "capacity": { + "id": "capacity", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/capacity", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/capacity/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "DBClusterIdentifier", + "value": { + "Ref": "integauroraserverlessv22IntegCluster1F86F0C6" + } + } + ], + "evaluationPeriods": 3, + "metricName": "ServerlessDatabaseCapacity", + "namespace": "AWS/RDS", + "period": 600, + "statistic": "Average", + "threshold": 1.5 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" + } + }, + "alarm": { + "id": "alarm", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/alarm", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-aurora-pub-sn-cluster/integ-aurora-serverlessv2-2/alarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "DBClusterIdentifier", + "value": { + "Ref": "integauroraserverlessv22IntegCluster1F86F0C6" + } + } + ], + "evaluationPeriods": 3, + "metricName": "ACUUtilization", + "namespace": "AWS/RDS", + "period": 600, + "statistic": "Average", + "threshold": 90 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-aurora-pub-sn-cluster/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-aurora-pub-sn-cluster/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "integ-test": { + "id": "integ-test", + "path": "integ-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "integ-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "integ-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "integ-test/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-test/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.ts new file mode 100644 index 0000000000000..cc9f7e2562564 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-public-subnets.ts @@ -0,0 +1,72 @@ +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import { App, Duration, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib'; +import { SubnetType, Vpc } from 'aws-cdk-lib/aws-ec2'; +import * as rds from 'aws-cdk-lib/aws-rds'; +import { ClusterInstance } from 'aws-cdk-lib/aws-rds'; +import { Construct } from 'constructs'; + +interface TestCaseProps extends Pick { +} + +class TestCase extends Construct { + constructor(scope: Construct, id: string, props: TestCaseProps) { + super(scope, id); + const cluster = new rds.DatabaseCluster(this, 'Integ-Cluster', { + engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_03_0 }), + writer: props.writer, + readers: props.readers, + removalPolicy: RemovalPolicy.DESTROY, + vpc: props.vpc, + vpcSubnets: props.vpcSubnets, + }); + cluster.metricServerlessDatabaseCapacity({ + period: Duration.minutes(10), + }).createAlarm(this, 'capacity', { + threshold: 1.5, + evaluationPeriods: 3, + }); + cluster.metricACUUtilization({ + period: Duration.minutes(10), + }).createAlarm(this, 'alarm', { + evaluationPeriods: 3, + threshold: 90, + }); + } +} + +const testCases: TestCaseProps[] = [ + { + writer: ClusterInstance.serverlessV2('writer'), + }, + { + writer: ClusterInstance.serverlessV2('writer', { + publiclyAccessible: true, + }), + }, + { + writer: ClusterInstance.serverlessV2('writer', { + publiclyAccessible: false, + }), + }, +]; + +export class TestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + const vpc = new Vpc(this, 'Integ-VPC'); + testCases.forEach((p: TestCaseProps, i) => + new TestCase(this, `integ-aurora-serverlessv2-${i}`, { + ...p, + vpc, + vpcSubnets: { + subnetType: SubnetType.PUBLIC, + }, + }), + ); + } +} + +const app = new App(); +new IntegTest(app, 'integ-test', { + testCases: [new TestStack(app, 'integ-aurora-pub-sn-cluster')], +}); diff --git a/packages/aws-cdk-lib/aws-rds/lib/aurora-cluster-instance.ts b/packages/aws-cdk-lib/aws-rds/lib/aurora-cluster-instance.ts index 8ac577a7f0a3d..a9458e6479b11 100644 --- a/packages/aws-cdk-lib/aws-rds/lib/aurora-cluster-instance.ts +++ b/packages/aws-cdk-lib/aws-rds/lib/aurora-cluster-instance.ts @@ -450,11 +450,11 @@ class AuroraClusterInstance extends Resource implements IAuroraClusterInstance { const isOwnedResource = Resource.isOwnedResource(props.cluster); let internetConnected; - let publiclyAccessible = props.publiclyAccessible; + let publiclyAccessible; if (isOwnedResource) { const ownedCluster = props.cluster as DatabaseCluster; internetConnected = ownedCluster.vpc.selectSubnets(ownedCluster.vpcSubnets).internetConnectivityEstablished; - publiclyAccessible = ownedCluster.vpcSubnets && ownedCluster.vpcSubnets.subnetType === ec2.SubnetType.PUBLIC; + publiclyAccessible = props.publiclyAccessible ?? (ownedCluster.vpcSubnets && ownedCluster.vpcSubnets.subnetType === ec2.SubnetType.PUBLIC); } // Get the actual subnet objects so we can depend on internet connectivity. diff --git a/packages/aws-cdk-lib/aws-rds/test/cluster.test.ts b/packages/aws-cdk-lib/aws-rds/test/cluster.test.ts index a759faa15ffdb..94de1b6978981 100644 --- a/packages/aws-cdk-lib/aws-rds/test/cluster.test.ts +++ b/packages/aws-cdk-lib/aws-rds/test/cluster.test.ts @@ -3677,7 +3677,53 @@ describe('cluster', () => { }); }); - test('can set public accessibility for database cluster with instances in public subnet', () => { + test('omitting public accessibility will set it to a value based on vpc subnet selection', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + engine: DatabaseClusterEngine.AURORA, + writer: ClusterInstance.serverlessV2('writer'), + vpc, + vpcSubnets: { + subnetType: ec2.SubnetType.PUBLIC, + }, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::RDS::DBInstance', { + Engine: 'aurora', + PubliclyAccessible: true, + }); + }); + + test('can set public accessibility to true for database cluster with instances in public subnet', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + engine: DatabaseClusterEngine.AURORA, + instanceProps: { + vpc, + vpcSubnets: { + subnetType: ec2.SubnetType.PUBLIC, + }, + publiclyAccessible: true, + }, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::RDS::DBInstance', { + Engine: 'aurora', + PubliclyAccessible: true, + }); + }); + + test('can set public accessibility to false for database cluster with instances in public subnet', () => { // GIVEN const stack = testStack(); const vpc = new ec2.Vpc(stack, 'VPC'); @@ -3693,6 +3739,30 @@ describe('cluster', () => { publiclyAccessible: false, }, }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::RDS::DBInstance', { + Engine: 'aurora', + PubliclyAccessible: false, + }); + }); + + test('can set public accessibility to false on writer instance with cluster in public subnet', () => { + // GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + // WHEN + new DatabaseCluster(stack, 'Database', { + engine: DatabaseClusterEngine.AURORA, + writer: ClusterInstance.serverlessV2('writer', { + publiclyAccessible: false, + }), + vpc, + vpcSubnets: { + subnetType: ec2.SubnetType.PUBLIC, + }, + }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::RDS::DBInstance', { Engine: 'aurora',