From d41005e79b959aaca3ac56d669d4f6c28cea3a06 Mon Sep 17 00:00:00 2001 From: jasonsaruulo Date: Tue, 19 Sep 2023 12:30:38 +0200 Subject: [PATCH 1/8] feat(cloudwatch): add verticalAnnotations property to GraphWidget (#26819) Adds a verticalAnnotation property to GraphWidget, reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-Annotation-Format Shoutout to brendo-m for coming up with the solution Closes #7622. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- ...WithAnnotationsIntegrationTest.assets.json | 19 +++ ...thAnnotationsIntegrationTest.template.json | 55 +++++++ .../cdk.out | 1 + ...efaultTestDeployAssertD4707D74.assets.json | 19 +++ ...aultTestDeployAssertD4707D74.template.json | 36 +++++ .../integ.json | 12 ++ .../manifest.json | 111 ++++++++++++++ .../tree.json | 136 ++++++++++++++++++ ...board-with-graphwidget-with-annotations.ts | 79 ++++++++++ packages/aws-cdk-lib/aws-cloudwatch/README.md | 5 +- .../aws-cdk-lib/aws-cloudwatch/lib/graph.ts | 91 +++++++++++- .../aws-cloudwatch/test/graphs.test.ts | 63 +++++++- 12 files changed, 621 insertions(+), 6 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/DashboardWithGraphWidgetWithAnnotationsIntegrationTest.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/DashboardWithGraphWidgetWithAnnotationsIntegrationTest.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/DashboardWithGraphWidgetWithAnnotationsIntegrationTest.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/DashboardWithGraphWidgetWithAnnotationsIntegrationTest.assets.json new file mode 100644 index 0000000000000..33c0bbc425f69 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/DashboardWithGraphWidgetWithAnnotationsIntegrationTest.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.0.0", + "files": { + "fa0b1fe0c3043238b7413b794c626bac246c94f150aa6e3ff441a030d7dce521": { + "source": { + "path": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "fa0b1fe0c3043238b7413b794c626bac246c94f150aa6e3ff441a030d7dce521.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/DashboardWithGraphWidgetWithAnnotationsIntegrationTest.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/DashboardWithGraphWidgetWithAnnotationsIntegrationTest.template.json new file mode 100644 index 0000000000000..b081129c76389 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/DashboardWithGraphWidgetWithAnnotationsIntegrationTest.template.json @@ -0,0 +1,55 @@ +{ + "Resources": { + "DashCCD7F836": { + "Type": "AWS::CloudWatch::Dashboard", + "Properties": { + "DashboardBody": { + "Fn::Join": [ + "", + [ + "{\"widgets\":[{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":0,\"properties\":{\"view\":\"timeSeries\",\"title\":\"My fancy graph\",\"region\":\"", + { + "Ref": "AWS::Region" + }, + "\",\"metrics\":[[\"CDK/Test\",\"Metric\",{\"label\":\"Metric left 1 - p99\",\"stat\":\"p99\"}],[\"CDK/Test\",\"Metric\",{\"label\":\"Metric left 2 - TC_10P_90P\",\"stat\":\"TC(10%:90%)\"}],[\"CDK/Test\",\"Metric\",{\"label\":\"Metric left 3 - TS(5%:95%)\",\"stat\":\"TS(5%:95%)\"}],[\"CDK/Test\",\"Metric\",{\"label\":\"Metric right 1 - p90.1234\",\"stat\":\"p90.1234\",\"yAxis\":\"right\"}]],\"annotations\":{\"horizontal\":[{\"value\":10,\"label\":\"Left annotation\",\"color\":\"#00ff00\",\"fill\":\"above\",\"visible\":true,\"yAxis\":\"left\"},{\"value\":20,\"label\":\"Right annotation\",\"color\":\"#e30d0d\",\"fill\":\"below\",\"visible\":false,\"yAxis\":\"right\"}],\"vertical\":[{\"value\":\"2023-08-20T00:00:00.000Z\",\"label\":\"Vertical annotation\",\"color\":\"#2556f6\",\"fill\":\"after\",\"visible\":true}]},\"yAxis\":{}}}]}" + ] + ] + } + } + } + }, + "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." + } + ] + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdk.out new file mode 100644 index 0000000000000..9982913536117 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"30.0.0"} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.assets.json new file mode 100644 index 0000000000000..5904b65ebec07 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.assets.json @@ -0,0 +1,19 @@ +{ + "version": "30.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.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": {} +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.template.json new file mode 100644 index 0000000000000..ec488341c0126 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.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." + } + ] + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/integ.json new file mode 100644 index 0000000000000..df1157fba97e4 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "30.0.0", + "testCases": { + "cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest": { + "stacks": [ + "DashboardWithGraphWidgetWithAnnotationsIntegrationTest" + ], + "assertionStack": "cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74" + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/manifest.json new file mode 100644 index 0000000000000..6e42eab89b36c --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/manifest.json @@ -0,0 +1,111 @@ +{ + "version": "30.0.0", + "artifacts": { + "DashboardWithGraphWidgetWithAnnotationsIntegrationTest.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "DashboardWithGraphWidgetWithAnnotationsIntegrationTest": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest.template.json", + "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}/fa0b1fe0c3043238b7413b794c626bac246c94f150aa6e3ff441a030d7dce521.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "DashboardWithGraphWidgetWithAnnotationsIntegrationTest.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": [ + "DashboardWithGraphWidgetWithAnnotationsIntegrationTest.assets" + ], + "metadata": { + "/DashboardWithGraphWidgetWithAnnotationsIntegrationTest/Dash/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DashCCD7F836" + } + ], + "/DashboardWithGraphWidgetWithAnnotationsIntegrationTest/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/DashboardWithGraphWidgetWithAnnotationsIntegrationTest/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest" + }, + "cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.template.json", + "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": [ + "cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.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": [ + "cdkintegdashboardwithgraphwidgetwithannotationsDefaultTestDeployAssertD4707D74.assets" + ], + "metadata": { + "/cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/tree.json new file mode 100644 index 0000000000000..09407c21d6fa8 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.js.snapshot/tree.json @@ -0,0 +1,136 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "DashboardWithGraphWidgetWithAnnotationsIntegrationTest": { + "id": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest", + "path": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest", + "children": { + "Dash": { + "id": "Dash", + "path": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest/Dash", + "children": { + "Resource": { + "id": "Resource", + "path": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest/Dash/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Dashboard", + "aws:cdk:cloudformation:props": { + "dashboardBody": { + "Fn::Join": [ + "", + [ + "{\"widgets\":[{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":0,\"properties\":{\"view\":\"timeSeries\",\"title\":\"My fancy graph\",\"region\":\"", + { + "Ref": "AWS::Region" + }, + "\",\"metrics\":[[\"CDK/Test\",\"Metric\",{\"label\":\"Metric left 1 - p99\",\"stat\":\"p99\"}],[\"CDK/Test\",\"Metric\",{\"label\":\"Metric left 2 - TC_10P_90P\",\"stat\":\"TC(10%:90%)\"}],[\"CDK/Test\",\"Metric\",{\"label\":\"Metric left 3 - TS(5%:95%)\",\"stat\":\"TS(5%:95%)\"}],[\"CDK/Test\",\"Metric\",{\"label\":\"Metric right 1 - p90.1234\",\"stat\":\"p90.1234\",\"yAxis\":\"right\"}]],\"annotations\":{\"horizontal\":[{\"value\":10,\"label\":\"Left annotation\",\"color\":\"#00ff00\",\"fill\":\"above\",\"visible\":true,\"yAxis\":\"left\"},{\"value\":20,\"label\":\"Right annotation\",\"color\":\"#e30d0d\",\"fill\":\"below\",\"visible\":false,\"yAxis\":\"right\"}],\"vertical\":[{\"value\":\"2023-08-20T00:00:00.000Z\",\"label\":\"Vertical annotation\",\"color\":\"#2556f6\",\"fill\":\"after\",\"visible\":true}]},\"yAxis\":{}}}]}" + ] + ] + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-cloudwatch.CfnDashboard", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-cloudwatch.Dashboard", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "DashboardWithGraphWidgetWithAnnotationsIntegrationTest/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-dashboard-with-graph-widget-with-annotations": { + "id": "cdk-integ-dashboard-with-graph-widget-with-annotations", + "path": "cdk-integ-dashboard-with-graph-widget-with-annotations", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-dashboard-with-graph-widget-with-annotations/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.252" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.ts new file mode 100644 index 0000000000000..371cafb60a47b --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-annotations.ts @@ -0,0 +1,79 @@ +import { App, Stack, StackProps } from 'aws-cdk-lib'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import { Dashboard, GraphWidget, Metric, Shading, Stats, VerticalShading } from 'aws-cdk-lib/aws-cloudwatch'; + +class DashboardWithGraphWidgetWithAnnotationsIntegrationTest extends Stack { + constructor(scope: App, id: string, props?: StackProps) { + super(scope, id, props); + + const dashboard = new Dashboard(this, 'Dash'); + + const widget = new GraphWidget({ + title: 'My fancy graph', + left: [ + new Metric({ + namespace: 'CDK/Test', + metricName: 'Metric', + label: 'Metric left 1 - p99', + statistic: Stats.p(99), + }), + + new Metric({ + namespace: 'CDK/Test', + metricName: 'Metric', + label: 'Metric left 2 - TC_10P_90P', + statistic: Stats.tc(10, 90), + }), + + new Metric({ + namespace: 'CDK/Test', + metricName: 'Metric', + label: 'Metric left 3 - TS(5%:95%)', + statistic: 'TS(5%:95%)', + }), + ], + right: [ + new Metric({ + namespace: 'CDK/Test', + metricName: 'Metric', + label: 'Metric right 1 - p90.1234', + statistic: 'p90.1234', + }), + ], + leftAnnotations: [ + { + value: 10, + label: 'Left annotation', + color: '#00ff00', + fill: Shading.ABOVE, + visible: true, + }, + ], + rightAnnotations: [ + { + value: 20, + label: 'Right annotation', + color: '#e30d0d', + fill: Shading.BELOW, + visible: false, + }, + ], + verticalAnnotations: [ + { + date: '2023-08-20T00:00:00.000Z', + label: 'Vertical annotation', + color: '#2556f6', + fill: VerticalShading.AFTER, + visible: true, + }, + ], + }); + + dashboard.addWidgets(widget); + } +} + +const app = new App(); +new IntegTest(app, 'cdk-integ-dashboard-with-graph-widget-with-annotations', { + testCases: [new DashboardWithGraphWidgetWithAnnotationsIntegrationTest(app, 'DashboardWithGraphWidgetWithAnnotationsIntegrationTest')], +}); diff --git a/packages/aws-cdk-lib/aws-cloudwatch/README.md b/packages/aws-cdk-lib/aws-cloudwatch/README.md index c28f46e28b476..7a6dc35cb6c64 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/README.md +++ b/packages/aws-cdk-lib/aws-cloudwatch/README.md @@ -428,7 +428,7 @@ dashboard.addWidgets(new cloudwatch.GraphWidget({ Using the methods `addLeftMetric()` and `addRightMetric()` you can add metrics to a graph widget later on. -Graph widgets can also display annotations attached to the left or the right y-axis. +Graph widgets can also display annotations attached to the left or right y-axis or the x-axis. ```ts declare const dashboard: cloudwatch.Dashboard; @@ -440,6 +440,9 @@ dashboard.addWidgets(new cloudwatch.GraphWidget({ { value: 1800, label: Duration.minutes(30).toHumanString(), color: cloudwatch.Color.RED, }, { value: 3600, label: '1 hour', color: '#2ca02c', } ], + verticalAnnotations: [ + { date: '2022-10-19T00:00:00Z', label: 'Deployment', color: cloudwatch.Color.RED, } + ] })); ``` diff --git a/packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts b/packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts index c7b5c7d497a34..8dfb0ff612abe 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts @@ -300,6 +300,13 @@ export interface GraphWidgetProps extends MetricWidgetProps { */ readonly rightAnnotations?: HorizontalAnnotation[]; + /** + * Annotations for the X axis + * + * @default - No annotations + */ + readonly verticalAnnotations?: VerticalAnnotation[]; + /** * Whether the graph should be shown as stacked lines * @@ -375,6 +382,12 @@ export interface GraphWidgetProps extends MetricWidgetProps { */ export class GraphWidget extends ConcreteWidget { + private static readonly ISO8601_REGEX = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/; + + private static isIso8601(date: string): boolean { + return this.ISO8601_REGEX.test(date); + } + private readonly props: GraphWidgetProps; private readonly leftMetrics: IMetric[]; @@ -382,6 +395,12 @@ export class GraphWidget extends ConcreteWidget { constructor(props: GraphWidgetProps) { super(props.width || 6, props.height || 6); + props.verticalAnnotations?.forEach(annotation => { + const date = annotation.date; + if (!GraphWidget.isIso8601(date)) { + throw new Error(`Given date ${date} is not in ISO 8601 format`); + } + }); this.props = props; this.leftMetrics = props.left ?? []; this.rightMetrics = props.right ?? []; @@ -413,7 +432,14 @@ export class GraphWidget extends ConcreteWidget { ...(this.props.leftAnnotations || []).map(mapAnnotation('left')), ...(this.props.rightAnnotations || []).map(mapAnnotation('right')), ]; - + const verticalAnnotations = (this.props.verticalAnnotations || []).map(({ date, ...rest }) => ({ + value: date, + ...rest, + })); + const annotations = horizontalAnnotations.length > 0 || verticalAnnotations.length > 0 ? ({ + horizontal: horizontalAnnotations.length > 0 ? horizontalAnnotations : undefined, + vertical: verticalAnnotations.length > 0 ? verticalAnnotations : undefined, + }) : undefined; const metrics = allMetricsGraphJson(this.leftMetrics, this.rightMetrics); return [{ type: 'metric', @@ -427,7 +453,7 @@ export class GraphWidget extends ConcreteWidget { region: this.props.region || cdk.Aws.REGION, stacked: this.props.stacked, metrics: metrics.length > 0 ? metrics : undefined, - annotations: horizontalAnnotations.length > 0 ? { horizontal: horizontalAnnotations } : undefined, + annotations, yAxis: { left: this.props.leftYAxis ?? undefined, right: this.props.rightYAxis ?? undefined, @@ -651,7 +677,46 @@ export interface HorizontalAnnotation { } /** - * Fill shading options that will be used with an annotation + * Vertical annotation to be added to a graph + */ +export interface VerticalAnnotation { + /** + * The date and time (in ISO 8601 format) in the graph where the vertical annotation line is to appear + */ + readonly date: string; + + /** + * Label for the annotation + * + * @default - No label + */ + readonly label?: string; + + /** + * The hex color code, prefixed with '#' (e.g. '#00ff00'), to be used for the annotation. + * The `Color` class has a set of standard colors that can be used here. + * + * @default - Automatic color + */ + readonly color?: string; + + /** + * Add shading before or after the annotation + * + * @default No shading + */ + readonly fill?: VerticalShading; + + /** + * Whether the annotation is visible + * + * @default true + */ + readonly visible?: boolean; +} + +/** + * Fill shading options that will be used with a horizontal annotation */ export enum Shading { /** @@ -670,6 +735,26 @@ export enum Shading { BELOW = 'below' } +/** + * Fill shading options that will be used with a vertical annotation + */ +export enum VerticalShading { + /** + * Don't add shading + */ + NONE = 'none', + + /** + * Add shading before the annotation + */ + BEFORE = 'before', + + /** + * Add shading after the annotation + */ + AFTER = 'after' +} + /** * A set of standard colours that can be used in annotations in a GraphWidget. */ diff --git a/packages/aws-cdk-lib/aws-cloudwatch/test/graphs.test.ts b/packages/aws-cdk-lib/aws-cloudwatch/test/graphs.test.ts index fc440f1c416b9..3c3e93b9524ac 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/test/graphs.test.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/test/graphs.test.ts @@ -1,5 +1,5 @@ import { Duration, Stack } from '../../core'; -import { Alarm, AlarmWidget, Color, GraphWidget, GraphWidgetView, LegendPosition, LogQueryWidget, Metric, Shading, SingleValueWidget, LogQueryVisualizationType, CustomWidget, GaugeWidget } from '../lib'; +import { Alarm, AlarmWidget, Color, GraphWidget, GraphWidgetView, LegendPosition, LogQueryWidget, Metric, Shading, SingleValueWidget, LogQueryVisualizationType, CustomWidget, GaugeWidget, VerticalShading } from '../lib'; describe('Graphs', () => { test('add stacked property to graphs', () => { @@ -401,7 +401,7 @@ describe('Graphs', () => { }]); }); - test('add annotations to graph', () => { + test('add horizontal annotations to graph', () => { // WHEN const stack = new Stack(); const widget = new GraphWidget({ @@ -444,6 +444,65 @@ describe('Graphs', () => { }); + test('add vertical annotations to graph', () => { + // WHEN + const stack = new Stack(); + const widget = new GraphWidget({ + title: 'My fancy graph', + left: [ + new Metric({ namespace: 'CDK', metricName: 'Test' }), + ], + verticalAnnotations: [{ + date: '2021-07-29T02:31:09.890Z', + color: '667788', + fill: VerticalShading.AFTER, + label: 'this is the annotation', + }], + }); + + // THEN + expect(stack.resolve(widget.toJson())).toEqual([{ + type: 'metric', + width: 6, + height: 6, + properties: { + view: 'timeSeries', + title: 'My fancy graph', + region: { Ref: 'AWS::Region' }, + metrics: [ + ['CDK', 'Test'], + ], + annotations: { + vertical: [{ + value: '2021-07-29T02:31:09.890Z', + color: '667788', + fill: 'after', + label: 'this is the annotation', + }], + }, + yAxis: {}, + }, + }]); + }); + + test('vertical annotation date must match ISO 8601', () => { + // WHEN + expect(() => { + new GraphWidget({ + title: 'My fancy graph', + left: [ + new Metric({ namespace: 'CDK', metricName: 'Test' }), + ], + verticalAnnotations: [{ + date: '2021-07-29T02:31:09.890ZZ', + color: '667788', + fill: VerticalShading.AFTER, + label: 'this is the annotation', + }], + }); + }).toThrow(); + }); + test('convert alarm to annotation', () => { // GIVEN const stack = new Stack(); From d9f1f0908a1f7ec0bfcb0df4f9dd1b45c86b0144 Mon Sep 17 00:00:00 2001 From: n0061q <95093640+n0061q@users.noreply.github.com> Date: Tue, 19 Sep 2023 13:55:45 +0300 Subject: [PATCH 2/8] fix(sample-app): exclude all __pycache__ in cdk.json (#27191) Following the cdk workshop for python I noticed that `cdk watch` watches files from `__pycache__`. This is an attempt to fix that. Steps to reproduce: 1. `cdk init sample-app --language python` 2. `cdk bootstrap` 3. Run `cdk watch` and notice that `__pycache__` folders are being watched: ``` 'watch' is observing directory 'cdk_workshop/__pycache__' for changes 'watch' is observing the file 'cdk_workshop/cdk_workshop_stack.py' for changes 'watch' is observing the file 'cdk_workshop/__pycache__/__init__.cpython-311.pyc' for changes 'watch' is observing the file 'cdk_workshop/__pycache__/cdk_workshop_stack.cpython-311.pyc' for changes ``` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cdk/lib/init-templates/app/python/cdk.template.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/init-templates/app/python/cdk.template.json b/packages/aws-cdk/lib/init-templates/app/python/cdk.template.json index 1c467275741e1..cbf387c538a58 100644 --- a/packages/aws-cdk/lib/init-templates/app/python/cdk.template.json +++ b/packages/aws-cdk/lib/init-templates/app/python/cdk.template.json @@ -8,7 +8,7 @@ "requirements*.txt", "source.bat", "**/__init__.py", - "python/__pycache__", + "**/__pycache__", "tests" ] } From d3789ab005d59307834147cddd0ec8bbada97332 Mon Sep 17 00:00:00 2001 From: Kirk Watson <60279003+kirkwat@users.noreply.github.com> Date: Tue, 19 Sep 2023 06:20:57 -0500 Subject: [PATCH 3/8] fix(rds): cluster.instanceIdentifiers does not container writer instance ID (#26929) Cluster writer instance ID is now returned in instanceIdentifiers with reader instance IDs. Closes #25947. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../Default.assets.json | 32 + .../Default.template.json | 695 +++++++++++ .../__entrypoint__.js | 147 +++ .../index.js | 81 ++ .../cdk.out | 1 + ...efaultTestDeployAssertC062AEBE.assets.json | 19 + ...aultTestDeployAssertC062AEBE.template.json | 36 + .../integ.json | 12 + .../manifest.json | 309 +++++ .../tree.json | 1060 +++++++++++++++++ .../aws-rds/test/integ.cluster-instance-id.ts | 30 + packages/aws-cdk-lib/aws-rds/lib/cluster.ts | 2 + .../aws-cdk-lib/aws-rds/test/cluster.test.ts | 23 + 13 files changed, 2447 insertions(+) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/Default.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/Default.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/asset.18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837/__entrypoint__.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/asset.18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837/index.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/Default.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/Default.assets.json new file mode 100644 index 0000000000000..e057e01c35972 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/Default.assets.json @@ -0,0 +1,32 @@ +{ + "version": "34.0.0", + "files": { + "18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837": { + "source": { + "path": "asset.18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "4341f9db698fa2f306e4cabc0cdac628e923e1ff6006ed5058ec60659714b6b3": { + "source": { + "path": "Default.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "4341f9db698fa2f306e4cabc0cdac628e923e1ff6006ed5058ec60659714b6b3.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-instance-id.js.snapshot/Default.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/Default.template.json new file mode 100644 index 0000000000000..4aec96613c2ef --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/Default.template.json @@ -0,0 +1,695 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC" + } + ] + } + }, + "VPCPublicSubnet1SubnetB4246D30": { + "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": "Default/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableAssociation0B0896DC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "VPCPublicSubnet1DefaultRoute91CEF279": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet1EIP6AD938E8": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet1DefaultRoute91CEF279", + "VPCPublicSubnet1RouteTableAssociation0B0896DC" + ] + }, + "VPCPublicSubnet2Subnet74179F39": { + "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": "Default/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTableAssociation5A808732": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "VPCPublicSubnet2DefaultRouteB7481BBA": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet2EIP4947BC00": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2NATGateway3C070193": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet2DefaultRouteB7481BBA", + "VPCPublicSubnet2RouteTableAssociation5A808732" + ] + }, + "VPCPrivateSubnet1Subnet8BCA10E0": { + "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": "Default/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableAssociation347902D1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "VPCPrivateSubnet1DefaultRouteAE1D6490": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "VPCPrivateSubnet2SubnetCFCDAA7A": { + "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": "Default/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTableAssociation0C73D413": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "VPCIGWB7E252D3": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "Default/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCRestrictDefaultSecurityGroupCustomResource59474679": { + "Type": "Custom::VpcRestrictDefaultSG", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E", + "Arn" + ] + }, + "DefaultSecurityGroupId": { + "Fn::GetAtt": [ + "VPCB9E5F0B4", + "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": [ + "VPCB9E5F0B4", + "DefaultSecurityGroup" + ] + } + ] + ] + } + ] + } + ] + } + } + ] + } + }, + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837.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" + ] + }, + "DatabaseSubnets56F17B9A": { + "Type": "AWS::RDS::DBSubnetGroup", + "Properties": { + "DBSubnetGroupDescription": "Subnets for Database database", + "SubnetIds": [ + { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ] + } + }, + "DatabaseSecurityGroup5C91FDCB": { + "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": "VPCB9E5F0B4" + } + } + }, + "DatabaseSecret3B817195": { + "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" + }, + "DatabaseSecretAttachmentE5D1B020": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "DatabaseSecret3B817195" + }, + "TargetId": { + "Ref": "DatabaseB269D8BB" + }, + "TargetType": "AWS::RDS::DBCluster" + } + }, + "DatabaseB269D8BB": { + "Type": "AWS::RDS::DBCluster", + "Properties": { + "CopyTagsToSnapshot": true, + "DBClusterParameterGroupName": "default.aurora-mysql8.0", + "DBSubnetGroupName": { + "Ref": "DatabaseSubnets56F17B9A" + }, + "Engine": "aurora-mysql", + "EngineVersion": "8.0.mysql_aurora.3.01.0", + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "DatabaseSecret3B817195" + }, + ":SecretString:password::}}" + ] + ] + }, + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "DatabaseSecret3B817195" + }, + ":SecretString:username::}}" + ] + ] + }, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "DatabaseSecurityGroup5C91FDCB", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Snapshot", + "DeletionPolicy": "Snapshot" + }, + "DatabaseInstanceAA8A5FDE": { + "Type": "AWS::RDS::DBInstance", + "Properties": { + "DBClusterIdentifier": { + "Ref": "DatabaseB269D8BB" + }, + "DBInstanceClass": "db.t3.small", + "Engine": "aurora-mysql", + "PromotionTier": 0 + }, + "DependsOn": [ + "VPCPrivateSubnet1DefaultRouteAE1D6490", + "VPCPrivateSubnet1RouteTableAssociation347902D1", + "VPCPrivateSubnet2DefaultRouteF4F5CFD2", + "VPCPrivateSubnet2RouteTableAssociation0C73D413" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Databasereader13B43287": { + "Type": "AWS::RDS::DBInstance", + "Properties": { + "DBClusterIdentifier": { + "Ref": "DatabaseB269D8BB" + }, + "DBInstanceClass": "db.t3.medium", + "Engine": "aurora-mysql", + "PromotionTier": 2 + }, + "DependsOn": [ + "VPCPrivateSubnet1DefaultRouteAE1D6490", + "VPCPrivateSubnet1RouteTableAssociation347902D1", + "VPCPrivateSubnet2DefaultRouteF4F5CFD2", + "VPCPrivateSubnet2RouteTableAssociation0C73D413" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "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-instance-id.js.snapshot/asset.18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/asset.18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837/__entrypoint__.js new file mode 100644 index 0000000000000..c83ecebaaadac --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/asset.18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837/__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(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GlvbnMuYXR0ZW1wdHM7XG4gICAgbGV0IG1zID0gb3B0aW9ucy5zbGVlcDtcbiAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgdHJ5IHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IGZuKC4uLnhzKTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgaWYgKGF0dGVtcHRzLS0gPD0gMCkge1xuICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH1cbiAgICAgICAgYXdhaXQgc2xlZXAoTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogbXMpKTtcbiAgICAgICAgbXMgKj0gMjtcbiAgICAgIH1cbiAgICB9XG4gIH07XG59XG5cbmFzeW5jIGZ1bmN0aW9uIHNsZWVwKG1zOiBudW1iZXIpOiBQcm9taXNlPHZvaWQ+IHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlKChvaykgPT4gc2V0VGltZW91dChvaywgbXMpKTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/asset.18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/asset.18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837/index.js new file mode 100644 index 0000000000000..8cbc0ea437b76 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/asset.18d379b052acd60e0d086d5b19d9bef956ebc0bd018c5570960125aab0c7f837/index.js @@ -0,0 +1,81 @@ +"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) { + await ec2.revokeSecurityGroupEgress(egressRuleParams(groupId)); + await ec2.revokeSecurityGroupIngress(ingressRuleParams(groupId, account)); + 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxnRUFBZ0U7QUFDaEUsMkNBQTJDO0FBRTNDLE1BQU0sR0FBRyxHQUFHLElBQUksR0FBRyxDQUFDL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xuICBhd2FpdCBlYzIucmV2b2tlU2VjdXJpdHlHcm91cEluZ3Jlc3MoaW5ncmVzc1J1bGVQYXJhbXMoZ3JvdXBJZCwgYWNjb3VudCkpO1xuICByZXR1cm47XG59XG5cbi8qKlxuICogQXV0aG9yaXplIGJvdGggaW5ncmVzcyBhbmQgZWdyZXNzIHJ1bGVzXG4gKi9cbmFzeW5jIGZ1bmN0aW9uIGF1dGhvcml6ZVJ1bGVzKGdyb3VwSWQ6IHN0cmluZywgYWNjb3VudDogc3RyaW5nKTogUHJvbWlzZTx2b2lkPiB7XG4gIGF3YWl0IGVjMi5hdXRob3JpemVTZWN1cml0eUdyb3VwSW5ncmVzcyhpbmdyZXNzUnVsZVBhcmFtcyhncm91cElkLCBhY2NvdW50KSk7XG4gIGF3YWl0IGVjMi5hdXRob3JpemVTZWN1cml0eUdyb3VwRWdyZXNzKGVncmVzc1J1bGVQYXJhbXMoZ3JvdXBJZCkpO1xuICByZXR1cm47XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/cdk.out new file mode 100644 index 0000000000000..2313ab5436501 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.assets.json new file mode 100644 index 0000000000000..f7ed86b367988 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.assets.json @@ -0,0 +1,19 @@ +{ + "version": "34.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.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-instance-id.js.snapshot/instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.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-instance-id.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/integ.json new file mode 100644 index 0000000000000..6133d8a59eafc --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "34.0.0", + "testCases": { + "instanceIdentifiersTest/DefaultTest": { + "stacks": [ + "Default" + ], + "assertionStack": "instanceIdentifiersTest/DefaultTest/DeployAssert", + "assertionStackName": "instanceIdentifiersTestDefaultTestDeployAssertC062AEBE" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/manifest.json new file mode 100644 index 0000000000000..6ad27dde4ec7b --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/manifest.json @@ -0,0 +1,309 @@ +{ + "version": "34.0.0", + "artifacts": { + "Default.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "Default.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "Default": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "Default.template.json", + "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}/4341f9db698fa2f306e4cabc0cdac628e923e1ff6006ed5058ec60659714b6b3.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "Default.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": [ + "Default.assets" + ], + "metadata": { + "/Default/VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCB9E5F0B4" + } + ], + "/Default/VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1SubnetB4246D30" + } + ], + "/Default/VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableFEE4B781" + } + ], + "/Default/VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" + } + ], + "/Default/VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1DefaultRoute91CEF279" + } + ], + "/Default/VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1EIP6AD938E8" + } + ], + "/Default/VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1NATGatewayE0556630" + } + ], + "/Default/VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2Subnet74179F39" + } + ], + "/Default/VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTable6F1A15F1" + } + ], + "/Default/VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTableAssociation5A808732" + } + ], + "/Default/VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2DefaultRouteB7481BBA" + } + ], + "/Default/VPC/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2EIP4947BC00" + } + ], + "/Default/VPC/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2NATGateway3C070193" + } + ], + "/Default/VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "/Default/VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableBE8A6027" + } + ], + "/Default/VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" + } + ], + "/Default/VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" + } + ], + "/Default/VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "/Default/VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTable0A19E10E" + } + ], + "/Default/VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" + } + ], + "/Default/VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + } + ], + "/Default/VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCIGWB7E252D3" + } + ], + "/Default/VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCVPCGW99B986DC" + } + ], + "/Default/VPC/RestrictDefaultSecurityGroupCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCRestrictDefaultSecurityGroupCustomResource59474679" + } + ], + "/Default/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0" + } + ], + "/Default/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E" + } + ], + "/Default/Database": [ + { + "type": "aws:cdk:warning", + "data": "There are provisioned readers in the highest promotion tier 2 that do not have the same InstanceSize as the writer. Any of these instances could be chosen as the new writer in the event of a failover.\nWriter InstanceSize: t3.small\nReader InstanceSizes: t3.medium [ack: @aws-cdk/aws-rds:provisionedReadersDontMatchWriter]" + } + ], + "/Default/Database/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "DatabaseSubnets56F17B9A" + } + ], + "/Default/Database/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DatabaseSecurityGroup5C91FDCB" + } + ], + "/Default/Database/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DatabaseSecret3B817195" + } + ], + "/Default/Database/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DatabaseSecretAttachmentE5D1B020" + } + ], + "/Default/Database/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DatabaseB269D8BB" + } + ], + "/Default/Database/Instance/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DatabaseInstanceAA8A5FDE" + } + ], + "/Default/Database/reader/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Databasereader13B43287" + } + ], + "/Default/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/Default/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "Default" + }, + "instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "instanceIdentifiersTestDefaultTestDeployAssertC062AEBE": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.template.json", + "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": [ + "instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.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": [ + "instanceIdentifiersTestDefaultTestDeployAssertC062AEBE.assets" + ], + "metadata": { + "/instanceIdentifiersTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/instanceIdentifiersTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "instanceIdentifiersTest/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-instance-id.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/tree.json new file mode 100644 index 0000000000000..026fe38915823 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.js.snapshot/tree.json @@ -0,0 +1,1060 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "Default": { + "id": "Default", + "path": "Default", + "children": { + "VPC": { + "id": "VPC", + "path": "Default/VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "Default/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": "Default/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "Default/VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "Default/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": "Default/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "Default/VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "Default/VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "Default/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "Default/VPC/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "Default/VPC/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "Default/VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "Default/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "Default/VPC/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "tags": [ + { + "key": "Name", + "value": "Default/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": "Default/VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "Default/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": "Default/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "Default/VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "Default/VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "Default/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "Default/VPC/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "Default/VPC/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "Default/VPC/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "Default/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "Default/VPC/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "tags": [ + { + "key": "Name", + "value": "Default/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": "Default/VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "Default/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": "Default/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "Default/VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "Default/VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "Default/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "Default/VPC/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "Default/VPC/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "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": "Default/VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "Default/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": "Default/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "Default/VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "Default/VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "Default/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "Default/VPC/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "Default/VPC/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "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": "Default/VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "Default/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "Default/VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + }, + "RestrictDefaultSecurityGroupCustomResource": { + "id": "RestrictDefaultSecurityGroupCustomResource", + "path": "Default/VPC/RestrictDefaultSecurityGroupCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "Default/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": "Default/Custom::VpcRestrictDefaultSGCustomResourceProvider", + "children": { + "Staging": { + "id": "Staging", + "path": "Default/Custom::VpcRestrictDefaultSGCustomResourceProvider/Staging", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "Default/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + }, + "Handler": { + "id": "Handler", + "path": "Default/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResourceProvider", + "version": "0.0.0" + } + }, + "Database": { + "id": "Database", + "path": "Default/Database", + "children": { + "Subnets": { + "id": "Subnets", + "path": "Default/Database/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "Default/Database/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBSubnetGroup", + "aws:cdk:cloudformation:props": { + "dbSubnetGroupDescription": "Subnets for Database database", + "subnetIds": [ + { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ] + } + }, + "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": "Default/Database/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "Default/Database/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": "VPCB9E5F0B4" + } + } + }, + "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": "Default/Database/AuroraMySqlDatabaseClusterEngineDefaultParameterGroup", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "Default/Database/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "Default/Database/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": "Default/Database/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "Default/Database/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "DatabaseSecret3B817195" + }, + "targetId": { + "Ref": "DatabaseB269D8BB" + }, + "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": "Default/Database/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBCluster", + "aws:cdk:cloudformation:props": { + "copyTagsToSnapshot": true, + "dbClusterParameterGroupName": "default.aurora-mysql8.0", + "dbSubnetGroupName": { + "Ref": "DatabaseSubnets56F17B9A" + }, + "engine": "aurora-mysql", + "engineVersion": "8.0.mysql_aurora.3.01.0", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "DatabaseSecret3B817195" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "DatabaseSecret3B817195" + }, + ":SecretString:password::}}" + ] + ] + }, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "DatabaseSecurityGroup5C91FDCB", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBCluster", + "version": "0.0.0" + } + }, + "Instance": { + "id": "Instance", + "path": "Default/Database/Instance", + "children": { + "Resource": { + "id": "Resource", + "path": "Default/Database/Instance/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBInstance", + "aws:cdk:cloudformation:props": { + "dbClusterIdentifier": { + "Ref": "DatabaseB269D8BB" + }, + "dbInstanceClass": "db.t3.small", + "engine": "aurora-mysql", + "promotionTier": 0 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_rds.CfnDBInstance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "reader": { + "id": "reader", + "path": "Default/Database/reader", + "children": { + "Resource": { + "id": "Resource", + "path": "Default/Database/reader/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::RDS::DBInstance", + "aws:cdk:cloudformation:props": { + "dbClusterIdentifier": { + "Ref": "DatabaseB269D8BB" + }, + "dbInstanceClass": "db.t3.medium", + "engine": "aurora-mysql", + "promotionTier": 2 + } + }, + "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" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "Default/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "Default/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "instanceIdentifiersTest": { + "id": "instanceIdentifiersTest", + "path": "instanceIdentifiersTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "instanceIdentifiersTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "instanceIdentifiersTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.69" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "instanceIdentifiersTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "instanceIdentifiersTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "instanceIdentifiersTest/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.2.69" + } + } + }, + "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-instance-id.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.ts new file mode 100644 index 0000000000000..2b631f8558464 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.cluster-instance-id.ts @@ -0,0 +1,30 @@ +import * as cdk from 'aws-cdk-lib/core'; +import * as integ from '@aws-cdk/integ-tests-alpha'; +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as rds from 'aws-cdk-lib/aws-rds'; + +/** + * This test creates a cluster with an instanceIdentifiers attribute that can return writer and reader IDs. + */ + +const app = new cdk.App(); + +const stack = new cdk.Stack(app); + +const vpc = new ec2.Vpc(stack, 'VPC'); + +new rds.DatabaseCluster(stack, 'Database', { + engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_01_0 }), + writer: rds.ClusterInstance.provisioned('Instance', { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL), + }), + readers: [rds.ClusterInstance.provisioned('reader')], + instanceUpdateBehaviour: rds.InstanceUpdateBehaviour.ROLLING, + vpc, +}); + +new integ.IntegTest(app, 'instanceIdentifiersTest', { + testCases: [stack], +}); + +app.synth(); \ No newline at end of file diff --git a/packages/aws-cdk-lib/aws-rds/lib/cluster.ts b/packages/aws-cdk-lib/aws-rds/lib/cluster.ts index e6575d8a0a345..00d86c2630e9c 100644 --- a/packages/aws-cdk-lib/aws-rds/lib/cluster.ts +++ b/packages/aws-cdk-lib/aws-rds/lib/cluster.ts @@ -655,6 +655,8 @@ abstract class DatabaseClusterNew extends DatabaseClusterBase { subnetGroup: this.subnetGroup, promotionTier: 0, // override the promotion tier so that writers are always 0 }); + instanceIdentifiers.push(writer.instanceIdentifier); + (props.readers ?? []).forEach(instance => { const clusterInstance = instance.bind(this, this, { monitoringInterval: props.monitoringInterval, 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 0df1eb0c5a954..45002bdc09c8b 100644 --- a/packages/aws-cdk-lib/aws-rds/test/cluster.test.ts +++ b/packages/aws-cdk-lib/aws-rds/test/cluster.test.ts @@ -476,6 +476,29 @@ describe('cluster new api', () => { }); }); + describe('instanceIdentifiers', () => { + test('should contain writer and reader instance IDs', () => { + //GIVEN + const stack = testStack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + //WHEN + const cluster = new DatabaseCluster(stack, 'Database', { + engine: DatabaseClusterEngine.AURORA, + vpc, + writer: ClusterInstance.serverlessV2('writer'), + readers: [ClusterInstance.serverlessV2('reader')], + iamAuthentication: true, + }); + + //THEN + expect(cluster.instanceIdentifiers).toHaveLength(2); + expect(stack.resolve(cluster.instanceIdentifiers[0])).toEqual({ + Ref: 'Databasewriter2462CC03', + }); + }); + }); + describe('provisioned writer with serverless readers', () => { test('serverless reader in promotion tier 2 throws warning', () => { // GIVEN From 54083de9e8faef8b62a2004941647d9cd4984a0b Mon Sep 17 00:00:00 2001 From: Michael Sambol Date: Tue, 19 Sep 2023 07:18:35 -0500 Subject: [PATCH 4/8] feat(core): add setter for termination protection on stack (#26992) Closes #14463. Closes #21304. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../integ.stack.js.snapshot/Stack.assets.json | 19 ++++ .../Stack.template.json | 36 ++++++ .../core/test/integ.stack.js.snapshot/cdk.out | 1 + .../test/integ.stack.js.snapshot/integ.json | 12 ++ .../integ.stack.js.snapshot/manifest.json | 107 ++++++++++++++++++ ...efaultTestDeployAssert0386B0AD.assets.json | 19 ++++ ...aultTestDeployAssert0386B0AD.template.json | 36 ++++++ .../test/integ.stack.js.snapshot/tree.json | 101 +++++++++++++++++ .../test/core/test/integ.stack.ts | 12 ++ packages/aws-cdk-lib/core/README.md | 7 ++ packages/aws-cdk-lib/core/lib/stack.ts | 12 +- packages/aws-cdk-lib/core/test/stack.test.ts | 26 +++++ 12 files changed, 386 insertions(+), 2 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/Stack.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/Stack.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/stackDefaultTestDeployAssert0386B0AD.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/stackDefaultTestDeployAssert0386B0AD.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/Stack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/Stack.assets.json new file mode 100644 index 0000000000000..2dabbe5b2dd68 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/Stack.assets.json @@ -0,0 +1,19 @@ +{ + "version": "34.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "Stack.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/core/test/integ.stack.js.snapshot/Stack.template.json b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/Stack.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/Stack.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/core/test/integ.stack.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/cdk.out new file mode 100644 index 0000000000000..2313ab5436501 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/integ.json new file mode 100644 index 0000000000000..d5fb120c891d1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "34.0.0", + "testCases": { + "stack/DefaultTest": { + "stacks": [ + "Stack" + ], + "assertionStack": "stack/DefaultTest/DeployAssert", + "assertionStackName": "stackDefaultTestDeployAssert0386B0AD" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/manifest.json new file mode 100644 index 0000000000000..2630c9fb741f7 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/manifest.json @@ -0,0 +1,107 @@ +{ + "version": "34.0.0", + "artifacts": { + "Stack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "Stack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "Stack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "Stack.template.json", + "terminationProtection": true, + "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": [ + "Stack.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": [ + "Stack.assets" + ], + "metadata": { + "/Stack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/Stack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "Stack" + }, + "stackDefaultTestDeployAssert0386B0AD.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "stackDefaultTestDeployAssert0386B0AD.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "stackDefaultTestDeployAssert0386B0AD": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "stackDefaultTestDeployAssert0386B0AD.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": [ + "stackDefaultTestDeployAssert0386B0AD.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": [ + "stackDefaultTestDeployAssert0386B0AD.assets" + ], + "metadata": { + "/stack/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/stack/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "stack/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/core/test/integ.stack.js.snapshot/stackDefaultTestDeployAssert0386B0AD.assets.json b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/stackDefaultTestDeployAssert0386B0AD.assets.json new file mode 100644 index 0000000000000..501878ac128f2 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/stackDefaultTestDeployAssert0386B0AD.assets.json @@ -0,0 +1,19 @@ +{ + "version": "34.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "stackDefaultTestDeployAssert0386B0AD.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/core/test/integ.stack.js.snapshot/stackDefaultTestDeployAssert0386B0AD.template.json b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/stackDefaultTestDeployAssert0386B0AD.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/stackDefaultTestDeployAssert0386B0AD.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/core/test/integ.stack.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/tree.json new file mode 100644 index 0000000000000..7499983ab0eca --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.js.snapshot/tree.json @@ -0,0 +1,101 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "Stack": { + "id": "Stack", + "path": "Stack", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "Stack/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "Stack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "stack": { + "id": "stack", + "path": "stack", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "stack/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "stack/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.70" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "stack/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "stack/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "stack/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.2.70" + } + } + }, + "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/core/test/integ.stack.ts b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.ts new file mode 100644 index 0000000000000..f314579e7fd43 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/core/test/integ.stack.ts @@ -0,0 +1,12 @@ +import * as cdk from 'aws-cdk-lib'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; + +/** + * This test creates a stack and changes termination protection with the setter. + */ + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'Stack', { terminationProtection: false }); +stack.terminationProtection = true; + +new IntegTest(app, 'stack', { testCases: [stack] }); diff --git a/packages/aws-cdk-lib/core/README.md b/packages/aws-cdk-lib/core/README.md index 53afbfaeac38b..4c7e9ecd309d0 100644 --- a/packages/aws-cdk-lib/core/README.md +++ b/packages/aws-cdk-lib/core/README.md @@ -1174,6 +1174,13 @@ const stack = new Stack(app, 'StackName', { }); ``` +You can also set termination protection with the setter after you've instantiated the stack. + +```ts +const stack = new Stack(app, 'StackName', {}); +stack.terminationProtection = true; +``` + By default, termination protection is disabled. ### Description diff --git a/packages/aws-cdk-lib/core/lib/stack.ts b/packages/aws-cdk-lib/core/lib/stack.ts index 54424e8dcafd5..bea3f6814f452 100644 --- a/packages/aws-cdk-lib/core/lib/stack.ts +++ b/packages/aws-cdk-lib/core/lib/stack.ts @@ -314,7 +314,13 @@ export class Stack extends Construct implements ITaggable { /** * Whether termination protection is enabled for this stack. */ - public readonly terminationProtection?: boolean; + public get terminationProtection(): boolean { + return this._terminationProtection; + } + + public set terminationProtection(value: boolean) { + this._terminationProtection = value; + } /** * If this is a nested stack, this represents its `AWS::CloudFormation::Stack` @@ -389,6 +395,8 @@ export class Stack extends Construct implements ITaggable { */ private readonly _suppressTemplateIndentation: boolean; + private _terminationProtection: boolean; + /** * Creates a new stack. * @@ -426,7 +434,7 @@ export class Stack extends Construct implements ITaggable { this.account = account; this.region = region; this.environment = environment; - this.terminationProtection = props.terminationProtection; + this._terminationProtection = props.terminationProtection ?? false; if (props.description !== undefined) { // Max length 1024 bytes diff --git a/packages/aws-cdk-lib/core/test/stack.test.ts b/packages/aws-cdk-lib/core/test/stack.test.ts index 9d503ad65d941..98954be70ee58 100644 --- a/packages/aws-cdk-lib/core/test/stack.test.ts +++ b/packages/aws-cdk-lib/core/test/stack.test.ts @@ -2009,6 +2009,32 @@ describe('stack', () => { expect(artifact.terminationProtection).toEqual(true); }); + test('Set termination protection to true with setter', () => { + // if the root is an app, invoke "synth" to avoid double synthesis + const app = new App(); + const stack = new Stack(app, 'Stack', {}); + + stack.terminationProtection = true; + + const assembly = app.synth(); + const artifact = assembly.getStackArtifact(stack.artifactId); + + expect(artifact.terminationProtection).toEqual(true); + }); + + test('Set termination protection to false with setter', () => { + // if the root is an app, invoke "synth" to avoid double synthesis + const app = new App(); + const stack = new Stack(app, 'Stack', { terminationProtection: true }); + + stack.terminationProtection = false; + + const assembly = app.synth(); + const artifact = assembly.getStackArtifact(stack.artifactId); + + expect(artifact.terminationProtection).toEqual(false); + }); + test('context can be set on a stack using a LegacySynthesizer', () => { // WHEN const stack = new Stack(undefined, undefined, { From 70006abcdbbf2be0a1eb043cc854e6349e92f0e5 Mon Sep 17 00:00:00 2001 From: Michael Sambol Date: Tue, 19 Sep 2023 07:47:40 -0500 Subject: [PATCH 5/8] feat(stepfunctions): add comment ability for when condition (#27010) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently you can comment on a `Choice` state. This adds the ability to comment on a when condition. Screenshot 2023-09-05 at 7 47 35 AM Screenshot 2023-09-05 at 7 54 29 AM Closes #27005. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-stepfunctions-integ.assets.json | 6 +- .../aws-stepfunctions-integ.template.json | 4 +- .../integ.state-machine.js.snapshot/cdk.out | 2 +- .../integ.json | 2 +- .../manifest.json | 4 +- .../integ.state-machine.js.snapshot/tree.json | 90 ++++++++++++------- .../test/integ.state-machine.ts | 20 ++++- .../aws-cdk-lib/aws-stepfunctions/README.md | 14 +++ .../aws-stepfunctions/lib/states/choice.ts | 6 +- .../aws-stepfunctions/lib/states/state.ts | 21 ++++- .../test/state-machine.test.ts | 30 +++++++ 11 files changed, 149 insertions(+), 50 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/aws-stepfunctions-integ.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/aws-stepfunctions-integ.assets.json index 666810943028f..3adf6880c8981 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/aws-stepfunctions-integ.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/aws-stepfunctions-integ.assets.json @@ -1,7 +1,7 @@ { - "version": "32.0.0", + "version": "34.0.0", "files": { - "2b683032648fa932811d781e11acb71f29e8dcde21411e7cf232807cc2565770": { + "6fc80a94a8b95de238e82bf832c22a76af712d24dc10c332baa36571da0a4a41": { "source": { "path": "aws-stepfunctions-integ.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2b683032648fa932811d781e11acb71f29e8dcde21411e7cf232807cc2565770.json", + "objectKey": "6fc80a94a8b95de238e82bf832c22a76af712d24dc10c332baa36571da0a4a41.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/aws-stepfunctions-integ.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/aws-stepfunctions-integ.template.json index 3c632bd05bb54..ae04405b0ce67 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/aws-stepfunctions-integ.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/aws-stepfunctions-integ.template.json @@ -115,13 +115,13 @@ "StateMachine2E01A3A5": { "Type": "AWS::StepFunctions::StateMachine", "Properties": { + "DefinitionString": "{\"StartAt\":\"wait time\",\"States\":{\"wait time\":{\"Type\":\"Wait\",\"SecondsPath\":\"$.waitSeconds\",\"Next\":\"choice\"},\"choice\":{\"Type\":\"Choice\",\"Comment\":\"this is a comment for the choice state\",\"Choices\":[{\"Variable\":\"$.success\",\"IsPresent\":true,\"Next\":\"success\",\"Comment\":\"this is a comment for the when condition\"},{\"Variable\":\"$.noComment\",\"IsPresent\":true,\"Next\":\"short wait time\"}],\"Default\":\"success\"},\"success\":{\"Type\":\"Succeed\"},\"short wait time\":{\"Type\":\"Wait\",\"Seconds\":1,\"Next\":\"success\"}},\"Comment\":\"a super cool state machine\"}", "RoleArn": { "Fn::GetAtt": [ "StateMachineRoleB840431D", "Arn" ] - }, - "DefinitionString": "{\"StartAt\":\"wait time\",\"States\":{\"wait time\":{\"Type\":\"Wait\",\"SecondsPath\":\"$.waitSeconds\",\"End\":true}},\"Comment\":\"a super cool state machine\"}" + } }, "DependsOn": [ "StateMachineRoleB840431D" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/cdk.out index f0b901e7c06e5..2313ab5436501 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"32.0.0"} \ No newline at end of file +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/integ.json index 9fa389156dc96..4f14228e8f81e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "testCases": { "integ.state-machine": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/manifest.json index 43167ec92aa41..053b21f471c6e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "32.0.0", + "version": "34.0.0", "artifacts": { "aws-stepfunctions-integ.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "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}/2b683032648fa932811d781e11acb71f29e8dcde21411e7cf232807cc2565770.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/6fc80a94a8b95de238e82bf832c22a76af712d24dc10c332baa36571da0a4a41.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/tree.json index fa4dffce7b9a1..9622a95aef1ba 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.js.snapshot/tree.json @@ -12,8 +12,32 @@ "id": "wait time", "path": "aws-stepfunctions-integ/wait time", "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.Wait", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" + } + }, + "short wait time": { + "id": "short wait time", + "path": "aws-stepfunctions-integ/short wait time", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.70" + } + }, + "choice": { + "id": "choice", + "path": "aws-stepfunctions-integ/choice", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.70" + } + }, + "success": { + "id": "success", + "path": "aws-stepfunctions-integ/success", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.70" } }, "Role": { @@ -24,8 +48,8 @@ "id": "ImportRole", "path": "aws-stepfunctions-integ/Role/ImportRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } }, "Resource": { @@ -49,8 +73,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } }, "DefaultPolicy": { @@ -139,20 +163,20 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } }, "StateMachine": { @@ -167,8 +191,8 @@ "id": "ImportRole", "path": "aws-stepfunctions-integ/StateMachine/Role/ImportRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } }, "Resource": { @@ -192,14 +216,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } }, "Resource": { @@ -208,46 +232,46 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", "aws:cdk:cloudformation:props": { + "definitionString": "{\"StartAt\":\"wait time\",\"States\":{\"wait time\":{\"Type\":\"Wait\",\"SecondsPath\":\"$.waitSeconds\",\"Next\":\"choice\"},\"choice\":{\"Type\":\"Choice\",\"Comment\":\"this is a comment for the choice state\",\"Choices\":[{\"Variable\":\"$.success\",\"IsPresent\":true,\"Next\":\"success\",\"Comment\":\"this is a comment for the when condition\"},{\"Variable\":\"$.noComment\",\"IsPresent\":true,\"Next\":\"short wait time\"}],\"Default\":\"success\"},\"success\":{\"Type\":\"Succeed\"},\"short wait time\":{\"Type\":\"Wait\",\"Seconds\":1,\"Next\":\"success\"}},\"Comment\":\"a super cool state machine\"}", "roleArn": { "Fn::GetAtt": [ "StateMachineRoleB840431D", "Arn" ] - }, - "definitionString": "{\"StartAt\":\"wait time\",\"States\":{\"wait time\":{\"Type\":\"Wait\",\"SecondsPath\":\"$.waitSeconds\",\"End\":true}},\"Comment\":\"a super cool state machine\"}" + } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "aws-stepfunctions-integ/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", "path": "aws-stepfunctions-integ/CheckBootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } }, "Tree": { @@ -255,13 +279,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.26" + "version": "10.2.70" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.2.70" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.ts index 28de085110615..5ff6711106589 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine.ts @@ -14,12 +14,30 @@ const wait = new sfn.Wait(stack, 'wait time', { time: sfn.WaitTime.secondsPath('$.waitSeconds'), }); +const shortWait = new sfn.Wait(stack, 'short wait time', { + time: sfn.WaitTime.duration(cdk.Duration.seconds(1)), +}); + +const choice = new sfn.Choice(stack, 'choice', { + comment: 'this is a comment for the choice state', +}); + +const success = new sfn.Succeed(stack, 'success'); + +choice.when(sfn.Condition.isPresent('$.success'), success, { + comment: 'this is a comment for the when condition', +}); +choice.when(sfn.Condition.isPresent('$.noComment'), shortWait); +choice.otherwise(success); +wait.next(choice); +shortWait.next(success); + const role = new iam.Role(stack, 'Role', { assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'), }); const stateMachine = new sfn.StateMachine(stack, 'StateMachine', { - definition: wait, + definitionBody: sfn.DefinitionBody.fromChainable(wait), comment: 'a super cool state machine', }); diff --git a/packages/aws-cdk-lib/aws-stepfunctions/README.md b/packages/aws-cdk-lib/aws-stepfunctions/README.md index a456da9dab068..55ae6ec9a8781 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions/README.md +++ b/packages/aws-cdk-lib/aws-stepfunctions/README.md @@ -353,6 +353,20 @@ const shipTheItem = new sfn.Pass(this, 'ShipTheItem'); choice.afterwards().next(shipTheItem); ``` +You can add comments to `Choice` states as well as conditions that use `choice.when`. + +```ts +const choice = new sfn.Choice(this, 'What color is it?', { + comment: 'color comment', +}); +const handleBlueItem = new sfn.Pass(this, 'HandleBlueItem'); +const handleOtherItemColor = new sfn.Pass(this, 'HanldeOtherItemColor'); +choice.when(sfn.Condition.stringEquals('$.color', 'BLUE'), handleBlueItem, { + comment: 'blue item comment', +}); +choice.otherwise(handleOtherItemColor); +``` + If your `Choice` doesn't have an `otherwise()` and none of the conditions match the JSON state, a `NoChoiceMatched` error will be thrown. Wrap the state machine in a `Parallel` state if you want to catch and recover from this. diff --git a/packages/aws-cdk-lib/aws-stepfunctions/lib/states/choice.ts b/packages/aws-cdk-lib/aws-stepfunctions/lib/states/choice.ts index b27f046c4c1d2..55db170551b34 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions/lib/states/choice.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions/lib/states/choice.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { StateType } from './private/state-type'; -import { State } from './state'; +import { ChoiceTransitionOptions, State } from './state'; import { Chain } from '../chain'; import { Condition } from '../condition'; import { IChainable, INextable } from '../types'; @@ -53,8 +53,8 @@ export class Choice extends State { /** * If the given condition matches, continue execution with the given state */ - public when(condition: Condition, next: IChainable): Choice { - super.addChoice(condition, next.startState); + public when(condition: Condition, next: IChainable, options?: ChoiceTransitionOptions): Choice { + super.addChoice(condition, next.startState, options); return this; } diff --git a/packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts b/packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts index c027d9937a313..64e7952260e46 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts @@ -318,8 +318,8 @@ export abstract class State extends Construct implements IChainable { /** * Add a choice branch to this state */ - protected addChoice(condition: Condition, next: State) { - this.choices.push({ condition, next }); + protected addChoice(condition: Condition, next: State, options?: ChoiceTransitionOptions) { + this.choices.push({ condition, next, ...options }); next.startState.addIncoming(this); if (this.containingGraph) { next.startState.bindToGraph(this.containingGraph); @@ -327,7 +327,7 @@ export abstract class State extends Construct implements IChainable { } /** - * Add a paralle branch to this state + * Add a parallel branch to this state */ protected addBranch(branch: StateGraph) { this.branches.push(branch); @@ -479,7 +479,7 @@ export interface FindStateOptions { /** * A Choice Transition */ -interface ChoiceTransition { +interface ChoiceTransition extends ChoiceTransitionOptions { /** * State to transition to */ @@ -491,6 +491,18 @@ interface ChoiceTransition { condition: Condition; } +/** + * Options for Choice Transition + */ +export interface ChoiceTransitionOptions { + /** + * An optional description for the choice transition + * + * @default No comment + */ + readonly comment?: string; +} + /** * Render a choice transition */ @@ -498,6 +510,7 @@ function renderChoice(c: ChoiceTransition) { return { ...c.condition.renderCondition(), Next: c.next.stateId, + Comment: c.comment, }; } diff --git a/packages/aws-cdk-lib/aws-stepfunctions/test/state-machine.test.ts b/packages/aws-cdk-lib/aws-stepfunctions/test/state-machine.test.ts index 9a34e1feee46c..df71c7d4fa392 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions/test/state-machine.test.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions/test/state-machine.test.ts @@ -622,4 +622,34 @@ describe('State Machine', () => { StateMachineRevisionId: { 'Fn::GetAtt': ['MyStateMachine6C968CA5', 'StateMachineRevisionId'] }, }); }); + + test('comments rendered properly', () => { + // GIVEN + const stack = new cdk.Stack(); + + const choice = new sfn.Choice(stack, 'choice', { + comment: 'nebraska', + }); + const success = new sfn.Succeed(stack, 'success'); + choice.when(sfn.Condition.isPresent('$.success'), success, { + comment: 'london', + }); + choice.otherwise(success); + + // WHEN + const stateMachine = new sfn.StateMachine(stack, 'MyStateMachine', { + stateMachineName: 'MyStateMachine', + definitionBody: sfn.DefinitionBody.fromChainable(choice), + }); + + new sfn.CfnStateMachineVersion(stack, 'MyStateMachineVersion', { + stateMachineRevisionId: stateMachine.stateMachineRevisionId, + stateMachineArn: stateMachine.stateMachineArn, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::StepFunctions::StateMachine', { + DefinitionString: '{"StartAt":"choice","States":{"choice":{"Type":"Choice","Comment":"nebraska","Choices":[{"Variable":"$.success","IsPresent":true,"Next":"success","Comment":"london"}],"Default":"success"},"success":{"Type":"Succeed"}}}', + }); + }); }); From e1d41877b3e98544a9a4bb18616b0638b83e9be3 Mon Sep 17 00:00:00 2001 From: zeyad001 Date: Tue, 19 Sep 2023 15:18:08 +0200 Subject: [PATCH 6/8] chore(region-info): Add AppConfig Lambda Layer ARNs (#27176) This PR adds the AWS AppConfig Lambda Layer ARNs (found [here in the AWS Docs](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions-versions.html)) to the region information. [Previous pull request](https://github.com/aws/aws-cdk/pull/26873) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../region-info/build-tools/fact-tables.ts | 266 +++++++++ .../build-tools/generate-static-data.ts | 8 + packages/aws-cdk-lib/region-info/lib/fact.ts | 10 + .../region-info/lib/region-info.ts | 9 + .../__snapshots__/region-info.test.ts.snap | 525 ++++++++++++++++++ .../region-info/test/region-info.test.ts | 16 +- 6 files changed, 832 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts b/packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts index 1c058c663c02b..6fe55f7893fcf 100644 --- a/packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts +++ b/packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts @@ -215,6 +215,272 @@ export const APPMESH_ECR_ACCOUNTS: { [region: string]: string } = { 'us-west-2': '840364872350', }; +// https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions-versions.html +export const APPCONFIG_LAMBDA_LAYER_ARNS: { [key: string]: any } = { + '2.0.181': { + arm64: { + 'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension-Arm64:1', + 'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension-Arm64:1', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:37', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension-Arm64:1', + 'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension-Arm64:1', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:36', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:43', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:36', + 'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension-Arm64:1', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension-Arm64:1', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:36', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension-Arm64:1', + 'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension-Arm64:1', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:48', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:33', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension-Arm64:1', + 'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension-Arm64:1', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension-Arm64:1', + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:46', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:33', + 'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension-Arm64:1', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:48', + }, + x86_64: { + 'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:73', + 'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:73', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:84', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:93', + 'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:86', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:94', + 'ap-south-2': 'arn:aws:lambda:ap-south-2:489524808438:layer:AWS-AppConfig-Extension:32', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:91', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:93', + 'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:64', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:81', + 'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:68', + 'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:68', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:93', + 'eu-central-2': 'arn:aws:lambda:eu-central-2:758369105281:layer:AWS-AppConfig-Extension:32', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:142', + 'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:73', + 'eu-south-2': 'arn:aws:lambda:eu-south-2:586093569114:layer:AWS-AppConfig-Extension:29', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:110', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:81', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:82', + 'me-central-1': 'arn:aws:lambda:me-central-1:662846165436:layer:AWS-AppConfig-Extension:34', + 'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:73', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:113', + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:113', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:81', + 'us-gov-east-1': 'arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:46', + 'us-gov-west-1': 'arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:46', + 'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:124', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:146', + }, + }, + '2.0.165': { + arm64: { + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:43', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:31', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:45', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:34', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:46', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:31', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:35', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:41', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:34', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:34', + }, + x86_64: { + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:110', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:79', + 'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:121', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:143', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:79', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:91', + 'eu-central-2': 'arn:aws:lambda:eu-central-2:758369105281:layer:AWS-AppConfig-Extension:29', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:108', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:79', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:80', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:139', + 'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:71', + 'eu-south-2': 'arn:aws:lambda:eu-south-2:586093569114:layer:AWS-AppConfig-Extension:26', + 'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:66', + 'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:66', + 'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:71', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:82', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:91', + 'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:84', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:89', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:91', + 'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:60', + 'ap-southeast-4': 'arn:aws:lambda:ap-southeast-4:307021474294:layer:AWS-AppConfig-Extension:2', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:92', + 'ap-south-2': 'arn:aws:lambda:ap-south-2:489524808438:layer:AWS-AppConfig-Extension:29', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:110', + 'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:71', + 'me-central-1': 'arn:aws:lambda:me-central-1:662846165436:layer:AWS-AppConfig-Extension:31', + 'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:71', + 'us-gov-east-1': 'arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:44', + 'us-gov-west-1': 'arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:44', + }, + }, + '2.0.122': { + arm64: { + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:15', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:11', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:16', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:13', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:20', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:11', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:15', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:16', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:13', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:13', + }, + x86_64: { + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:82', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:59', + 'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:93', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:114', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:59', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:70', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:82', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:59', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:60', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:111', + 'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:54', + 'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:52', + 'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:52', + 'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:54', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:62', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:70', + 'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:59', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:64', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:70', + 'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:37', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:71', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:82', + 'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:54', + 'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:54', + 'us-gov-east-1': 'arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:29', + 'us-gov-west-1': 'arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:29', + }, + }, + '2.0.58': { + arm64: { + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:2', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:2', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:3', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:2', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:7', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:2', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:2', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:3', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:2', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:2', + }, + x86_64: { + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:69', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:50', + 'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:78', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:101', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:50', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:59', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:69', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:50', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:51', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:98', + 'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:47', + 'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:46', + 'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:46', + 'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:47', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:49', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:59', + 'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:46', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:51', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:59', + 'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:24', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:60', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:69', + 'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:47', + 'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:47', + 'us-gov-east-1': 'arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:23', + 'us-gov-west-1': 'arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:23', + }, + }, + '2.0.45': { + arm64: { + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:1', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:1', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:2', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:1', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:6', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:1', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:1', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:2', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:1', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:1', + }, + x86_64: { + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:68', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:49', + 'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:77', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:100', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:49', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:58', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:68', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:49', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:50', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:97', + 'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:46', + 'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:45', + 'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:45', + 'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:46', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:48', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:58', + 'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:45', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:50', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:58', + 'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:23', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:59', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:68', + 'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:46', + 'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:46', + 'us-gov-east-1': 'arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:22', + 'us-gov-west-1': 'arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:22', + }, + }, + '2.0.30': { + x86_64: { + 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:61', + 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:47', + 'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:61', + 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:89', + 'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:47', + 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:54', + 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:59', + 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:47', + 'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:48', + 'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:86', + 'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:44', + 'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:43', + 'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:43', + 'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:44', + 'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:45', + 'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:42', + 'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:54', + 'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:45', + 'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:54', + 'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:13', + 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:55', + 'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:61', + 'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:44', + 'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:44', + 'us-gov-east-1': 'arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:20', + 'us-gov-west-1': 'arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:20', + }, + }, + +}; + // https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html export const CLOUDWATCH_LAMBDA_INSIGHTS_ARNS: { [key: string]: any } = { '1.0.229.0': { diff --git a/packages/aws-cdk-lib/region-info/build-tools/generate-static-data.ts b/packages/aws-cdk-lib/region-info/build-tools/generate-static-data.ts index badafeb57b204..6a08d28699b9d 100644 --- a/packages/aws-cdk-lib/region-info/build-tools/generate-static-data.ts +++ b/packages/aws-cdk-lib/region-info/build-tools/generate-static-data.ts @@ -12,6 +12,7 @@ import { EBS_ENV_ENDPOINT_HOSTED_ZONE_IDS, ADOT_LAMBDA_LAYER_ARNS, PARAMS_AND_SECRETS_LAMBDA_LAYER_ARNS, + APPCONFIG_LAMBDA_LAYER_ARNS, } from './fact-tables'; import { AWS_REGIONS, @@ -29,6 +30,7 @@ export async function main(): Promise { checkRegions(FIREHOSE_CIDR_BLOCKS); checkRegions(ROUTE_53_BUCKET_WEBSITE_ZONE_IDS); checkRegionsSubMap(CLOUDWATCH_LAMBDA_INSIGHTS_ARNS); + checkRegionsSubMap(APPCONFIG_LAMBDA_LAYER_ARNS); const lines = [ "import { Fact, FactName } from './fact';", @@ -101,6 +103,12 @@ export async function main(): Promise { } } + for (const version in APPCONFIG_LAMBDA_LAYER_ARNS) { + for (const arch in APPCONFIG_LAMBDA_LAYER_ARNS[version]) { + registerFact(region, ['appConfigLambdaLayerVersion', version, arch], APPCONFIG_LAMBDA_LAYER_ARNS[version][arch][region]); + } + } + for (const type in ADOT_LAMBDA_LAYER_ARNS) { for (const version in ADOT_LAMBDA_LAYER_ARNS[type]) { for (const arch in ADOT_LAMBDA_LAYER_ARNS[type][version]) { diff --git a/packages/aws-cdk-lib/region-info/lib/fact.ts b/packages/aws-cdk-lib/region-info/lib/fact.ts index 728d66d345475..366141721c693 100644 --- a/packages/aws-cdk-lib/region-info/lib/fact.ts +++ b/packages/aws-cdk-lib/region-info/lib/fact.ts @@ -181,6 +181,16 @@ export class FactName { return `cloudwatch-lambda-insights-version:${suffix}`; } + /** + * The ARN of AppConfig Lambda Layer for a given version (e.g. 2.0.181) + * @param version The layer version. + * @param arch The architecture (optional), defaults to x86_64. + */ + public static appConfigLambdaLayerVersion(version: string, arch?: string) { + const suffix = version.split('.').join('_') + `_${arch ?? 'x86_64'}`; + return `appconfig-lambda-layer:${suffix}`; + } + /** * The name of the regional service principal for a given service. * diff --git a/packages/aws-cdk-lib/region-info/lib/region-info.ts b/packages/aws-cdk-lib/region-info/lib/region-info.ts index 9d974d69a15c5..28535c1242095 100644 --- a/packages/aws-cdk-lib/region-info/lib/region-info.ts +++ b/packages/aws-cdk-lib/region-info/lib/region-info.ts @@ -153,6 +153,15 @@ export class RegionInfo { return Fact.find(this.name, FactName.cloudwatchLambdaInsightsVersion(insightsVersion, architecture)); } + /** + * The ARN of the AppConfig Lambda Layer, for the given version. + * @param layerVersion The layer version (e.g. 2.0.181) + * @param architecture The Lambda Function architecture (e.g. 'x86_64' or 'arm64'), defaults to x86_64 + */ + public appConfigLambdaArn(layerVersion: string, architecture?: string) : string | undefined { + return Fact.find(this.name, FactName.appConfigLambdaLayerVersion(layerVersion, architecture)); + } + /** * The ID of the AWS account that owns the public ECR repository that contains the * AWS App Mesh Envoy Proxy images in a given region. diff --git a/packages/aws-cdk-lib/region-info/test/__snapshots__/region-info.test.ts.snap b/packages/aws-cdk-lib/region-info/test/__snapshots__/region-info.test.ts.snap index 667e6ce300336..9a78f924f76b7 100644 --- a/packages/aws-cdk-lib/region-info/test/__snapshots__/region-info.test.ts.snap +++ b/packages/aws-cdk-lib/region-info/test/__snapshots__/region-info.test.ts.snap @@ -3,6 +3,21 @@ exports[`built-in data is correct 1`] = ` { "af-south-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:54", + "2.0.165": "arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:71", + "2.0.181": "arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:73", + "2.0.30": "arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:44", + "2.0.45": "arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:46", + "2.0.58": "arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:47", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -40,6 +55,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-east-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:54", + "2.0.165": "arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:71", + "2.0.181": "arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:73", + "2.0.30": "arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:44", + "2.0.45": "arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:46", + "2.0.58": "arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:47", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -77,6 +107,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-northeast-1": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:15", + "2.0.165": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:35", + "2.0.181": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:37", + "2.0.45": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.58": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:2", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:62", + "2.0.165": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:82", + "2.0.181": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:84", + "2.0.30": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:45", + "2.0.45": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:48", + "2.0.58": "arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:49", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -114,6 +159,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-northeast-2": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:70", + "2.0.165": "arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:91", + "2.0.181": "arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:93", + "2.0.30": "arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:54", + "2.0.45": "arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:58", + "2.0.58": "arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:59", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -151,6 +211,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-northeast-3": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:59", + "2.0.165": "arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:84", + "2.0.181": "arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:86", + "2.0.30": "arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:42", + "2.0.45": "arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:45", + "2.0.58": "arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:46", + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -188,6 +263,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-south-1": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:13", + "2.0.165": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:34", + "2.0.181": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:36", + "2.0.45": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.58": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:2", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:71", + "2.0.165": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:92", + "2.0.181": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:94", + "2.0.30": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:55", + "2.0.45": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:59", + "2.0.58": "arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:60", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -225,6 +315,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-south-2": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": undefined, + "2.0.165": "arn:aws:lambda:ap-south-2:489524808438:layer:AWS-AppConfig-Extension:29", + "2.0.181": "arn:aws:lambda:ap-south-2:489524808438:layer:AWS-AppConfig-Extension:32", + "2.0.30": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -262,6 +367,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-southeast-1": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:16", + "2.0.165": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:41", + "2.0.181": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:43", + "2.0.45": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:2", + "2.0.58": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:3", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:64", + "2.0.165": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:89", + "2.0.181": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:91", + "2.0.30": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:45", + "2.0.45": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:50", + "2.0.58": "arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:51", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -299,6 +419,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-southeast-2": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:13", + "2.0.165": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:34", + "2.0.181": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:36", + "2.0.45": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.58": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:2", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:70", + "2.0.165": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:91", + "2.0.181": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:93", + "2.0.30": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:54", + "2.0.45": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:58", + "2.0.58": "arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:59", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -336,6 +471,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-southeast-3": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:37", + "2.0.165": "arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:60", + "2.0.181": "arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:64", + "2.0.30": "arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:13", + "2.0.45": "arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:23", + "2.0.58": "arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:24", + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -373,6 +523,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ap-southeast-4": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": undefined, + "2.0.165": "arn:aws:lambda:ap-southeast-4:307021474294:layer:AWS-AppConfig-Extension:2", + "2.0.181": undefined, + "2.0.30": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -410,6 +575,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "ca-central-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:59", + "2.0.165": "arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:79", + "2.0.181": "arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:81", + "2.0.30": "arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:47", + "2.0.45": "arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:49", + "2.0.58": "arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:50", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -447,6 +627,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "cn-north-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:52", + "2.0.165": "arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:66", + "2.0.181": "arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:68", + "2.0.30": "arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:43", + "2.0.45": "arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:45", + "2.0.58": "arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:46", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com.cn", "lambdaInsightsArmVersions": { @@ -484,6 +679,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "cn.com.amazonaws.vpce", }, "cn-northwest-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:52", + "2.0.165": "arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:66", + "2.0.181": "arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:68", + "2.0.30": "arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:43", + "2.0.45": "arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:45", + "2.0.58": "arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:46", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com.cn", "lambdaInsightsArmVersions": { @@ -521,6 +731,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "cn.com.amazonaws.vpce", }, "eu-central-1": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:13", + "2.0.165": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:34", + "2.0.181": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:36", + "2.0.45": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.58": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:2", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:70", + "2.0.165": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:91", + "2.0.181": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:93", + "2.0.30": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:54", + "2.0.45": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:58", + "2.0.58": "arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:59", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -558,6 +783,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "eu-central-2": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": undefined, + "2.0.165": "arn:aws:lambda:eu-central-2:758369105281:layer:AWS-AppConfig-Extension:29", + "2.0.181": "arn:aws:lambda:eu-central-2:758369105281:layer:AWS-AppConfig-Extension:32", + "2.0.30": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -595,6 +835,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "eu-north-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:111", + "2.0.165": "arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:139", + "2.0.181": "arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:142", + "2.0.30": "arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:86", + "2.0.45": "arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:97", + "2.0.58": "arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:98", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -632,6 +887,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "eu-south-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:54", + "2.0.165": "arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:71", + "2.0.181": "arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:73", + "2.0.30": "arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:44", + "2.0.45": "arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:46", + "2.0.58": "arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:47", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -669,6 +939,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "eu-south-2": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": undefined, + "2.0.165": "arn:aws:lambda:eu-south-2:586093569114:layer:AWS-AppConfig-Extension:26", + "2.0.181": "arn:aws:lambda:eu-south-2:586093569114:layer:AWS-AppConfig-Extension:29", + "2.0.30": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -706,6 +991,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "eu-west-1": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:20", + "2.0.165": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:46", + "2.0.181": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:48", + "2.0.45": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:6", + "2.0.58": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:7", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:82", + "2.0.165": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:108", + "2.0.181": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:110", + "2.0.30": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:59", + "2.0.45": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:68", + "2.0.58": "arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:69", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -743,6 +1043,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "eu-west-2": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:11", + "2.0.165": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:31", + "2.0.181": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:33", + "2.0.45": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.58": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:2", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:59", + "2.0.165": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:79", + "2.0.181": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:81", + "2.0.30": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:47", + "2.0.45": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:49", + "2.0.58": "arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:50", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -780,6 +1095,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "eu-west-3": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:60", + "2.0.165": "arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:80", + "2.0.181": "arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:82", + "2.0.30": "arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:48", + "2.0.45": "arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:50", + "2.0.58": "arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:51", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -817,6 +1147,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "il-central-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.30": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -854,6 +1199,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "me-central-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": undefined, + "2.0.165": "arn:aws:lambda:me-central-1:662846165436:layer:AWS-AppConfig-Extension:31", + "2.0.181": "arn:aws:lambda:me-central-1:662846165436:layer:AWS-AppConfig-Extension:34", + "2.0.30": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -891,6 +1251,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "me-south-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:54", + "2.0.165": "arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:71", + "2.0.181": "arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:73", + "2.0.30": "arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:44", + "2.0.45": "arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:46", + "2.0.58": "arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:47", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -928,6 +1303,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "sa-east-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:82", + "2.0.165": "arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:110", + "2.0.181": "arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:113", + "2.0.30": "arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:61", + "2.0.45": "arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:68", + "2.0.58": "arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:69", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -965,6 +1355,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "us-east-1": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:15", + "2.0.165": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:43", + "2.0.181": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:46", + "2.0.45": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.58": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:2", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:82", + "2.0.165": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:110", + "2.0.181": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:113", + "2.0.30": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:61", + "2.0.45": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:68", + "2.0.58": "arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:69", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -1002,6 +1407,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "us-east-2": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:11", + "2.0.165": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:31", + "2.0.181": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:33", + "2.0.45": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.58": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:2", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:59", + "2.0.165": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:79", + "2.0.181": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:81", + "2.0.30": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:47", + "2.0.45": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:49", + "2.0.58": "arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:50", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -1039,6 +1459,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "us-gov-east-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:29", + "2.0.165": "arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:44", + "2.0.181": "arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:46", + "2.0.30": "arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:20", + "2.0.45": "arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:22", + "2.0.58": "arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:23", + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -1076,6 +1511,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "us-gov-west-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:29", + "2.0.165": "arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:44", + "2.0.181": "arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:46", + "2.0.30": "arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:20", + "2.0.45": "arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:22", + "2.0.58": "arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:23", + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -1113,6 +1563,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "us-iso-east-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.30": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "c2s.ic.gov", "lambdaInsightsArmVersions": { @@ -1150,6 +1615,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "gov.ic.c2s.vpce", }, "us-iso-west-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.30": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "c2s.ic.gov", "lambdaInsightsArmVersions": { @@ -1187,6 +1667,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "gov.ic.c2s.vpce", }, "us-isob-east-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": undefined, + "2.0.30": undefined, + "2.0.45": undefined, + "2.0.58": undefined, + }, "cdkMetadataResourceAvailable": false, "domainSuffix": "sc2s.sgov.gov", "lambdaInsightsArmVersions": { @@ -1224,6 +1719,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "gov.sgov.sc2s.vpce", }, "us-west-1": { + "appConfigLayerArmVersions": { + "2.0.122": undefined, + "2.0.165": undefined, + "2.0.181": "arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension-Arm64:1", + "2.0.45": undefined, + "2.0.58": undefined, + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:93", + "2.0.165": "arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:121", + "2.0.181": "arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:124", + "2.0.30": "arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:61", + "2.0.45": "arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:77", + "2.0.58": "arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:78", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { @@ -1261,6 +1771,21 @@ exports[`built-in data is correct 1`] = ` "vpcEndPointServiceNamePrefix": "com.amazonaws.vpce", }, "us-west-2": { + "appConfigLayerArmVersions": { + "2.0.122": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:16", + "2.0.165": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:45", + "2.0.181": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:48", + "2.0.45": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:2", + "2.0.58": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:3", + }, + "appConfigLayerVersions": { + "2.0.122": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:114", + "2.0.165": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:143", + "2.0.181": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:146", + "2.0.30": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:89", + "2.0.45": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:100", + "2.0.58": "arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:101", + }, "cdkMetadataResourceAvailable": true, "domainSuffix": "amazonaws.com", "lambdaInsightsArmVersions": { diff --git a/packages/aws-cdk-lib/region-info/test/region-info.test.ts b/packages/aws-cdk-lib/region-info/test/region-info.test.ts index b242325bbda7a..f014405a8b145 100644 --- a/packages/aws-cdk-lib/region-info/test/region-info.test.ts +++ b/packages/aws-cdk-lib/region-info/test/region-info.test.ts @@ -1,4 +1,4 @@ -import { CLOUDWATCH_LAMBDA_INSIGHTS_ARNS } from '../build-tools/fact-tables'; +import { APPCONFIG_LAMBDA_LAYER_ARNS, CLOUDWATCH_LAMBDA_INSIGHTS_ARNS } from '../build-tools/fact-tables'; import { FactName, RegionInfo } from '../lib'; import { AWS_REGIONS, AWS_SERVICES } from '../lib/aws-entities'; @@ -10,6 +10,8 @@ test('built-in data is correct', () => { const servicePrincipals: { [service: string]: string | undefined } = {}; const lambdaInsightsVersions: { [service: string]: string | undefined } = {}; const lambdaInsightsArmVersions: { [service: string]: string | undefined } = {}; + const appConfigLayerVersions: { [service: string]: string | undefined } = {}; + const appConfigLayerArmVersions: { [service: string]: string | undefined } = {}; AWS_SERVICES.forEach(service => servicePrincipals[service] = region.servicePrincipal(service)); @@ -19,7 +21,15 @@ test('built-in data is correct', () => { if ('arm64' in CLOUDWATCH_LAMBDA_INSIGHTS_ARNS[version]) { lambdaInsightsArmVersions[version] = region.cloudwatchLambdaInsightsArn(version, 'arm64'); } - }; + } + + for (const version in APPCONFIG_LAMBDA_LAYER_ARNS) { + appConfigLayerVersions[version] = region.appConfigLambdaArn(version); + + if ('arm64' in APPCONFIG_LAMBDA_LAYER_ARNS[version]) { + appConfigLayerArmVersions[version] = region.appConfigLambdaArn(version, 'arm64'); + } + } snapshot[name] = { cdkMetadataResourceAvailable: region.cdkMetadataResourceAvailable, @@ -30,6 +40,8 @@ test('built-in data is correct', () => { servicePrincipals, lambdaInsightsVersions, lambdaInsightsArmVersions, + appConfigLayerVersions, + appConfigLayerArmVersions, }; } expect(snapshot).toMatchSnapshot(); From b7eeda67b99ecdb9aaeae143ce767f7a4e6b9d29 Mon Sep 17 00:00:00 2001 From: Sinan Shaban Date: Tue, 19 Sep 2023 17:13:06 +0300 Subject: [PATCH 7/8] fix(cli): equals sign in a tag value is dropped (#27130) When overriding tags from the CLI the tag key-value string is split by an equal sign and the left and right parts are used for key and value respectively. The documentation for the [String.prototype.split()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) states that the second parameter sets a limit of the returned values after execution: > If provided, splits the string at each occurrence of the specified separator, but stops when limit entries have been placed in the array. Any leftover text is not included in the array at all. So basically if we have `foo=bar=test` and we apply a split with a limit of 2 (`"foo=bar=test".split("=", 2)`) we will get the following array `["foo", "bar"]` instead of the expected one`["foo", "bar=test"]`. There has been the same problem with the context values and since it is the same problem the solution is also the same: #5773 With this fix the `context` and `tags` get the same behaviour when parsing the passed values. Closes #21003 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk/lib/settings.ts | 2 +- packages/aws-cdk/test/settings.test.ts | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/settings.ts b/packages/aws-cdk/lib/settings.ts index e24ca92468162..f8a4b0b789dd4 100644 --- a/packages/aws-cdk/lib/settings.ts +++ b/packages/aws-cdk/lib/settings.ts @@ -336,7 +336,7 @@ export class Settings { const tags: Tag[] = []; for (const assignment of nonEmptyTags) { - const parts = assignment.split('=', 2); + const parts = assignment.split(/=(.*)/, 2); if (parts.length === 2) { debug('CLI argument tags: %s=%s', parts[0], parts[1]); tags.push({ diff --git a/packages/aws-cdk/test/settings.test.ts b/packages/aws-cdk/test/settings.test.ts index 0738febc435c0..fde5c1c74665c 100644 --- a/packages/aws-cdk/test/settings.test.ts +++ b/packages/aws-cdk/test/settings.test.ts @@ -1,5 +1,6 @@ /* eslint-disable import/order */ import { Command, Context, Settings } from '../lib/settings'; +import { Tag } from '../lib/cdk-toolkit'; test('can delete values from Context object', () => { // GIVEN @@ -81,6 +82,26 @@ test('can parse string context from command line arguments with equals sign in v expect(settings2.get(['context']).foo).toEqual( 'bar='); }); +test('can parse tag values from command line arguments', () => { + // GIVEN + const settings1 = Settings.fromCommandLineArguments({ tags: ['foo=bar'], _: [Command.DEPLOY] }); + const settings2 = Settings.fromCommandLineArguments({ tags: ['foo='], _: [Command.DEPLOY] }); + + // THEN + expect(settings1.get(['tags']).find((tag: Tag) => tag.Key === 'foo').Value).toEqual('bar'); + expect(settings2.get(['tags']).find((tag: Tag) => tag.Key === 'foo').Value).toEqual(''); +}); + +test('can parse tag values from command line arguments with equals sign in value', () => { + // GIVEN + const settings1 = Settings.fromCommandLineArguments({ tags: ['foo==bar='], _: [Command.DEPLOY] }); + const settings2 = Settings.fromCommandLineArguments({ tags: ['foo=bar='], _: [Command.DEPLOY] }); + + // THEN + expect(settings1.get(['tags']).find((tag: Tag) => tag.Key === 'foo').Value).toEqual('=bar='); + expect(settings2.get(['tags']).find((tag: Tag) => tag.Key === 'foo').Value).toEqual('bar='); +}); + test('bundling stacks defaults to an empty list', () => { // GIVEN const settings = Settings.fromCommandLineArguments({ From e15d0c057ac9ee5d0a8cbca72f1256bac2f8282a Mon Sep 17 00:00:00 2001 From: Parker Scanlon <69879391+scanlonp@users.noreply.github.com> Date: Tue, 19 Sep 2023 07:38:39 -0700 Subject: [PATCH 8/8] feat(ecr): make `validateRepositoryName` errors human readable (#27186) When a user specifies an invalid repository name, the error message will now describe why the name is invalid instead of providing the regex used to validate the name. The message comes from the console when defining a new repository. The docstring of `repositoryName` now reflects this and mirrors the docstring of the underlying CFN resource. Closes #26715. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-ecr/lib/repository.ts | 8 ++++++-- packages/aws-cdk-lib/aws-ecr/test/repository.test.ts | 10 +++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ecr/lib/repository.ts b/packages/aws-cdk-lib/aws-ecr/lib/repository.ts index 39bdb24eca355..ef4fa18d809c9 100644 --- a/packages/aws-cdk-lib/aws-ecr/lib/repository.ts +++ b/packages/aws-cdk-lib/aws-ecr/lib/repository.ts @@ -493,7 +493,11 @@ export interface OnImageScanCompletedOptions extends events.OnEventOptions { export interface RepositoryProps { /** - * Name for this repository + * Name for this repository. + * + * The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes. + * + * > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. * * @default Automatically generated name. */ @@ -672,7 +676,7 @@ export class Repository extends RepositoryBase { } const isPatternMatch = /^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$/.test(repositoryName); if (!isPatternMatch) { - errors.push('Repository name must follow the specified pattern: (?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*'); + errors.push('Repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, periods and forward slashes'); } if (errors.length > 0) { diff --git a/packages/aws-cdk-lib/aws-ecr/test/repository.test.ts b/packages/aws-cdk-lib/aws-ecr/test/repository.test.ts index 32c79d8d16978..002c347688457 100644 --- a/packages/aws-cdk-lib/aws-ecr/test/repository.test.ts +++ b/packages/aws-cdk-lib/aws-ecr/test/repository.test.ts @@ -898,7 +898,7 @@ describe('repository', () => { const expectedErrors = [ `Invalid ECR repository name (value: ${repositoryName})`, 'Repository name must be at least 2 and no more than 256 characters', - 'Repository name must follow the specified pattern: (?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*', + 'Repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, periods and forward slashes', ].join(EOL); expect(() => new ecr.Repository(stack, 'Repo', { @@ -923,19 +923,19 @@ describe('repository', () => { expect(() => new ecr.Repository(stack, 'Repo1', { repositoryName: 'aAa', - })).toThrow(/must follow the specified pattern/); + })).toThrow('Repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, periods and forward slashes'); expect(() => new ecr.Repository(stack, 'Repo2', { repositoryName: 'a--a', - })).toThrow(/must follow the specified pattern/); + })).toThrow('Repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, periods and forward slashes'); expect(() => new ecr.Repository(stack, 'Repo3', { repositoryName: 'a./a-a', - })).toThrow(/must follow the specified pattern/); + })).toThrow('Repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, periods and forward slashes'); expect(() => new ecr.Repository(stack, 'Repo4', { repositoryName: 'a//a-a', - })).toThrow(/must follow the specified pattern/); + })).toThrow('Repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, periods and forward slashes'); }); test('return value addToResourcePolicy', () => {