From a0525f54771b24859140c8915ccb86b1be644e1b Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Mon, 23 Dec 2024 06:16:15 -0800 Subject: [PATCH 01/13] feat: update L1 CloudFormation resource definitions (#32645) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates the L1 CloudFormation resource definitions with the latest changes from `@aws-cdk/aws-service-spec` **L1 CloudFormation resource definition changes:** ``` ├[~] service aws-bedrock │ └ resources │ ├[~] resource AWS::Bedrock::Agent │ │ └ types │ │ └[~] type Function │ │ └ properties │ │ └[+] RequireConfirmation: string │ └[~] resource AWS::Bedrock::Prompt │ └ types │ ├[+] type ChatPromptTemplateConfiguration │ │ ├ documentation: Configuration for chat prompt template │ │ │ name: ChatPromptTemplateConfiguration │ │ └ properties │ │ ├ Messages: Array (required) │ │ ├ System: Array │ │ ├ ToolConfiguration: ToolConfiguration │ │ └ InputVariables: Array │ ├[+] type ContentBlock │ │ ├ documentation: Configuration for chat prompt template │ │ │ name: ContentBlock │ │ └ properties │ │ └ Text: string (required) │ ├[+] type Message │ │ ├ documentation: Chat prompt Message │ │ │ name: Message │ │ └ properties │ │ ├ Role: string (required) │ │ └ Content: Array (required) │ ├[+] type PromptAgentResource │ │ ├ documentation: Target Agent to invoke with Prompt │ │ │ name: PromptAgentResource │ │ └ properties │ │ └ AgentIdentifier: string (required) │ ├[+] type PromptGenAiResource │ │ ├ documentation: Target resource to invoke with Prompt │ │ │ name: PromptGenAiResource │ │ └ properties │ │ └ Agent: PromptAgentResource (required) │ ├[~] type PromptTemplateConfiguration │ │ └ properties │ │ ├[+] Chat: ChatPromptTemplateConfiguration │ │ └ Text: - TextPromptTemplateConfiguration (required) │ │ + TextPromptTemplateConfiguration │ ├[~] type PromptVariant │ │ └ properties │ │ └[+] GenAiResource: PromptGenAiResource │ ├[+] type SpecificToolChoice │ │ ├ documentation: Specific Tool choice │ │ │ name: SpecificToolChoice │ │ └ properties │ │ └ Name: string (required) │ ├[+] type SystemContentBlock │ │ ├ documentation: Configuration for chat prompt template │ │ │ name: SystemContentBlock │ │ └ properties │ │ └ Text: string (required) │ ├[+] type Tool │ │ ├ documentation: Tool details │ │ │ name: Tool │ │ └ properties │ │ └ ToolSpec: ToolSpecification (required) │ ├[+] type ToolChoice │ │ ├ name: ToolChoice │ │ └ properties │ │ ├ Auto: json │ │ ├ Any: json │ │ └ Tool: SpecificToolChoice │ ├[+] type ToolConfiguration │ │ ├ documentation: Tool configuration │ │ │ name: ToolConfiguration │ │ └ properties │ │ ├ Tools: Array (required) │ │ └ ToolChoice: ToolChoice │ ├[+] type ToolInputSchema │ │ ├ documentation: Tool input schema │ │ │ name: ToolInputSchema │ │ └ properties │ │ └ Json: json (required) │ └[+] type ToolSpecification │ ├ documentation: Tool specification │ │ name: ToolSpecification │ └ properties │ ├ Name: string (required) │ ├ Description: string │ └ InputSchema: ToolInputSchema (required) ├[~] service aws-datazone │ └ resources │ └[~] resource AWS::DataZone::DataSource │ └ types │ ├[~] type DataSourceConfigurationInput │ │ └ properties │ │ └[+] SageMakerRunConfiguration: SageMakerRunConfigurationInput │ └[+] type SageMakerRunConfigurationInput │ ├ documentation: The configuration details of the Amazon SageMaker data source. │ │ name: SageMakerRunConfigurationInput │ └ properties │ └ TrackingAssets: Map> (required) ├[~] service aws-ec2 │ └ resources │ └[~] resource AWS::EC2::VPCEndpointService │ ├ - tagInformation: undefined │ │ + tagInformation: {"tagPropertyName":"Tags","variant":"standard"} │ └ properties │ └[+] Tags: Array ├[~] service aws-emr │ └ resources │ └[~] resource AWS::EMR::Studio │ └ - tagInformation: {"tagPropertyName":"Tags","variant":"standard"} │ + tagInformation: undefined ├[~] service aws-opensearchservice │ └ resources │ └[~] resource AWS::OpenSearchService::Domain │ └ types │ ├[~] type ClusterConfig │ │ └ properties │ │ └[+] NodeOptions: Array │ ├[+] type NodeConfig │ │ ├ name: NodeConfig │ │ └ properties │ │ ├ Enabled: boolean │ │ ├ Type: string │ │ └ Count: integer │ └[+] type NodeOption │ ├ name: NodeOption │ └ properties │ ├ NodeType: string │ └ NodeConfig: NodeConfig ├[~] service aws-quicksight │ └ resources │ ├[~] resource AWS::QuickSight::Analysis │ │ └ types │ │ ├[~] type GeospatialLayerMapConfiguration │ │ │ └ properties │ │ │ └[+] Interactions: json │ │ ├[~] type GeospatialMapConfiguration │ │ │ └ properties │ │ │ └[+] Interactions: json │ │ └[~] type ImageMenuOption │ │ └ properties │ │ └[+] AvailabilityStatus: json │ ├[~] resource AWS::QuickSight::Dashboard │ │ └ types │ │ ├[~] type DashboardPublishOptions │ │ │ └ properties │ │ │ └ VisualMenuOption: - VisualMenuOption │ │ │ + json ⇐ VisualMenuOption │ │ ├[~] type GeospatialLayerMapConfiguration │ │ │ └ properties │ │ │ └[+] Interactions: json │ │ └[~] type GeospatialMapConfiguration │ │ └ properties │ │ └[+] Interactions: json │ ├[~] resource AWS::QuickSight::DataSet │ │ └ types │ │ └[~] type S3Source │ │ └ properties │ │ └ UploadSettings: - UploadSettings │ │ + json ⇐ UploadSettings │ └[~] resource AWS::QuickSight::Template │ └ types │ ├[~] type AxisDisplayOptions │ │ └ properties │ │ ├ AxisLineVisibility: - string │ │ │ + json ⇐ string │ │ └ GridLineVisibility: - string │ │ + json ⇐ string │ ├[~] type BoxPlotOptions │ │ └ properties │ │ ├ AllDataPointsVisibility: - string │ │ │ + json ⇐ string │ │ └ OutlierVisibility: - string │ │ + json ⇐ string │ ├[~] type ChartAxisLabelOptions │ │ └ properties │ │ ├ SortIconVisibility: - string │ │ │ + json ⇐ string │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type ColumnTooltipItem │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type DataLabelOptions │ │ └ properties │ │ ├ CategoryLabelVisibility: - string │ │ │ + json ⇐ string │ │ ├ MeasureLabelVisibility: - string │ │ │ + json ⇐ string │ │ ├ TotalsVisibility: - string │ │ │ + json ⇐ string │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type DataPathLabelType │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type DateAxisOptions │ │ └ properties │ │ └ MissingDateVisibility: - string │ │ + json ⇐ string │ ├[~] type DonutCenterOptions │ │ └ properties │ │ └ LabelVisibility: - string │ │ + json ⇐ string │ ├[~] type FieldBasedTooltip │ │ └ properties │ │ └ AggregationVisibility: - string │ │ + json ⇐ string │ ├[~] type FieldLabelType │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type FieldTooltipItem │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type FreeFormLayoutElement │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type FreeFormLayoutElementBackgroundStyle │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type FreeFormLayoutElementBorderStyle │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type FunnelChartDataLabelOptions │ │ └ properties │ │ ├ CategoryLabelVisibility: - string │ │ │ + json ⇐ string │ │ ├ MeasureLabelVisibility: - string │ │ │ + json ⇐ string │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type ImageMenuOption │ │ └ properties │ │ └[+] AvailabilityStatus: json │ ├[~] type KPISparklineOptions │ │ └ properties │ │ ├ TooltipVisibility: - string │ │ │ + json ⇐ string │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type LabelOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type LegendOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type LineChartLineStyleSettings │ │ └ properties │ │ └ LineVisibility: - string │ │ + json ⇐ string │ ├[~] type LineChartMarkerStyleSettings │ │ └ properties │ │ └ MarkerVisibility: - string │ │ + json ⇐ string │ ├[~] type ListControlSearchOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type ListControlSelectAllOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type LoadingAnimation │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type MaximumLabelType │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type MinimumLabelType │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type PanelConfiguration │ │ └ properties │ │ ├ BackgroundVisibility: - string │ │ │ + json ⇐ string │ │ ├ BorderVisibility: - string │ │ │ + json ⇐ string │ │ └ GutterVisibility: - string │ │ + json ⇐ string │ ├[~] type PanelTitleOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type PivotTableFieldOption │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type PivotTableOptions │ │ └ properties │ │ ├ CollapsedRowDimensionsVisibility: - string │ │ │ + json ⇐ string │ │ ├ ColumnNamesVisibility: - string │ │ │ + json ⇐ string │ │ ├ SingleMetricVisibility: - string │ │ │ + json ⇐ string │ │ └ ToggleButtonsVisibility: - string │ │ + json ⇐ string │ ├[~] type PivotTablePaginatedReportOptions │ │ └ properties │ │ ├ OverflowColumnHeaderVisibility: - string │ │ │ + json ⇐ string │ │ └ VerticalOverflowVisibility: - string │ │ + json ⇐ string │ ├[~] type PivotTableRowsLabelOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type PivotTotalOptions │ │ └ properties │ │ └ TotalsVisibility: - string │ │ + json ⇐ string │ ├[~] type ProgressBarOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type RadarChartAreaStyleSettings │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type RadarChartConfiguration │ │ └ properties │ │ └ AlternateBandColorsVisibility: - string │ │ + json ⇐ string │ ├[~] type RangeEndsLabelType │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type ScrollBarOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type SecondaryValueOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type SheetControlInfoIconLabelOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type SheetElementConfigurationOverrides │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type SheetImageTooltipConfiguration │ │ └ properties │ │ └ Visibility: - string │ │ + string ⇐ json │ ├[~] type SubtotalOptions │ │ └ properties │ │ └ TotalsVisibility: - string │ │ + json ⇐ string │ ├[~] type TableCellStyle │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type TableFieldOption │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type TablePaginatedReportOptions │ │ └ properties │ │ ├ OverflowColumnHeaderVisibility: - string │ │ │ + json ⇐ string │ │ └ VerticalOverflowVisibility: - string │ │ + json ⇐ string │ ├[~] type TextControlPlaceholderOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type ThousandSeparatorOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type TooltipOptions │ │ └ properties │ │ └ TooltipVisibility: - string │ │ + json ⇐ string │ ├[~] type TotalOptions │ │ └ properties │ │ └ TotalsVisibility: - string │ │ + json ⇐ string │ ├[~] type TrendArrowOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ ├[~] type VisualSubtitleLabelOptions │ │ └ properties │ │ └ Visibility: - string │ │ + json ⇐ string │ └[~] type VisualTitleLabelOptions │ └ properties │ └ Visibility: - string │ + json ⇐ string └[~] service aws-ses └ resources └[~] resource AWS::SES::MailManagerRuleSet └ types ├[+] type DeliverToQBusinessAction │ ├ name: DeliverToQBusinessAction │ └ properties │ ├ ActionFailurePolicy: string │ ├ ApplicationId: string (required) │ ├ IndexId: string (required) │ └ RoleArn: string (required) └[~] type RuleAction └ properties └[+] DeliverToQBusiness: DeliverToQBusinessAction ``` --- .../@aws-cdk/cloudformation-diff/package.json | 4 +-- packages/@aws-cdk/integ-runner/package.json | 2 +- packages/aws-cdk-lib/package.json | 2 +- tools/@aws-cdk/spec2cdk/package.json | 6 ++-- yarn.lock | 28 +++++++++---------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index a5390a4620103..0a19d8623a8ae 100644 --- a/packages/@aws-cdk/cloudformation-diff/package.json +++ b/packages/@aws-cdk/cloudformation-diff/package.json @@ -23,8 +23,8 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/aws-service-spec": "^0.1.39", - "@aws-cdk/service-spec-types": "^0.0.106", + "@aws-cdk/aws-service-spec": "^0.1.40", + "@aws-cdk/service-spec-types": "^0.0.107", "chalk": "^4", "diff": "^5.2.0", "fast-deep-equal": "^3.1.3", diff --git a/packages/@aws-cdk/integ-runner/package.json b/packages/@aws-cdk/integ-runner/package.json index 482510d735fcb..9dbe0d95e564f 100644 --- a/packages/@aws-cdk/integ-runner/package.json +++ b/packages/@aws-cdk/integ-runner/package.json @@ -75,7 +75,7 @@ "@aws-cdk/cloud-assembly-schema": "^38.0.0", "@aws-cdk/cloudformation-diff": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "@aws-cdk/aws-service-spec": "^0.1.39", + "@aws-cdk/aws-service-spec": "^0.1.40", "cdk-assets": "3.0.0-rc.32", "@aws-cdk/cdk-cli-wrapper": "0.0.0", "aws-cdk": "0.0.0", diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index e6bd442c3bcc4..b6a237c0a8a89 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -136,7 +136,7 @@ "mime-types": "^2.1.35" }, "devDependencies": { - "@aws-cdk/aws-service-spec": "^0.1.39", + "@aws-cdk/aws-service-spec": "^0.1.40", "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/custom-resource-handlers": "0.0.0", "@aws-cdk/pkglint": "0.0.0", diff --git a/tools/@aws-cdk/spec2cdk/package.json b/tools/@aws-cdk/spec2cdk/package.json index be5354dfa108a..c6a92e5d8237a 100644 --- a/tools/@aws-cdk/spec2cdk/package.json +++ b/tools/@aws-cdk/spec2cdk/package.json @@ -32,9 +32,9 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/aws-service-spec": "^0.1.39", - "@aws-cdk/service-spec-importers": "^0.0.59", - "@aws-cdk/service-spec-types": "^0.0.106", + "@aws-cdk/aws-service-spec": "^0.1.40", + "@aws-cdk/service-spec-importers": "^0.0.60", + "@aws-cdk/service-spec-types": "^0.0.107", "@cdklabs/tskb": "^0.0.3", "@cdklabs/typewriter": "^0.0.3", "camelcase": "^6", diff --git a/yarn.lock b/yarn.lock index 95e39cba33753..087c8e04423ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -63,12 +63,12 @@ resolved "https://registry.npmjs.org/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.1.0.tgz#6d3c7860354d4856a7e75375f2f0ecab313b4989" integrity sha512-7bY3J8GCVxLupn/kNmpPc5VJz8grx+4RKfnnJiO1LG+uxkZfANZG3RMHhE+qQxxwkyQ9/MfPtTpf748UhR425A== -"@aws-cdk/aws-service-spec@^0.1.39": - version "0.1.39" - resolved "https://registry.npmjs.org/@aws-cdk/aws-service-spec/-/aws-service-spec-0.1.39.tgz#ae70cb59f9e20dbfb0c5b66671c35adaa0d51503" - integrity sha512-d0WygAOVbPVVn/nopwy2yY40kN7blGAvtIegNhfxPEwP7hU50DwK8nBUZEBz1WzQL8+iOCD/PWIYYH2aoPAk5Q== +"@aws-cdk/aws-service-spec@^0.1.40": + version "0.1.40" + resolved "https://registry.npmjs.org/@aws-cdk/aws-service-spec/-/aws-service-spec-0.1.40.tgz#47cb3a68ab088b9d1882eae653d61a12d1b5743b" + integrity sha512-op8bV75AEkLJEjEDZMFNUCJkX4WLB+YtzT3tPX7LOOVNePDlUlbWrO29edHjvPfCiw2QkqCpGMjCeeygKCZVvQ== dependencies: - "@aws-cdk/service-spec-types" "^0.0.106" + "@aws-cdk/service-spec-types" "^0.0.107" "@cdklabs/tskb" "^0.0.3" "@aws-cdk/cloud-assembly-schema@^38.0.0", "@aws-cdk/cloud-assembly-schema@^38.0.1": @@ -106,12 +106,12 @@ resolved "https://registry.npmjs.org/@aws-cdk/lambda-layer-kubectl-v31/-/lambda-layer-kubectl-v31-2.0.0.tgz#d87799d7d0d5dad77af45281a36942e4b7996b6b" integrity sha512-8JI0sMDbqCubOyt1TbQFEwicYok9KYSrNSfzREgjGJcoPy17/Kd0gbe44ATyLMfjae7dExUhhwKMhr6GK7Hmrw== -"@aws-cdk/service-spec-importers@^0.0.59": - version "0.0.59" - resolved "https://registry.npmjs.org/@aws-cdk/service-spec-importers/-/service-spec-importers-0.0.59.tgz#c0fcd9a64083e555dc9e359fc4e175213437e919" - integrity sha512-OgIjNvRp7rJidxw+P0mMZCrmll6rmuS+N38s/8Zzw8WyUJ9ixyF1E8KNL2K+Jb+RUOsE6steWSChVBE2A+o+ag== +"@aws-cdk/service-spec-importers@^0.0.60": + version "0.0.60" + resolved "https://registry.npmjs.org/@aws-cdk/service-spec-importers/-/service-spec-importers-0.0.60.tgz#40f3960bb171ee6d967e2b2481c70541ed95b670" + integrity sha512-WC9ISRg3oPrfDi831IXgyX8GG7lamUWEv+6IOj4UBAb5LDEcWVDl73IHyq9AFiVPwEbIPUGPn3JTj9tqdpqB1w== dependencies: - "@aws-cdk/service-spec-types" "^0.0.106" + "@aws-cdk/service-spec-types" "^0.0.107" "@cdklabs/tskb" "^0.0.3" ajv "^6" canonicalize "^2.0.0" @@ -122,10 +122,10 @@ glob "^8" sort-json "^2.0.1" -"@aws-cdk/service-spec-types@^0.0.106": - version "0.0.106" - resolved "https://registry.npmjs.org/@aws-cdk/service-spec-types/-/service-spec-types-0.0.106.tgz#1739c42014e896bf36b70230c04dbf852d9d8269" - integrity sha512-hjEzUqawJIdhoef1DWOcMPqnonBmQv1xYGBEsQ6ddhEPEVIf/IA71eIjKl8bAourMO9ThLv53ThCklPLnVJy6w== +"@aws-cdk/service-spec-types@^0.0.107": + version "0.0.107" + resolved "https://registry.npmjs.org/@aws-cdk/service-spec-types/-/service-spec-types-0.0.107.tgz#9630507487ced2fe926b93cd77c6a0a099782c7f" + integrity sha512-zI9NU0eU6I0+W8vttyFHQghk6IEnr6ps/5qhGcnGdV51K4fN8pR3yDP5QVqZiJX1vqAl63aH/JIdt+yIvGr2uA== dependencies: "@cdklabs/tskb" "^0.0.3" From 5aec766110f65df3a78b3314bc0c30b60c17c2e7 Mon Sep 17 00:00:00 2001 From: Rico Hermans Date: Mon, 23 Dec 2024 15:57:37 +0100 Subject: [PATCH 02/13] chore(cli-integ): fix a race condition in the resource-pool tests (#32646) There was a race condition between `take1` and `take2`, and the tests would expect `take1` to always win the race. Change the test to force `take1` to win. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk-testing/cli-integ/test/resource-pool.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk-testing/cli-integ/test/resource-pool.test.ts b/packages/@aws-cdk-testing/cli-integ/test/resource-pool.test.ts index 7f8bc069fe525..ff5cf3c43a276 100644 --- a/packages/@aws-cdk-testing/cli-integ/test/resource-pool.test.ts +++ b/packages/@aws-cdk-testing/cli-integ/test/resource-pool.test.ts @@ -8,11 +8,16 @@ const POOL_NAME = 'resource-pool.test'; test('take and dispose', async () => { const pool = ResourcePool.withResources(POOL_NAME, ['a']); const take1 = pool.take(); - const take2 = pool.take(); let released = false; const lease1 = await take1; + + // We must start the take2 only after take1 has definitely + // succeeded, otherwise we have a race condition if take2 happens to + // win the race (we expect take1 to succeed and take2 to wait). + const take2 = pool.take(); + // awaiting 'take2' would now block but we add an async // handler to it to flip a boolean to see when it gets activated. void(take2.then(() => released = true)); From ff211171913a2a9f6af0dd47ed2ebfe7bee3ce50 Mon Sep 17 00:00:00 2001 From: Rico Hermans Date: Mon, 23 Dec 2024 16:28:02 +0100 Subject: [PATCH 03/13] chore(cli-integ): remove in-source compilation of 'bin' directory (#32642) The CLI integ test package relies on the `bin` directory being compiled in-source. In new projen-managed setups, this is not common anymore. Move the actual CLI sources into the `lib/cli` directory and launch them from there. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk-testing/cli-integ/bin/query-github | 2 +- packages/@aws-cdk-testing/cli-integ/bin/run-suite | 2 +- .../cli-integ/bin/stage-distribution | 2 +- packages/@aws-cdk-testing/cli-integ/bin/test-root | 2 +- .../cli-integ/{bin => lib/cli}/query-github.ts | 2 +- .../cli-integ/{bin => lib/cli}/run-suite.ts | 10 +++++----- .../{bin => lib/cli}/stage-distribution.ts | 14 +++++++------- .../cli-integ/{bin => lib/cli}/test-root.ts | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) rename packages/@aws-cdk-testing/cli-integ/{bin => lib/cli}/query-github.ts (96%) rename packages/@aws-cdk-testing/cli-integ/{bin => lib/cli}/run-suite.ts (91%) rename packages/@aws-cdk-testing/cli-integ/{bin => lib/cli}/stage-distribution.ts (94%) rename packages/@aws-cdk-testing/cli-integ/{bin => lib/cli}/test-root.ts (57%) diff --git a/packages/@aws-cdk-testing/cli-integ/bin/query-github b/packages/@aws-cdk-testing/cli-integ/bin/query-github index fbb9b1fa5f199..34c2f861aefe9 100755 --- a/packages/@aws-cdk-testing/cli-integ/bin/query-github +++ b/packages/@aws-cdk-testing/cli-integ/bin/query-github @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('./query-github.js'); +require('../lib/cli/query-github.js'); diff --git a/packages/@aws-cdk-testing/cli-integ/bin/run-suite b/packages/@aws-cdk-testing/cli-integ/bin/run-suite index d4a0aacaa4a54..8b2b678b95a6b 100755 --- a/packages/@aws-cdk-testing/cli-integ/bin/run-suite +++ b/packages/@aws-cdk-testing/cli-integ/bin/run-suite @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('./run-suite.js'); \ No newline at end of file +require('../lib/cli/run-suite.js'); \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution b/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution index 99b7ad3606f7b..5105f5fd7116e 100755 --- a/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution +++ b/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('./stage-distribution.js'); +require('../lib/cli/stage-distribution.js'); diff --git a/packages/@aws-cdk-testing/cli-integ/bin/test-root b/packages/@aws-cdk-testing/cli-integ/bin/test-root index d14248e4d4019..9cb8f0f2284fd 100755 --- a/packages/@aws-cdk-testing/cli-integ/bin/test-root +++ b/packages/@aws-cdk-testing/cli-integ/bin/test-root @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('./test-root.js'); +require('../lib/cli/test-root.js'); diff --git a/packages/@aws-cdk-testing/cli-integ/bin/query-github.ts b/packages/@aws-cdk-testing/cli-integ/lib/cli/query-github.ts similarity index 96% rename from packages/@aws-cdk-testing/cli-integ/bin/query-github.ts rename to packages/@aws-cdk-testing/cli-integ/lib/cli/query-github.ts index 712e4108b70ca..8a8d61309658a 100644 --- a/packages/@aws-cdk-testing/cli-integ/bin/query-github.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/cli/query-github.ts @@ -1,5 +1,5 @@ import * as yargs from 'yargs'; -import { fetchPreviousVersion } from '../lib/github'; +import { fetchPreviousVersion } from '../github'; async function main() { const args = await yargs diff --git a/packages/@aws-cdk-testing/cli-integ/bin/run-suite.ts b/packages/@aws-cdk-testing/cli-integ/lib/cli/run-suite.ts similarity index 91% rename from packages/@aws-cdk-testing/cli-integ/bin/run-suite.ts rename to packages/@aws-cdk-testing/cli-integ/lib/cli/run-suite.ts index 4d32690e16f7a..405031d364d57 100644 --- a/packages/@aws-cdk-testing/cli-integ/bin/run-suite.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/cli/run-suite.ts @@ -2,10 +2,10 @@ import * as path from 'path'; import * as jest from 'jest'; import * as yargs from 'yargs'; -import { ReleasePackageSourceSetup } from '../lib/package-sources/release-source'; -import { RepoPackageSourceSetup, autoFindRoot } from '../lib/package-sources/repo-source'; -import { IPackageSourceSetup } from '../lib/package-sources/source'; -import { serializeForSubprocess } from '../lib/package-sources/subprocess'; +import { ReleasePackageSourceSetup } from '../package-sources/release-source'; +import { RepoPackageSourceSetup, autoFindRoot } from '../package-sources/repo-source'; +import { IPackageSourceSetup } from '../package-sources/source'; +import { serializeForSubprocess } from '../package-sources/subprocess'; async function main() { const args = await yargs @@ -126,7 +126,7 @@ async function main() { ...args.verbose ? ['--verbose'] : [], ...passWithNoTests ? ['--passWithNoTests'] : [], ...args['test-file'] ? [args['test-file']] : [], - ], path.resolve(__dirname, '..', 'resources', 'integ.jest.config.js')); + ], path.resolve(__dirname, '..', '..', 'resources', 'integ.jest.config.js')); } finally { await packageSource.cleanup(); diff --git a/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts b/packages/@aws-cdk-testing/cli-integ/lib/cli/stage-distribution.ts similarity index 94% rename from packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts rename to packages/@aws-cdk-testing/cli-integ/lib/cli/stage-distribution.ts index 31af8c4742b99..e23127a588581 100644 --- a/packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/cli/stage-distribution.ts @@ -3,13 +3,13 @@ import * as path from 'path'; import * as fs from 'fs-extra'; import * as glob from 'glob'; import * as yargs from 'yargs'; -import { shell } from '../lib'; -import { TestRepository } from '../lib/staging/codeartifact'; -import { uploadJavaPackages, mavenLogin } from '../lib/staging/maven'; -import { uploadNpmPackages, npmLogin } from '../lib/staging/npm'; -import { uploadDotnetPackages, nugetLogin } from '../lib/staging/nuget'; -import { uploadPythonPackages, pypiLogin } from '../lib/staging/pypi'; -import { UsageDir } from '../lib/staging/usage-dir'; +import { shell } from '..'; +import { TestRepository } from '../staging/codeartifact'; +import { uploadJavaPackages, mavenLogin } from '../staging/maven'; +import { uploadNpmPackages, npmLogin } from '../staging/npm'; +import { uploadDotnetPackages, nugetLogin } from '../staging/nuget'; +import { uploadPythonPackages, pypiLogin } from '../staging/pypi'; +import { UsageDir } from '../staging/usage-dir'; async function main() { await yargs diff --git a/packages/@aws-cdk-testing/cli-integ/bin/test-root.ts b/packages/@aws-cdk-testing/cli-integ/lib/cli/test-root.ts similarity index 57% rename from packages/@aws-cdk-testing/cli-integ/bin/test-root.ts rename to packages/@aws-cdk-testing/cli-integ/lib/cli/test-root.ts index 1a9fe0f655e58..22bd437e6a9df 100644 --- a/packages/@aws-cdk-testing/cli-integ/bin/test-root.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/cli/test-root.ts @@ -1,3 +1,3 @@ import * as path from 'path'; // eslint-disable-next-line no-console -console.log(path.resolve(__dirname, '..')); +console.log(path.resolve(__dirname, '..', '..')); From 8718767c5bf9fce33ea80e6c7d3bb136c79dbf7d Mon Sep 17 00:00:00 2001 From: Hogan Bobertz Date: Mon, 23 Dec 2024 11:43:53 -0500 Subject: [PATCH 04/13] chore(spec2cdk): add tsdoc comment to describe the existance of a hardcoded list of resources in spec2cdk (#32616) ### Reason for this change Discovered this hardcoded list of resource types and did some investigation into the reasoning behind this very large hardcoded list of resources in tagging.ts. Discovered this list is non-updating list is proper and represents a perpetual state of truth for these resource. Legacy resource types often refers to resources added prior to the introduction of the Cloudformation Registry, so I added this comment to explain the purpose of this list so that future engineers will not need to perform the same investigation. ### Description of changes added a tsdoc comment ### Description of how you validated changes Just a comment ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- tools/@aws-cdk/spec2cdk/lib/cdk/tagging.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/@aws-cdk/spec2cdk/lib/cdk/tagging.ts b/tools/@aws-cdk/spec2cdk/lib/cdk/tagging.ts index 95eefba54596b..26d3eb2eb4537 100644 --- a/tools/@aws-cdk/spec2cdk/lib/cdk/tagging.ts +++ b/tools/@aws-cdk/spec2cdk/lib/cdk/tagging.ts @@ -32,6 +32,18 @@ export function resourceTaggabilityStyle(resource: Resource): TaggabilityStyle | return undefined; } +/** + * Mapping of legacy taggable resources to their tag property name and variant + * + * Before the introduction of iTaggablev2 the CDK defined a `tags` property on constructs + * which contained the tagManager, however in cases where the resource itself contained a + * property named 'tags', the CDK would create a `tagsRaw` property to represent that CFN tags property. + * + * Upon the introduction of iTaggablev2, the CDK now uses the `cdkTagManager` property to manage tags. + * This mapping of legacy resources is used to preserve the legacy behavior of applying tags so customers + * who previously were tagging these constructs using `myConstruct.tags.setTag('key', 'value')` will + * continue to be able to do so, without breaking changes. + */ const LEGACY_TAGGABLES: Record = { 'AWS::ACMPCA::CertificateAuthority': ['Tags', 'standard'], 'AWS::AccessAnalyzer::Analyzer': ['Tags', 'standard'], From 0150854bc2e2e021b1f3e0da8e9a2a866afd8e81 Mon Sep 17 00:00:00 2001 From: Rico Hermans Date: Mon, 23 Dec 2024 21:36:52 +0100 Subject: [PATCH 05/13] chore: fix property test for aspects (#32639) The test was asserting that aspects with lower priority would be executed before aspects with higher priority; but this disregarded their application time. If an aspect with lower priority is added before the execution of an aspect happens, there is no way it can execute before it. This fixes error assertions that look like this: ``` TREE +- (root) <-- AddAspect_2822([First,], Mutate_2743@0)@0, Mutate_2743@0 (added), Mutate_2751@0 (added) +- First <-- AddAspect_2822([First,], Mutate_2743@0)@0, AddAspect_2809([], Mutate_2751@0)@0, Mutate_2743@0 (added) +- (added) Tree VISITS 0. <-- AddAspect_2822([First,], Mutate_2743@0) 1. First <-- AddAspect_2822([First,], Mutate_2743@0) 2. First <-- AddAspect_2809([], Mutate_2751@0) 3. First <-- Mutate_2743 4. Tree <-- AddAspect_2822([First,], Mutate_2743@0) Got error: Aspect Mutate_2743@0 at 3 should have been before AddAspect_2809([], Mutate_2751@0)@0 at 2, but was after ``` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cdk-lib/core/test/aspect.prop.test.ts | 48 +++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/packages/aws-cdk-lib/core/test/aspect.prop.test.ts b/packages/aws-cdk-lib/core/test/aspect.prop.test.ts index df2c70a1ade0a..4d58b9092a979 100644 --- a/packages/aws-cdk-lib/core/test/aspect.prop.test.ts +++ b/packages/aws-cdk-lib/core/test/aspect.prop.test.ts @@ -32,7 +32,7 @@ describe('every aspect gets invoked exactly once', () => { for (const aspectApplication of originalAspectApplications) { // Check that each original AspectApplication also visited all child nodes of its original scope: for (const construct of originalConstructsOnApp) { - if (ancestorOf(aspectApplication.construct, construct)) { + if (isAncestorOf(aspectApplication.construct, construct)) { if (!visitsMap.get(construct)!.includes(aspectApplication.aspect)) { throw new Error(`Aspect ${aspectApplication.aspect.constructor.name} applied on ${aspectApplication.construct.node.path} did not visit construct ${construct.node.path} in its original scope.`); } @@ -56,7 +56,7 @@ describe('every aspect gets invoked exactly once', () => { for (const aspectApplication of allAspectApplications) { // Check that each AspectApplication also visited all child nodes of its scope: for (const construct of allConstructsOnApp) { - if (ancestorOf(aspectApplication.construct, construct)) { + if (isAncestorOf(aspectApplication.construct, construct)) { if (!visitsMap.get(construct)!.includes(aspectApplication.aspect)) { throw new Error(`Aspect ${aspectApplication.aspect.constructor.name} applied on ${aspectApplication.construct.node.path} did not visit construct ${construct.node.path} in its scope.`); } @@ -107,7 +107,11 @@ test('for every construct, lower priorities go before higher priorities', () => const aPrio = lowestAspectPrioFor(a.aspect, a.construct); const bPrio = lowestAspectPrioFor(b.aspect, b.construct); - if (!implies(aPrio < bPrio, a.index < b.index)) { + // But only if the application of aspect A exists at least as long as the application of aspect B + const aAppliedT = aspectAppliedT(testApp, a.aspect, a.construct); + const bAppliedT = aspectAppliedT(testApp, b.aspect, b.construct); + + if (!implies(aPrio < bPrio && aAppliedT <= bAppliedT, a.index < b.index)) { throw new Error( `Aspect ${a.aspect}@${aPrio} at ${a.index} should have been before ${b.aspect}@${bPrio} at ${b.index}, but was after`, ); @@ -250,7 +254,7 @@ function sameAspect(a: AspectVisit, b: AspectVisit) { /** * Returns whether `a` is an ancestor of `b` (or if they are the same construct) */ -function ancestorOf(a: Construct, b: Construct) { +function isAncestorOf(a: Construct, b: Construct) { return b.node.path === a.node.path || b.node.path.startsWith(a.node.path + '/'); } @@ -282,6 +286,19 @@ function allAspectApplicationsInScope(a: Construct): AspectApplication[] { return ancestors(a).flatMap((c) => Aspects.of(c).applied); } +/** + * Find the lowest timestamp that could lead to the execution of the given aspect on the given construct + * + * Take the minimum of all added applications that could lead to this execution. + */ +function aspectAppliedT(prettyApp: PrettyApp, a: IAspect, c: Construct): number { + const potentialTimes = [...prettyApp.initialAspects, ...prettyApp.addedAspects].filter((appl) => { + return appl.aspect === a && isAncestorOf(appl.construct, c); + }).map((appl) => appl.t); + + return Math.min(...potentialTimes); +} + /** * Return the lowest priority of Aspect `a` inside the given list of applications */ @@ -350,12 +367,20 @@ function arbConstructTreeFactory(): fc.Arbitrary { */ class PrettyApp { private readonly initialTree: Set; - private readonly initialAspects: Map>; + private readonly _initialAspects: Map>; + public readonly initialAspects: RecordedAspectApplication[]; constructor(public readonly cdkApp: App, public readonly executionState: ExecutionState) { const constructs = cdkApp.node.findAll(); this.initialTree = new Set(constructs.map(c => c.node.path)); - this.initialAspects = new Map(constructs.map(c => [c.node.path, new Set(renderAspects(c))])); + this._initialAspects = new Map(constructs.map(c => [c.node.path, new Set(renderAspects(c))])); + + this.initialAspects = constructs.flatMap(c => Aspects.of(c).applied.map(a => ({ + aspect: a.aspect, + construct: a.construct, + priority: a.priority, + t: 0, + } as RecordedAspectApplication))); } /** @@ -408,7 +433,7 @@ class PrettyApp { const aspects = renderAspects(construct); for (let i = 0; i < aspects.length; i++) { - if (!(self.initialAspects.get(construct.node.path) ?? new Set()).has(aspects[i])) { + if (!(self._initialAspects.get(construct.node.path) ?? new Set()).has(aspects[i])) { aspects[i] += ' (added)'; } } @@ -693,6 +718,7 @@ interface TestAspectApplication extends PartialTestAspectApplication { * An aspect application added by another aspect, during execution */ interface RecordedAspectApplication extends PartialTestAspectApplication { + t: number; construct: Construct; } @@ -715,7 +741,9 @@ class NodeAddingAspect extends TracingAspect { const newConstruct = new ArbConstruct(scope, this.loc.id); for (const { aspect, priority } of this.newAspects) { Aspects.of(newConstruct).add(aspect, { priority }); - this.executionState(node).addedAspects.push({ + const executionState = this.executionState(node); + executionState.addedAspects.push({ + t: executionState.visitLog.length, construct: newConstruct, aspect, priority, @@ -744,7 +772,9 @@ class AspectAddingAspect extends TracingAspect { const constructs = this.newAspect.constructPaths.map((p) => findConstructDeep(node.node.root, p)); for (const construct of constructs) { Aspects.of(construct).add(this.newAspect.aspect, { priority: this.newAspect.priority }); - this.executionState(node).addedAspects.push({ + const executionState = this.executionState(node); + executionState.addedAspects.push({ + t: executionState.visitLog.length, construct, aspect: this.newAspect.aspect, priority: this.newAspect.priority, From cb985bad7cb53da86dbdd1788b5fae986f488e16 Mon Sep 17 00:00:00 2001 From: Sumu Pitchayan <35242245+sumupitchayan@users.noreply.github.com> Date: Mon, 23 Dec 2024 16:07:30 -0500 Subject: [PATCH 06/13] fix(aspects): "localAspects is not iterable" error (#32647) Closes #32470 ### Reason for this change Some customers have reported seeing the error `TypeError: localAspects is not iterable` upon upgrading to CDK v2.172.0 (this is when the Priority-ordered aspects feature was released). This is likely caused by customers having dependencies on third-party constructs/libraries which are using outdated versions (< 2.172.0) of CDK. The problem more specifically is that the `Aspects.applied` function was added in v2.172.0, and the new `invokeAspects` function calls this function on all nodes in the tree. ### Description of changes Created a workaround for customers. Added the `getAspectApplications` function in `synthesis.ts` - this function creates `AspectApplication` objects from `Aspects.all` if `Aspects.applied` does not exist. ### Describe any new or updated permissions being added None. ### Description of how you validated changes New unit test in `aspect.test.ts` with a monkey patched `Aspects.applied` function. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cdk-lib/core/lib/private/synthesis.ts | 22 +++++++++++++++---- packages/aws-cdk-lib/core/test/aspect.test.ts | 20 +++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/packages/aws-cdk-lib/core/lib/private/synthesis.ts b/packages/aws-cdk-lib/core/lib/private/synthesis.ts index 320f3cadf8eaf..494923495a02f 100644 --- a/packages/aws-cdk-lib/core/lib/private/synthesis.ts +++ b/packages/aws-cdk-lib/core/lib/private/synthesis.ts @@ -8,7 +8,7 @@ import { CloudAssembly } from '../../../cx-api'; import * as cxapi from '../../../cx-api'; import { Annotations } from '../annotations'; import { App } from '../app'; -import { AspectApplication, Aspects } from '../aspect'; +import { AspectApplication, AspectPriority, Aspects } from '../aspect'; import { FileSystem } from '../fs'; import { Stack } from '../stack'; import { ISynthesisSession } from '../stack-synthesizers/types'; @@ -228,7 +228,7 @@ function invokeAspects(root: IConstruct) { const node = construct.node; const aspects = Aspects.of(construct); - let localAspects = aspects.applied; + let localAspects = getAspectApplications(construct); const allAspectsHere = sortAspectsByPriority(inheritedAspects, localAspects); const nodeAspectsCount = aspects.all.length; @@ -290,11 +290,10 @@ function invokeAspectsV2(root: IConstruct) { function recurse(construct: IConstruct, inheritedAspects: AspectApplication[]): boolean { const node = construct.node; - const aspects = Aspects.of(construct); let didSomething = false; - let localAspects = aspects.applied; + let localAspects = getAspectApplications(construct); const allAspectsHere = sortAspectsByPriority(inheritedAspects, localAspects); for (const aspectApplication of allAspectsHere) { @@ -354,6 +353,21 @@ function sortAspectsByPriority(inheritedAspects: AspectApplication[], localAspec return allAspects; } +/** + * Helper function to get aspect applications. + * If `Aspects.applied` is available, it is used; otherwise, create AspectApplications from `Aspects.all`. + */ +function getAspectApplications(node: IConstruct): AspectApplication[] { + const aspects = Aspects.of(node); + if (aspects.applied !== undefined) { + return aspects.applied; + } + + // Fallback: Create AspectApplications from `aspects.all` + const typedAspects = aspects as Aspects; + return typedAspects.all.map(aspect => new AspectApplication(node, aspect, AspectPriority.DEFAULT)); +} + /** * Find all stacks and add Metadata Resources to all of them * diff --git a/packages/aws-cdk-lib/core/test/aspect.test.ts b/packages/aws-cdk-lib/core/test/aspect.test.ts index f27837a9f7c62..865f17b031dc0 100644 --- a/packages/aws-cdk-lib/core/test/aspect.test.ts +++ b/packages/aws-cdk-lib/core/test/aspect.test.ts @@ -309,4 +309,24 @@ describe('aspect', () => { } } } + + test.each([ + { stabilization: true }, + { stabilization: false }, + ])('Error is not thrown if Aspects.applied does not exist (stabilization: $stabilization)', ({ stabilization }) => { + const app = new App({ context: { '@aws-cdk/core:aspectStabilization': stabilization } }); + const root = new Stack(app, 'My-Stack'); + + Aspects.of(root).add(new Tag('AspectA', 'Visited')); + + // "Monkey patching" - Override `applied` to simulate its absence + Object.defineProperty(Aspects.prototype, 'applied', { + value: undefined, + configurable: true, + }); + + expect(() => { + app.synth(); + }).not.toThrow(); + }); }); From e364d2b6808fd703600bff07634c4ac3486f6367 Mon Sep 17 00:00:00 2001 From: Matsuda Date: Tue, 24 Dec 2024 07:14:52 +0900 Subject: [PATCH 07/13] fix(opensearch): add I4I and R7GD to list of OpenSearch nodes not requiring EBS volumes (#32592) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Issue # (if applicable) Closes #32070. Closes #32138. ### Reason for this change `I4I` and `R7GD` instances don't require ebs volumes. But at the moment, a domain with `I4I` and `R7GD` instances cannot be deployed. ### Description of changes Added `I4I` and `R7GD` to not requiring EBS volumes instances list. ### Describe any new or updated permissions being added Add unit tests and integ tests. ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- ...nteg-opensearch-instance-store.assets.json | 4 +- ...eg-opensearch-instance-store.template.json | 62 ++++++++++- .../manifest.json | 20 +++- .../tree.json | 100 +++++++++++++++++- .../test/integ.opensearch.ebs.ts | 33 +++--- .../aws-opensearchservice/lib/domain.ts | 37 +++++-- .../aws-opensearchservice/test/domain.test.ts | 59 +++-------- 7 files changed, 235 insertions(+), 80 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/cdk-integ-opensearch-instance-store.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/cdk-integ-opensearch-instance-store.assets.json index 28a52d128b6a1..133cf7ebe2aa9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/cdk-integ-opensearch-instance-store.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/cdk-integ-opensearch-instance-store.assets.json @@ -1,7 +1,7 @@ { "version": "38.0.1", "files": { - "808dff0157a81a757437988ed8e5134982484f830ee8f11135a7009066356f0c": { + "beaba38779e7193b6d3c7408d8074a8cd0116f3852856626918653267cd4a392": { "source": { "path": "cdk-integ-opensearch-instance-store.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "808dff0157a81a757437988ed8e5134982484f830ee8f11135a7009066356f0c.json", + "objectKey": "beaba38779e7193b6d3c7408d8074a8cd0116f3852856626918653267cd4a392.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-opensearchservice/test/integ.opensearch.ebs.js.snapshot/cdk-integ-opensearch-instance-store.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/cdk-integ-opensearch-instance-store.template.json index cc624773ae4a0..f16d02724f73f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/cdk-integ-opensearch-instance-store.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/cdk-integ-opensearch-instance-store.template.json @@ -1,6 +1,6 @@ { "Resources": { - "Domain66AC69E0": { + "Domain19FCBCB91": { "Type": "AWS::OpenSearchService::Domain", "Properties": { "ClusterConfig": { @@ -20,7 +20,65 @@ "EncryptionAtRestOptions": { "Enabled": false }, - "EngineVersion": "OpenSearch_2.5", + "EngineVersion": "OpenSearch_2.17", + "LogPublishingOptions": {}, + "NodeToNodeEncryptionOptions": { + "Enabled": false + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Domain2644FE48C": { + "Type": "AWS::OpenSearchService::Domain", + "Properties": { + "ClusterConfig": { + "DedicatedMasterEnabled": false, + "InstanceCount": 1, + "InstanceType": "i4i.xlarge.search", + "MultiAZWithStandbyEnabled": false, + "ZoneAwarenessEnabled": false + }, + "DomainEndpointOptions": { + "EnforceHTTPS": false, + "TLSSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "EBSOptions": { + "EBSEnabled": false + }, + "EncryptionAtRestOptions": { + "Enabled": false + }, + "EngineVersion": "OpenSearch_2.17", + "LogPublishingOptions": {}, + "NodeToNodeEncryptionOptions": { + "Enabled": false + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Domain3BE108C7A": { + "Type": "AWS::OpenSearchService::Domain", + "Properties": { + "ClusterConfig": { + "DedicatedMasterEnabled": false, + "InstanceCount": 1, + "InstanceType": "r7gd.xlarge.search", + "MultiAZWithStandbyEnabled": false, + "ZoneAwarenessEnabled": false + }, + "DomainEndpointOptions": { + "EnforceHTTPS": false, + "TLSSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "EBSOptions": { + "EBSEnabled": false + }, + "EncryptionAtRestOptions": { + "Enabled": false + }, + "EngineVersion": "OpenSearch_2.17", "LogPublishingOptions": {}, "NodeToNodeEncryptionOptions": { "Enabled": false diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/manifest.json index 65adfcd240404..9399bceb10882 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/manifest.json @@ -16,10 +16,9 @@ "templateFile": "cdk-integ-opensearch-instance-store.template.json", "terminationProtection": false, "validateOnSynth": false, - "notificationArns": [], "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}/808dff0157a81a757437988ed8e5134982484f830ee8f11135a7009066356f0c.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/beaba38779e7193b6d3c7408d8074a8cd0116f3852856626918653267cd4a392.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -35,10 +34,22 @@ "cdk-integ-opensearch-instance-store.assets" ], "metadata": { - "/cdk-integ-opensearch-instance-store/Domain/Resource": [ + "/cdk-integ-opensearch-instance-store/Domain1/Resource": [ { "type": "aws:cdk:logicalId", - "data": "Domain66AC69E0" + "data": "Domain19FCBCB91" + } + ], + "/cdk-integ-opensearch-instance-store/Domain2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain2644FE48C" + } + ], + "/cdk-integ-opensearch-instance-store/Domain3/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain3BE108C7A" } ], "/cdk-integ-opensearch-instance-store/BootstrapVersion": [ @@ -71,7 +82,6 @@ "templateFile": "IntegDefaultTestDeployAssert4E6713E1.template.json", "terminationProtection": false, "validateOnSynth": false, - "notificationArns": [], "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", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/tree.json index 4d17e03744c2f..7c97b949dd18b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.js.snapshot/tree.json @@ -8,13 +8,13 @@ "id": "cdk-integ-opensearch-instance-store", "path": "cdk-integ-opensearch-instance-store", "children": { - "Domain": { - "id": "Domain", - "path": "cdk-integ-opensearch-instance-store/Domain", + "Domain1": { + "id": "Domain1", + "path": "cdk-integ-opensearch-instance-store/Domain1", "children": { "Resource": { "id": "Resource", - "path": "cdk-integ-opensearch-instance-store/Domain/Resource", + "path": "cdk-integ-opensearch-instance-store/Domain1/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::OpenSearchService::Domain", "aws:cdk:cloudformation:props": { @@ -35,7 +35,97 @@ "encryptionAtRestOptions": { "enabled": false }, - "engineVersion": "OpenSearch_2.5", + "engineVersion": "OpenSearch_2.17", + "logPublishingOptions": {}, + "nodeToNodeEncryptionOptions": { + "enabled": false + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_opensearchservice.CfnDomain", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_opensearchservice.Domain", + "version": "0.0.0" + } + }, + "Domain2": { + "id": "Domain2", + "path": "cdk-integ-opensearch-instance-store/Domain2", + "children": { + "Resource": { + "id": "Resource", + "path": "cdk-integ-opensearch-instance-store/Domain2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::OpenSearchService::Domain", + "aws:cdk:cloudformation:props": { + "clusterConfig": { + "dedicatedMasterEnabled": false, + "instanceCount": 1, + "instanceType": "i4i.xlarge.search", + "multiAzWithStandbyEnabled": false, + "zoneAwarenessEnabled": false + }, + "domainEndpointOptions": { + "enforceHttps": false, + "tlsSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "ebsOptions": { + "ebsEnabled": false + }, + "encryptionAtRestOptions": { + "enabled": false + }, + "engineVersion": "OpenSearch_2.17", + "logPublishingOptions": {}, + "nodeToNodeEncryptionOptions": { + "enabled": false + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_opensearchservice.CfnDomain", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_opensearchservice.Domain", + "version": "0.0.0" + } + }, + "Domain3": { + "id": "Domain3", + "path": "cdk-integ-opensearch-instance-store/Domain3", + "children": { + "Resource": { + "id": "Resource", + "path": "cdk-integ-opensearch-instance-store/Domain3/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::OpenSearchService::Domain", + "aws:cdk:cloudformation:props": { + "clusterConfig": { + "dedicatedMasterEnabled": false, + "instanceCount": 1, + "instanceType": "r7gd.xlarge.search", + "multiAzWithStandbyEnabled": false, + "zoneAwarenessEnabled": false + }, + "domainEndpointOptions": { + "enforceHttps": false, + "tlsSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "ebsOptions": { + "ebsEnabled": false + }, + "encryptionAtRestOptions": { + "enabled": false + }, + "engineVersion": "OpenSearch_2.17", "logPublishingOptions": {}, "nodeToNodeEncryptionOptions": { "enabled": false diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.ts index b0298a15b7af5..e42d44d041b71 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.ebs.ts @@ -7,23 +7,24 @@ class TestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); - // deploy the latest opensearch domain with instance store only (no EBS) - const domainProps: opensearch.DomainProps = { - removalPolicy: RemovalPolicy.DESTROY, - version: opensearch.EngineVersion.OPENSEARCH_2_5, - // specify the instance type that supports instance store - capacity: { - multiAzWithStandbyEnabled: false, - dataNodeInstanceType: 'i4g.large.search', - dataNodes: 1, - }, - // force ebs configuration to be disabled - ebs: { - enabled: false, - }, - }; + const instanceTypes = ['i4g.large.search', 'i4i.xlarge.search', 'r7gd.xlarge.search']; - new opensearch.Domain(this, 'Domain', domainProps); + instanceTypes.forEach((instanceType, index) => { + new opensearch.Domain(this, `Domain${index + 1}`, { + removalPolicy: RemovalPolicy.DESTROY, + version: opensearch.EngineVersion.OPENSEARCH_2_17, + // specify the instance type that supports instance store + capacity: { + multiAzWithStandbyEnabled: false, + dataNodeInstanceType: instanceType, + dataNodes: 1, + }, + // force ebs configuration to be disabled + ebs: { + enabled: false, + }, + }); + }); } } diff --git a/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts b/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts index 83f7eb14f9906..f3603307afbb5 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts @@ -1574,10 +1574,24 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { } } + const unSupportEbsInstanceType = [ + ec2.InstanceClass.I3, + ec2.InstanceClass.R6GD, + ec2.InstanceClass.I4G, + ec2.InstanceClass.I4I, + ec2.InstanceClass.IM4GN, + ec2.InstanceClass.R7GD, + ]; + + const supportInstanceStorageInstanceType = [ + ec2.InstanceClass.R3, + ...unSupportEbsInstanceType, + ]; + // Validate against instance type restrictions, per // https://docs.aws.amazon.com/opensearch-service/latest/developerguide/supported-instance-types.html - if (isSomeInstanceType('i3', 'r6gd', 'i4g', 'im4gn') && ebsEnabled) { - throw new Error('I3, R6GD, I4G, and IM4GN instance types do not support EBS storage volumes.'); + if (isSomeInstanceType(...unSupportEbsInstanceType) && ebsEnabled) { + throw new Error(`${formatInstanceTypesList(unSupportEbsInstanceType, 'and')} instance types do not support EBS storage volumes.`); } if (isSomeInstanceType('m3', 'r3', 't2') && encryptionAtRestEnabled) { @@ -1592,10 +1606,10 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { throw new Error('T2 and T3 instance types do not support UltraWarm storage.'); } - // Only R3, I3, R6GD, I4G and IM4GN support instance storage, per + // Only R3, I3, R6GD, I4G, I4I, IM4GN and R7GD support instance storage, per // https://aws.amazon.com/opensearch-service/pricing/ - if (!ebsEnabled && !isEveryDatanodeInstanceType('r3', 'i3', 'r6gd', 'i4g', 'im4gn')) { - throw new Error('EBS volumes are required when using instance types other than R3, I3, R6GD, I4G, or IM4GN.'); + if (!ebsEnabled && !isEveryDatanodeInstanceType(...supportInstanceStorageInstanceType)) { + throw new Error(`EBS volumes are required when using instance types other than ${formatInstanceTypesList(supportInstanceStorageInstanceType, 'or')}.`); } // Only for a valid ebs volume configuration, per @@ -1898,7 +1912,7 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { identityPoolId: props.cognitoDashboardsAuth?.identityPoolId, roleArn: props.cognitoDashboardsAuth?.role.roleArn, userPoolId: props.cognitoDashboardsAuth?.userPoolId, - }: undefined, + } : undefined, vpcOptions: cfnVpcOptions, snapshotOptions: props.automatedSnapshotStartHour ? { automatedSnapshotStartHour: props.automatedSnapshotStartHour } @@ -2188,3 +2202,14 @@ function initializeInstanceType(defaultInstanceType: string, instanceType?: stri return defaultInstanceType; } } + +/** + * Format instance types list for error messages. + * + * @param instanceTypes List of instance types to format + * @param conjunction Word to use as the conjunction (e.g., 'and', 'or') + * @returns Formatted instance types list for error messages + */ +function formatInstanceTypesList(instanceTypes: string[], conjunction: string): string { + return instanceTypes.map((type) => type.toUpperCase()).join(', ').replace(/, ([^,]*)$/, ` ${conjunction} $1`); +} diff --git a/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts b/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts index 6957800ab3c56..df0866c32a410 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts @@ -1964,47 +1964,24 @@ each(testedOpenSearchVersions).describe('custom error responses', (engineVersion })).toThrow(/Node-to-node encryption requires Elasticsearch version 6.0 or later or OpenSearch version 1.0 or later/); }); - test('error when I3, R6GD, I4G, and IM4GN instance types are specified with EBS enabled', () => { + test.each([ + 'i3.2xlarge.search', + 'r6gd.large.search', + 'im4gn.2xlarge.search', + 'i4g.large.search', + 'i4i.xlarge.search', + 'r7gd.xlarge.search', + ])('error when %4 instance types are specified with EBS enabled', (dataNodeInstanceType) => { expect(() => new Domain(stack, 'Domain2', { version: engineVersion, capacity: { - dataNodeInstanceType: 'i3.2xlarge.search', - }, - ebs: { - volumeSize: 100, - volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD, - }, - })).toThrow(/I3, R6GD, I4G, and IM4GN instance types do not support EBS storage volumes./); - expect(() => new Domain(stack, 'Domain3', { - version: engineVersion, - capacity: { - dataNodeInstanceType: 'r6gd.large.search', - }, - ebs: { - volumeSize: 100, - volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD, - }, - })).toThrow(/I3, R6GD, I4G, and IM4GN instance types do not support EBS storage volumes./); - expect(() => new Domain(stack, 'Domain4', { - version: engineVersion, - capacity: { - dataNodeInstanceType: 'im4gn.2xlarge.search', - }, - ebs: { - volumeSize: 100, - volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD, - }, - })).toThrow(/I3, R6GD, I4G, and IM4GN instance types do not support EBS storage volumes./); - expect(() => new Domain(stack, 'Domain5', { - version: engineVersion, - capacity: { - dataNodeInstanceType: 'i4g.large.search', + dataNodeInstanceType, }, ebs: { volumeSize: 100, volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD, }, - })).toThrow(/I3, R6GD, I4G, and IM4GN instance types do not support EBS storage volumes./); + })).toThrow(/I3, R6GD, I4G, I4I, IM4GN and R7GD instance types do not support EBS storage volumes./); }); test('error when m3, r3, or t2 instance types are specified with encryption at rest enabled', () => { @@ -2047,7 +2024,10 @@ each(testedOpenSearchVersions).describe('custom error responses', (engineVersion })).toThrow(/t2.micro.search instance type supports only Elasticsearch versions 1.5 and 2.3/); }); - test('error when any instance type other than R3, I3, R6GD, I4G, or IM4GN are specified without EBS enabled', () => { + test.each([ + 'm5.large.search', + 'r5.large.search', + ])('error when any instance type other than R3, I3, R6GD, I4I, I4G, IM4GN or R7GD are specified without EBS enabled', () => { expect(() => new Domain(stack, 'Domain1', { version: engineVersion, ebs: { @@ -2056,16 +2036,7 @@ each(testedOpenSearchVersions).describe('custom error responses', (engineVersion capacity: { masterNodeInstanceType: 'm5.large.search', }, - })).toThrow(/EBS volumes are required when using instance types other than R3, I3, R6GD, I4G, or IM4GN./); - expect(() => new Domain(stack, 'Domain2', { - version: engineVersion, - ebs: { - enabled: false, - }, - capacity: { - dataNodeInstanceType: 'r5.large.search', - }, - })).toThrow(/EBS volumes are required when using instance types other than R3, I3, R6GD, I4G, or IM4GN./); + })).toThrow(/EBS volumes are required when using instance types other than R3, I3, R6GD, I4G, I4I, IM4GN or R7GD./); }); test('can use compatible master instance types that does not have local storage when data node type is i3 or r6gd', () => { From 491475a7451c151a2f6718185fc5d62e80a1b212 Mon Sep 17 00:00:00 2001 From: Matsuda Date: Tue, 24 Dec 2024 07:47:30 +0900 Subject: [PATCH 08/13] feat(rds): support 11.22-rds.20241121 for RDS PostgreSQL (#32508) Add an engine version. Ref: [Amazon RDS for PostgreSQL announces Extended Support minor 11.22-RDS.20241121](https://aws.amazon.com/about-aws/whats-new/2024/12/amazon-rds-postgresql-minor-11-22-rds-20241121/) ```sh % aws rds describe-db-engine-versions --engine postgres --query "DBEngineVersions[].EngineVersion" --output table --region us-east-1 -------------------------- |DescribeDBEngineVersions| +------------------------+ | 11.22 | | 11.22-rds.20240418 | | 11.22-rds.20240509 | | 11.22-rds.20240808 | | 11.22-rds.20241121 | ... ``` ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *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-rds/lib/instance-engine.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts b/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts index 4990eb6e9e3fa..6c595427acc80 100644 --- a/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts +++ b/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts @@ -1467,6 +1467,10 @@ export class PostgresEngineVersion { * Version "11.22-rds.20240808" */ public static readonly VER_11_22_RDS_20240808 = PostgresEngineVersion.of('11.22-RDS.20240808', '11', { s3Import: true, s3Export: true }); + /** + * Version "11.22-RDS.20241121" + */ + public static readonly VER_11_22_RDS_20241121 = PostgresEngineVersion.of('11.22-RDS.20241121', '11', { s3Import: true, s3Export: true }); /** Version "12" (only a major version, without a specific minor version). */ public static readonly VER_12 = PostgresEngineVersion.of('12', '12', { s3Import: true }); From 079c1e23b6c31ddfe0ac12e2c948866ce2a768a4 Mon Sep 17 00:00:00 2001 From: Mohamed Elasmar <71043312+moelasmar@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:18:17 -0800 Subject: [PATCH 09/13] chore(apigateway): fix the readme sections order. (#32650) ### Description of changes Fixes the readme sections order to match the original order when `Breaking up Methods and Resources across Stacks` section was originally added in this PR https://github.com/aws/aws-cdk/pull/8270. The current order does not make sense, this section does not related to the Step function backed rest API ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *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-apigateway/README.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/README.md b/packages/aws-cdk-lib/aws-apigateway/README.md index cfbd4f639db40..01f78150afe12 100644 --- a/packages/aws-cdk-lib/aws-apigateway/README.md +++ b/packages/aws-cdk-lib/aws-apigateway/README.md @@ -12,9 +12,9 @@ running on AWS Lambda, or any web application. - [Amazon API Gateway Construct Library](#amazon-api-gateway-construct-library) - [Table of Contents](#table-of-contents) - [Defining APIs](#defining-apis) + - [Breaking up Methods and Resources across Stacks](#breaking-up-methods-and-resources-across-stacks) - [AWS Lambda-backed APIs](#aws-lambda-backed-apis) - [AWS StepFunctions backed APIs](#aws-stepfunctions-backed-apis) - - [Breaking up Methods and Resources across Stacks](#breaking-up-methods-and-resources-across-stacks) - [Integration Targets](#integration-targets) - [Usage Plan \& API Keys](#usage-plan--api-keys) - [Adding an API Key to an imported RestApi](#adding-an-api-key-to-an-imported-restapi) @@ -76,6 +76,23 @@ const method = api.root.addResource('books').addMethod('GET'); method.grantExecute(user); ``` +### Breaking up Methods and Resources across Stacks + +It is fairly common for REST APIs with a large number of Resources and Methods to hit the [CloudFormation +limit](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) of 500 resources per +stack. + +To help with this, Resources and Methods for the same REST API can be re-organized across multiple stacks. A common +way to do this is to have a stack per Resource or groups of Resources, but this is not the only possible way. +The following example uses sets up two Resources '/pets' and '/books' in separate stacks using nested stacks: + +[Resources grouped into nested stacks](test/integ.restapi-import.lit.ts) + +> **Warning:** In the code above, an API Gateway deployment is created during the initial CDK deployment. +However, if there are changes to the resources in subsequent CDK deployments, a new API Gateway deployment is not +automatically created. As a result, the latest state of the resources is not reflected. To ensure the latest state +of the resources is reflected, a manual deployment of the API Gateway is required after the CDK deployment. See [Controlled triggering of deployments](#controlled-triggering-of-deployments) for more info. + ## AWS Lambda-backed APIs A very common practice is to use Amazon API Gateway with AWS Lambda as the @@ -255,23 +272,6 @@ AWS Step Functions will receive the following execution input: } ``` -### Breaking up Methods and Resources across Stacks - -It is fairly common for REST APIs with a large number of Resources and Methods to hit the [CloudFormation -limit](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) of 500 resources per -stack. - -To help with this, Resources and Methods for the same REST API can be re-organized across multiple stacks. A common -way to do this is to have a stack per Resource or groups of Resources, but this is not the only possible way. -The following example uses sets up two Resources '/pets' and '/books' in separate stacks using nested stacks: - -[Resources grouped into nested stacks](test/integ.restapi-import.lit.ts) - -> **Warning:** In the code above, an API Gateway deployment is created during the initial CDK deployment. -However, if there are changes to the resources in subsequent CDK deployments, a new API Gateway deployment is not -automatically created. As a result, the latest state of the resources is not reflected. To ensure the latest state -of the resources is reflected, a manual deployment of the API Gateway is required after the CDK deployment. See [Controlled triggering of deployments](#controlled-triggering-of-deployments) for more info. - ## Integration Targets Methods are associated with backend integrations, which are invoked when this From b8e79b6fbb8841b32838ebadb9ba7a127dc1f6ba Mon Sep 17 00:00:00 2001 From: Matsuda Date: Tue, 24 Dec 2024 08:49:56 +0900 Subject: [PATCH 10/13] feat(rds): supports minors 11.4.4, 10.11.10, 10.6.20, 10.5.27 for RDS for MariaDB (#32632) Add new minor versions. Ref: [Amazon RDS for MariaDB supports minors 11.4.4, 10.11.10, 10.6.20, 10.5.27](https://aws.amazon.com/about-aws/whats-new/2024/12/amazon-rds-mariadb-supports-new-minors/) ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *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-rds/lib/instance-engine.ts | 8 ++++++++ packages/aws-cdk-lib/aws-rds/test/instance-engine.test.ts | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts b/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts index 6c595427acc80..cd0e6986fe1d5 100644 --- a/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts +++ b/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts @@ -496,6 +496,8 @@ export class MariaDbEngineVersion { public static readonly VER_10_5_25 = MariaDbEngineVersion.of('10.5.25', '10.5'); /** Version "10.5.26". */ public static readonly VER_10_5_26 = MariaDbEngineVersion.of('10.5.26', '10.5'); + /** Version "10.5.27". */ + public static readonly VER_10_5_27 = MariaDbEngineVersion.of('10.5.27', '10.5'); /** Version "10.6" (only a major version, without a specific minor version). */ public static readonly VER_10_6 = MariaDbEngineVersion.of('10.6', '10.6'); @@ -543,6 +545,8 @@ export class MariaDbEngineVersion { public static readonly VER_10_6_18 = MariaDbEngineVersion.of('10.6.18', '10.6'); /** Version "10.6.19". */ public static readonly VER_10_6_19 = MariaDbEngineVersion.of('10.6.19', '10.6'); + /** Version "10.6.20". */ + public static readonly VER_10_6_20 = MariaDbEngineVersion.of('10.6.20', '10.6'); /** Version "10.11" (only a major version, without a specific minor version). */ public static readonly VER_10_11 = MariaDbEngineVersion.of('10.11', '10.11'); @@ -558,8 +562,12 @@ export class MariaDbEngineVersion { public static readonly VER_10_11_8 = MariaDbEngineVersion.of('10.11.8', '10.11'); /** Version "10.11.9". */ public static readonly VER_10_11_9 = MariaDbEngineVersion.of('10.11.9', '10.11'); + /** Version "10.11.10". */ + public static readonly VER_10_11_10 = MariaDbEngineVersion.of('10.11.10', '10.11'); /** Version "11.4.3". */ public static readonly VER_11_4_3 = MariaDbEngineVersion.of('11.4.3', '11.4'); + /** Version "11.4.4". */ + public static readonly VER_11_4_4 = MariaDbEngineVersion.of('11.4.4', '11.4'); /** * Create a new MariaDbEngineVersion with an arbitrary version. diff --git a/packages/aws-cdk-lib/aws-rds/test/instance-engine.test.ts b/packages/aws-cdk-lib/aws-rds/test/instance-engine.test.ts index e0d4da51136e4..d914fee1eb43b 100644 --- a/packages/aws-cdk-lib/aws-rds/test/instance-engine.test.ts +++ b/packages/aws-cdk-lib/aws-rds/test/instance-engine.test.ts @@ -281,6 +281,7 @@ describe('instance engine', () => { ['10.5.24', rds.MariaDbEngineVersion.VER_10_5_24], ['10.5.25', rds.MariaDbEngineVersion.VER_10_5_25], ['10.5.26', rds.MariaDbEngineVersion.VER_10_5_26], + ['10.5.27', rds.MariaDbEngineVersion.VER_10_5_27], ['10.6', rds.MariaDbEngineVersion.VER_10_6], ['10.6.13', rds.MariaDbEngineVersion.VER_10_6_13], ['10.6.14', rds.MariaDbEngineVersion.VER_10_6_14], @@ -289,6 +290,7 @@ describe('instance engine', () => { ['10.6.17', rds.MariaDbEngineVersion.VER_10_6_17], ['10.6.18', rds.MariaDbEngineVersion.VER_10_6_18], ['10.6.19', rds.MariaDbEngineVersion.VER_10_6_19], + ['10.6.20', rds.MariaDbEngineVersion.VER_10_6_20], ['10.11', rds.MariaDbEngineVersion.VER_10_11], ['10.11.4', rds.MariaDbEngineVersion.VER_10_11_4], ['10.11.5', rds.MariaDbEngineVersion.VER_10_11_5], @@ -296,7 +298,9 @@ describe('instance engine', () => { ['10.11.7', rds.MariaDbEngineVersion.VER_10_11_7], ['10.11.8', rds.MariaDbEngineVersion.VER_10_11_8], ['10.11.9', rds.MariaDbEngineVersion.VER_10_11_9], + ['10.11.10', rds.MariaDbEngineVersion.VER_10_11_10], ['11.4.3', rds.MariaDbEngineVersion.VER_11_4_3], + ['11.4.4', rds.MariaDbEngineVersion.VER_11_4_4], ])('is passed correctly for %s', (engineVersion, version) => { // WHEN From a81eec66fecfc6dd27f3a4328888bd3f0c97b159 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 23 Dec 2024 19:21:56 -0500 Subject: [PATCH 11/13] feat(ec2): add c8g and m8g instance classes (#32528) ### Issue # (if applicable) Closes #32522 ### Reason for this change Added new graviton 4 instance classes ### Description of changes Updated the ec2 instance class enum definitions to include new graviton 4 types ### Description of how you validated changes No ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cdk-lib/aws-ec2/lib/instance-types.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts index 098bfdfa124cb..6b93e128b4bbf 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts @@ -516,6 +516,20 @@ export enum InstanceClass { */ C7G = 'c7g', + /** + * Compute optimized instances for high performance computing, 8th generation with Graviton4 processors + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Frankfurt). + */ + COMPUTE8_GRAVITON4 = 'compute8-graviton4', + + /** + * Compute optimized instances for high performance computing, 8th generation with Graviton4 processors + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Frankfurt). + */ + C8G = 'c8g', + /** * Compute optimized instances for high performance computing, 6th generation with Graviton2 processors * and local NVME drive @@ -1064,6 +1078,20 @@ export enum InstanceClass { */ M7G = 'm7g', + /** + * Standard instances, 8th generation with Graviton4 processors + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Frankfurt). + */ + STANDARD8_GRAVITON = 'standard8-graviton', + + /** + * Standard instances, 8th generation with Graviton4 processors + * + * This instance class is currently only available in US East (Ohio), US East (N. Virginia), US West (Oregon), and Europe (Frankfurt). + */ + M8G = 'm8g', + /** * Standard instances, 7th generation with Graviton3 processors and local NVME drive * @@ -1546,6 +1574,8 @@ export class InstanceType { [InstanceClass.C7I]: 'c7i', [InstanceClass.COMPUTE7_AMD]: 'c7a', [InstanceClass.C7A]: 'c7a', + [InstanceClass.COMPUTE8_GRAVITON4]: 'c8g', + [InstanceClass.C8G]: 'c8g', [InstanceClass.STORAGE2]: 'd2', [InstanceClass.D2]: 'd2', [InstanceClass.STORAGE3]: 'd3', @@ -1632,6 +1662,8 @@ export class InstanceType { [InstanceClass.M6GD]: 'm6gd', [InstanceClass.STANDARD7_GRAVITON]: 'm7g', [InstanceClass.M7G]: 'm7g', + [InstanceClass.STANDARD8_GRAVITON]: 'm8g', + [InstanceClass.M8G]: 'm8g', [InstanceClass.STANDARD7_GRAVITON3_NVME_DRIVE]: 'm7gd', [InstanceClass.M7GD]: 'm7gd', [InstanceClass.STANDARD7_INTEL]: 'm7i', From ecfce7c6975a484401b42d1dcf7276d5907d6350 Mon Sep 17 00:00:00 2001 From: Ren Yamanashi <96362223+ren-yamanashi@users.noreply.github.com> Date: Tue, 24 Dec 2024 09:54:04 +0900 Subject: [PATCH 12/13] feat(autoscaling): add `availabilityZoneDistribution` property to an AutoScalingGroup (#32100) ### Issue # (if applicable) n/A ### Reason for this change We can set a `availabilityZoneDistribution` for an AutoScalingGroup from cloudformation, but this was not supported in the AWS CDK L2 construct. ### Description of changes Add `availabilityZoneDistribution` property to CommonAutoScalingGroupProps and set it in the CfnAutoScalingGroup. ### Description of how you validated changes Added both unit and integration tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- ...efaultTestDeployAssert83F1364B.assets.json | 19 + ...aultTestDeployAssert83F1364B.template.json | 36 + .../aws-cdk-autoscaling-integ.assets.json | 19 + .../aws-cdk-autoscaling-integ.template.json | 596 ++++++++++ .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 283 +++++ .../tree.json | 1011 +++++++++++++++++ ...nteg.asg-capacity-distribution-strategy.ts | 26 + .../aws-cdk-lib/aws-autoscaling/README.md | 23 + .../aws-autoscaling/lib/auto-scaling-group.ts | 23 + .../test/auto-scaling-group.test.ts | 21 + 12 files changed, 2070 insertions(+) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/aws-cdk-autoscaling-integ.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/aws-cdk-autoscaling-integ.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.assets.json new file mode 100644 index 0000000000000..75ef4e6e03ab2 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.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-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.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-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/aws-cdk-autoscaling-integ.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/aws-cdk-autoscaling-integ.assets.json new file mode 100644 index 0000000000000..5e0d71b9cc7b4 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/aws-cdk-autoscaling-integ.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "a643cafaa61b340deef4096ccf40301e5f43084ee2c5a526616001bba857530d": { + "source": { + "path": "aws-cdk-autoscaling-integ.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "a643cafaa61b340deef4096ccf40301e5f43084ee2c5a526616001bba857530d.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-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/aws-cdk-autoscaling-integ.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/aws-cdk-autoscaling-integ.template.json new file mode 100644 index 0000000000000..5a5ac1c6fab8d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/aws-cdk-autoscaling-integ.template.json @@ -0,0 +1,596 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/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": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/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": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/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": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/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": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2NATGateway3C070193": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/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": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/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": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/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": "aws-cdk-autoscaling-integ/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "CapacityDistributionStrategyInstanceSecurityGroup913DB2D8": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceSecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "CapacityDistributionStrategyInstanceRole441B33FB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy" + } + ] + } + }, + "CapacityDistributionStrategyInstanceProfileFE483C1B": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "CapacityDistributionStrategyInstanceRole441B33FB" + } + ] + } + }, + "CapacityDistributionStrategyLaunchTemplate7E9BA428": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "CapacityDistributionStrategyInstanceProfileFE483C1B", + "Arn" + ] + } + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "t2.micro", + "Monitoring": { + "Enabled": false + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "CapacityDistributionStrategyInstanceSecurityGroup913DB2D8", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/LaunchTemplate" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/LaunchTemplate" + } + ] + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/LaunchTemplate" + } + ] + } + ] + }, + "DependsOn": [ + "CapacityDistributionStrategyInstanceRole441B33FB" + ] + }, + "CapacityDistributionStrategyASG95A2EA61": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "AvailabilityZoneDistribution": { + "CapacityDistributionStrategy": "balanced-only" + }, + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "CapacityDistributionStrategyLaunchTemplate7E9BA428" + }, + "Version": { + "Fn::GetAtt": [ + "CapacityDistributionStrategyLaunchTemplate7E9BA428", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "1", + "Tags": [ + { + "Key": "Name", + "PropagateAtLaunch": true, + "Value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + } + }, + "Parameters": { + "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2" + }, + "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-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/cdk.out new file mode 100644 index 0000000000000..c6e612584e352 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/integ.json new file mode 100644 index 0000000000000..10f5f9ca6006a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "CapacityDistributionStrategyTest/DefaultTest": { + "stacks": [ + "aws-cdk-autoscaling-integ" + ], + "assertionStack": "CapacityDistributionStrategyTest/DefaultTest/DeployAssert", + "assertionStackName": "CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/manifest.json new file mode 100644 index 0000000000000..ed8d26221ea83 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/manifest.json @@ -0,0 +1,283 @@ +{ + "version": "38.0.1", + "artifacts": { + "aws-cdk-autoscaling-integ.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-autoscaling-integ.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-autoscaling-integ": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-autoscaling-integ.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/a643cafaa61b340deef4096ccf40301e5f43084ee2c5a526616001bba857530d.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-autoscaling-integ.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": [ + "aws-cdk-autoscaling-integ.assets" + ], + "metadata": { + "/aws-cdk-autoscaling-integ/VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCB9E5F0B4" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1SubnetB4246D30" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableFEE4B781" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1DefaultRoute91CEF279" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1EIP6AD938E8" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1NATGatewayE0556630" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2Subnet74179F39" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTable6F1A15F1" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTableAssociation5A808732" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2DefaultRouteB7481BBA" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2EIP4947BC00" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2NATGateway3C070193" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableBE8A6027" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTable0A19E10E" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" + } + ], + "/aws-cdk-autoscaling-integ/VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + } + ], + "/aws-cdk-autoscaling-integ/VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCIGWB7E252D3" + } + ], + "/aws-cdk-autoscaling-integ/VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCVPCGW99B986DC" + } + ], + "/aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceSecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "CapacityDistributionStrategyInstanceSecurityGroup913DB2D8" + } + ], + "/aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "CapacityDistributionStrategyInstanceRole441B33FB" + } + ], + "/aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "CapacityDistributionStrategyInstanceProfileFE483C1B" + } + ], + "/aws-cdk-autoscaling-integ/CapacityDistributionStrategy/LaunchTemplate/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "CapacityDistributionStrategyLaunchTemplate7E9BA428" + } + ], + "/aws-cdk-autoscaling-integ/CapacityDistributionStrategy/ASG": [ + { + "type": "aws:cdk:logicalId", + "data": "CapacityDistributionStrategyASG95A2EA61" + } + ], + "/aws-cdk-autoscaling-integ/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + { + "type": "aws:cdk:logicalId", + "data": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + } + ], + "/aws-cdk-autoscaling-integ/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-autoscaling-integ/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-autoscaling-integ" + }, + "CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.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": [ + "CapacityDistributionStrategyTestDefaultTestDeployAssert83F1364B.assets" + ], + "metadata": { + "/CapacityDistributionStrategyTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/CapacityDistributionStrategyTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "CapacityDistributionStrategyTest/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-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/tree.json new file mode 100644 index 0000000000000..58bfccf610ec3 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.js.snapshot/tree.json @@ -0,0 +1,1011 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-autoscaling-integ": { + "id": "aws-cdk-autoscaling-integ", + "path": "aws-cdk-autoscaling-integ", + "children": { + "VPC": { + "id": "VPC", + "path": "aws-cdk-autoscaling-integ/VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-autoscaling-integ/VPC/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-cdk-autoscaling-integ/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": "constructs.Construct", + "version": "10.4.2" + } + }, + "EIP": { + "id": "EIP", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "aws-cdk-autoscaling-integ/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": "aws-cdk-autoscaling-integ/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-cdk-autoscaling-integ/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": "constructs.Construct", + "version": "10.4.2" + } + }, + "EIP": { + "id": "EIP", + "path": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "aws-cdk-autoscaling-integ/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": "aws-cdk-autoscaling-integ/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-cdk-autoscaling-integ/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": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-autoscaling-integ/VPC/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-cdk-autoscaling-integ/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": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IGW": { + "id": "IGW", + "path": "aws-cdk-autoscaling-integ/VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "aws-cdk-autoscaling-integ/VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CapacityDistributionStrategy": { + "id": "CapacityDistributionStrategy", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy", + "children": { + "InstanceSecurityGroup": { + "id": "InstanceSecurityGroup", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceSecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceSecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceSecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "InstanceRole": { + "id": "InstanceRole", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "CapacityDistributionStrategyInstanceRole441B33FB" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/ImportedInstanceProfile", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "LaunchTemplate": { + "id": "LaunchTemplate", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/LaunchTemplate", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/LaunchTemplate/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", + "aws:cdk:cloudformation:props": { + "launchTemplateData": { + "iamInstanceProfile": { + "arn": { + "Fn::GetAtt": [ + "CapacityDistributionStrategyInstanceProfileFE483C1B", + "Arn" + ] + } + }, + "imageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "t2.micro", + "monitoring": { + "enabled": false + }, + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "CapacityDistributionStrategyInstanceSecurityGroup913DB2D8", + "GroupId" + ] + } + ], + "tagSpecifications": [ + { + "resourceType": "instance", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/LaunchTemplate" + } + ] + }, + { + "resourceType": "volume", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/LaunchTemplate" + } + ] + } + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "tagSpecifications": [ + { + "resourceType": "launch-template", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/LaunchTemplate" + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "ASG": { + "id": "ASG", + "path": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy/ASG", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", + "aws:cdk:cloudformation:props": { + "availabilityZoneDistribution": { + "capacityDistributionStrategy": "balanced-only" + }, + "launchTemplate": { + "launchTemplateId": { + "Ref": "CapacityDistributionStrategyLaunchTemplate7E9BA428" + }, + "version": { + "Fn::GetAtt": [ + "CapacityDistributionStrategyLaunchTemplate7E9BA428", + "LatestVersionNumber" + ] + } + }, + "maxSize": "1", + "minSize": "1", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-autoscaling-integ/CapacityDistributionStrategy", + "propagateAtLaunch": true + } + ], + "vpcZoneIdentifier": [ + { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + }, + { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-cdk-autoscaling-integ/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-cdk-autoscaling-integ/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-autoscaling-integ/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-autoscaling-integ/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CapacityDistributionStrategyTest": { + "id": "CapacityDistributionStrategyTest", + "path": "CapacityDistributionStrategyTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "CapacityDistributionStrategyTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "CapacityDistributionStrategyTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "CapacityDistributionStrategyTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "CapacityDistributionStrategyTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "CapacityDistributionStrategyTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "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.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.ts new file mode 100644 index 0000000000000..1decbab6a6d54 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-capacity-distribution-strategy.ts @@ -0,0 +1,26 @@ +#!/usr/bin/env node +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as cdk from 'aws-cdk-lib'; +import * as integ from '@aws-cdk/integ-tests-alpha'; +import * as autoscaling from 'aws-cdk-lib/aws-autoscaling'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'aws-cdk-autoscaling-integ'); + +const vpc = new ec2.Vpc(stack, 'VPC', { + maxAzs: 2, + restrictDefaultSecurityGroup: false, +}); + +new autoscaling.AutoScalingGroup(stack, 'CapacityDistributionStrategy', { + vpc, + instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2 }), + azCapacityDistributionStrategy: autoscaling.CapacityDistributionStrategy.BALANCED_ONLY, +}); + +new integ.IntegTest(app, 'CapacityDistributionStrategyTest', { + testCases: [stack], +}); + +app.synth(); diff --git a/packages/aws-cdk-lib/aws-autoscaling/README.md b/packages/aws-cdk-lib/aws-autoscaling/README.md index b8745f86ff860..289356f19a9bd 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/README.md +++ b/packages/aws-cdk-lib/aws-autoscaling/README.md @@ -763,6 +763,29 @@ new autoscaling.AutoScalingGroup(this, 'ASG', { }); ``` +## Capacity Distribution Strategy + +If launches fail in an Availability Zone, the following strategies are available. + +* `BALANCED_BEST_EFFORT` (default) - If launches fail in an Availability Zone, Auto Scaling will attempt to launch in another healthy Availability Zone instead. +* `BALANCED_ONLY` - If launches fail in an Availability Zone, Auto Scaling will continue to attempt to launch in the unhealthy zone to preserve a balanced distribution. + +```ts +declare const vpc: ec2.Vpc; +declare const instanceType: ec2.InstanceType; +declare const machineImage: ec2.IMachineImage; + +new autoscaling.AutoScalingGroup(this, 'ASG', { + vpc, + instanceType, + machineImage, + + // ... + + azCapacityDistributionStrategy: autoscaling.CapacityDistributionStrategy.BALANCED_ONLY, +}); +``` + ## Future work * [ ] CloudWatch Events (impossible to add currently as the AutoScalingGroup ARN is diff --git a/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts b/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts index e0105d02ce4dd..a0886cc441cf1 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts +++ b/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts @@ -411,6 +411,12 @@ export interface CommonAutoScalingGroupProps { * @default false */ readonly ssmSessionPermissions?: boolean; + + /** + * The strategy for distributing instances across Availability Zones. + * @default None + */ + readonly azCapacityDistributionStrategy?: CapacityDistributionStrategy; } /** @@ -1098,6 +1104,20 @@ export class GroupMetric { } } +/** + * The strategies for when launches fail in an Availability Zone. + */ +export enum CapacityDistributionStrategy { + /** + * If launches fail in an Availability Zone, Auto Scaling will continue to attempt to launch in the unhealthy zone to preserve a balanced distribution. + */ + BALANCED_ONLY = 'balanced-only', + /** + * If launches fail in an Availability Zone, Auto Scaling will attempt to launch in another healthy Availability Zone instead. + */ + BALANCED_BEST_EFFORT = 'balanced-best-effort', +} + abstract class AutoScalingGroupBase extends Resource implements IAutoScalingGroup { public abstract autoScalingGroupName: string; @@ -1530,6 +1550,9 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements const asgProps: CfnAutoScalingGroupProps = { autoScalingGroupName: this.physicalName, + availabilityZoneDistribution: props.azCapacityDistributionStrategy + ? { capacityDistributionStrategy: props.azCapacityDistributionStrategy } + : undefined, cooldown: props.cooldown?.toSeconds().toString(), minSize: Tokenization.stringifyNumber(minCapacity), maxSize: Tokenization.stringifyNumber(maxCapacity), diff --git a/packages/aws-cdk-lib/aws-autoscaling/test/auto-scaling-group.test.ts b/packages/aws-cdk-lib/aws-autoscaling/test/auto-scaling-group.test.ts index 2b78904dd300c..dca9c488a46f7 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/test/auto-scaling-group.test.ts +++ b/packages/aws-cdk-lib/aws-autoscaling/test/auto-scaling-group.test.ts @@ -2797,6 +2797,27 @@ describe('InstanceMaintenancePolicy', () => { }); }); + test('can specify capacityDistributionStrategy', () => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = mockVpc(stack); + + // WHEN + new autoscaling.AutoScalingGroup(stack, 'MyFleet', { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage(), + vpc, + azCapacityDistributionStrategy: autoscaling.CapacityDistributionStrategy.BALANCED_ONLY, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::AutoScaling::AutoScalingGroup', { + AvailabilityZoneDistribution: { + CapacityDistributionStrategy: 'balanced-only', + }, + }); + }); + test('throws if maxHealthyPercentage is greater than 200', () => { // GIVEN const stack = new cdk.Stack(); From fcf37ee15810f32d8502f44c4d853e5c163dd422 Mon Sep 17 00:00:00 2001 From: Sumu Pitchayan <35242245+sumupitchayan@users.noreply.github.com> Date: Mon, 23 Dec 2024 20:25:16 -0500 Subject: [PATCH 13/13] chore: fix v2.172.0 changelog (#32480) Fixes mistakes in changelog - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- CHANGELOG.v2.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index bfe3129111fe4..87964ff1afd7b 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -50,12 +50,11 @@ All notable changes to this project will be documented in this file. See [standa * **apigateway:** We will be removing deprecated `APIGatewayV2` constructs from `aws-apigateway` module. -*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* ### Features -* **aspects:** priority-ordered aspect invocation ([#32097](https://github.com/aws/aws-cdk/issues/32097)) ([8ccdff4](https://github.com/aws/aws-cdk/commit/8ccdff4ee083d66f73259223ba75ba0b8a0752a0)), closes [#21341](https://github.com/aws/aws-cdk/issues/21341) [/github.com/aws/aws-cdk/blob/8b495f9ec157c0b00674715f62b1bbcabf2096ac/packages/aws-cdk-lib/core/lib/private/synthesis.ts#L217](https://github.com/aws//github.com/aws/aws-cdk/blob/8b495f9ec157c0b00674715f62b1bbcabf2096ac/packages/aws-cdk-lib/core/lib/private/synthesis.ts/issues/L217) -* **cognito:** new `cloudFrontEndpoint` method for user pool domain without custom resource ([#31402](https://github.com/aws/aws-cdk/issues/31402)) ([deeb2ad](https://github.com/aws/aws-cdk/commit/deeb2ad0bc38101a9f1fa8162ad5d6008900a98d)), closes [#31342](https://github.com/aws/aws-cdk/issues/31342) [/github.com/go-to-k/aws-cdk/blob/fcbdc769e681f1f915cdc8cd7aa3a565d807884d/packages/aws-cdk-lib/aws-route53-targets/lib/userpool-domain.ts#L14](https://github.com/aws//github.com/go-to-k/aws-cdk/blob/fcbdc769e681f1f915cdc8cd7aa3a565d807884d/packages/aws-cdk-lib/aws-route53-targets/lib/userpool-domain.ts/issues/L14) +* **aspects:** priority-ordered aspect invocation ([#32097](https://github.com/aws/aws-cdk/issues/32097)) ([8ccdff4](https://github.com/aws/aws-cdk/commit/8ccdff4ee083d66f73259223ba75ba0b8a0752a0)), closes [#21341](https://github.com/aws/aws-cdk/issues/21341) +* **cognito:** new `cloudFrontEndpoint` method for user pool domain without custom resource ([#31402](https://github.com/aws/aws-cdk/issues/31402)) ([deeb2ad](https://github.com/aws/aws-cdk/commit/deeb2ad0bc38101a9f1fa8162ad5d6008900a98d)), closes [#31342](https://github.com/aws/aws-cdk/issues/31342) * **cognito:** support for ALLOW_USER_AUTH explicit auth flow ([#32273](https://github.com/aws/aws-cdk/issues/32273)) ([c5bcfdc](https://github.com/aws/aws-cdk/commit/c5bcfdc57aa763539b31f4e7f6f115f707c401a4)) * **elasticloadbalancingv2:** ip address type for both network and application target group ([#32189](https://github.com/aws/aws-cdk/issues/32189)) ([7cc5f30](https://github.com/aws/aws-cdk/commit/7cc5f305c839048454240f8d6db1614e2dfa4c53)) * **events:** add filter rules for prefixEqualsIgnoreCase, suffixEqualsIgnoreCase, wildcard, and anythingBut* matches ([#32063](https://github.com/aws/aws-cdk/issues/32063)) ([0ce71fc](https://github.com/aws/aws-cdk/commit/0ce71fc50cffffc04d9d1bc9c98c9c04e77bfe1f)), closes [#28462](https://github.com/aws/aws-cdk/issues/28462) @@ -72,14 +71,14 @@ All notable changes to this project will be documented in this file. See [standa * **apigateway:** remove deprecated apigatewayv2 from aws-apigateway module ([#32297](https://github.com/aws/aws-cdk/issues/32297)) ([4db9565](https://github.com/aws/aws-cdk/commit/4db956597b41bb9d7dd8e1d65b39643772065353)) * **appsync:** `appsync.HttpDataSourceProps` erroneously extends `BaseDataSourceProps` ([#32065](https://github.com/aws/aws-cdk/issues/32065)) ([4e7f5c4](https://github.com/aws/aws-cdk/commit/4e7f5c4469509ed4e1d586a9c5263f19b540a7bd)), closes [#29689](https://github.com/aws/aws-cdk/issues/29689) * **cli:** assume role calls are skipping the proxy ([#32291](https://github.com/aws/aws-cdk/issues/32291)) ([6c0f74e](https://github.com/aws/aws-cdk/commit/6c0f74e4b37b8ef81c927adca1112680d0bf2ad0)) -* **cli:** lambda hotswap fails if `lambda:GetFunctionConfiguration` action is not allowed ([#32301](https://github.com/aws/aws-cdk/issues/32301)) ([be000a2](https://github.com/aws/aws-cdk/commit/be000a251b781b0b0870930992793df5a2fc4b01)), closes [/github.com/aws/aws-sdk-js-v3/blob/main/clients/client-lambda/src/waiters/waitForFunctionUpdatedV2.ts#L10](https://github.com/aws//github.com/aws/aws-sdk-js-v3/blob/main/clients/client-lambda/src/waiters/waitForFunctionUpdatedV2.ts/issues/L10) [/github.com/aws/aws-sdk-js-v3/blob/main/clients/client-lambda/src/waiters/waitForFunctionUpdated.ts#L13](https://github.com/aws//github.com/aws/aws-sdk-js-v3/blob/main/clients/client-lambda/src/waiters/waitForFunctionUpdated.ts/issues/L13) +* **cli:** lambda hotswap fails if `lambda:GetFunctionConfiguration` action is not allowed ([#32301](https://github.com/aws/aws-cdk/issues/32301)) ([be000a2](https://github.com/aws/aws-cdk/commit/be000a251b781b0b0870930992793df5a2fc4b01)), closes [#32219](https://github.com/aws/aws-cdk/issues/32219) * **cli:** mfa code is not requested when `$AWS_PROFILE` is used ([#32313](https://github.com/aws/aws-cdk/issues/32313)) ([6458439](https://github.com/aws/aws-cdk/commit/6458439b08f9ce1f49c1137dd85bb582550a5f52)), closes [#32312](https://github.com/aws/aws-cdk/issues/32312) * **cli:** remove source maps ([#32317](https://github.com/aws/aws-cdk/issues/32317)) ([512cf95](https://github.com/aws/aws-cdk/commit/512cf952f3971cd302fb1cca7c24149b43832280)), closes [#19930](https://github.com/aws/aws-cdk/issues/19930) [#19930](https://github.com/aws/aws-cdk/issues/19930) * **cli:** short-lived credentials are not refreshed ([#32354](https://github.com/aws/aws-cdk/issues/32354)) ([058a0bf](https://github.com/aws/aws-cdk/commit/058a0bfc22036230252fcbc026576260723f6d28)) * **cli:** warns about missing `--no-rollback` flag that is present ([#32309](https://github.com/aws/aws-cdk/issues/32309)) ([559d676](https://github.com/aws/aws-cdk/commit/559d676e2989739b38491b1f767face839d39f69)), closes [#32295](https://github.com/aws/aws-cdk/issues/32295) * **cloudformation-include:** drops unknown policy attributes ([#32321](https://github.com/aws/aws-cdk/issues/32321)) ([20edc7f](https://github.com/aws/aws-cdk/commit/20edc7fe5e891461a8188d306dcc0f776041cf8f)) * **cloudfront:** propagate `originAccessControlId` CloudFront Origin property to CloudFormation templates ([#32020](https://github.com/aws/aws-cdk/issues/32020)) ([f9708a6](https://github.com/aws/aws-cdk/commit/f9708a634ceaef7f62e8193443ea30fe9e2fbad6)), closes [#32018](https://github.com/aws/aws-cdk/issues/32018) -* **iam:** `Role.addManagedPolicy()` does not work for imported roles `IRole` [#8307](https://github.com/aws/aws-cdk/issues/8307) ([#31212](https://github.com/aws/aws-cdk/issues/31212)) ([c78ef1b](https://github.com/aws/aws-cdk/commit/c78ef1b43a18e1ffc93fcbdee9dd2e91fa750a36)), closes [/github.com/aws/aws-cdk/blob/823ff6e03899f790a4cb1c43f92a02cc906ac356/packages/aws-cdk-lib/aws-iam/lib/identity-base.ts#L17-L21](https://github.com/aws//github.com/aws/aws-cdk/blob/823ff6e03899f790a4cb1c43f92a02cc906ac356/packages/aws-cdk-lib/aws-iam/lib/identity-base.ts/issues/L17-L21) +* **iam:** `Role.addManagedPolicy()` does not work for imported roles `IRole` ([#31212](https://github.com/aws/aws-cdk/issues/31212)) ([c78ef1b](https://github.com/aws/aws-cdk/commit/c78ef1b43a18e1ffc93fcbdee9dd2e91fa750a36)), closes [#8307](https://github.com/aws/aws-cdk/issues/8307) ## [2.171.1](https://github.com/aws/aws-cdk/compare/v2.171.0...v2.171.1) (2024-11-27)