Skip to content

Commit

Permalink
feat(core): use literal for stack.partition (under feature flag) (#21420
Browse files Browse the repository at this point in the history
)

closes #4092

When a Stack's region is a string literal, we can return a string
literal from Stack.partition, resulting in easier to read generated
templates.

The feature flag to enable this behavior is `@aws-cdk/core:enablePartitionLiterals`.

----

### All Submissions:

* [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
jgrebholz authored Aug 12, 2022
1 parent f135b80 commit 401b428
Show file tree
Hide file tree
Showing 40 changed files with 2,677 additions and 2,525 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"files": {
"64e4857ead2a6d40a579c8325f31ac188170c3658ab06c2020de84e581a6069d": {
"source": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,7 @@
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::",
"arn:aws:iam::",
{
"Ref": "AWS::AccountId"
},
Expand Down Expand Up @@ -321,11 +317,7 @@
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::",
"arn:aws:iam::",
{
"Ref": "AWS::AccountId"
},
Expand Down Expand Up @@ -400,11 +392,7 @@
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":cloudformation:us-west-2:",
"arn:aws:cloudformation:us-west-2:",
{
"Ref": "AWS::AccountId"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.65"
}
},
"aws-cdk-codepipeline-cloudformation-cross-region": {
Expand Down Expand Up @@ -300,11 +300,7 @@
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::",
"arn:aws:iam::",
{
"Ref": "AWS::AccountId"
},
Expand Down Expand Up @@ -431,13 +427,13 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.65"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.65"
}
},
"CFN": {
Expand Down Expand Up @@ -468,11 +464,7 @@
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::",
"arn:aws:iam::",
{
"Ref": "AWS::AccountId"
},
Expand All @@ -497,7 +489,7 @@
"path": "aws-cdk-codepipeline-cloudformation-cross-region/MyPipeline/CFN/CFN_Deploy/CodePipelineActionRole/8389e75f-0810-4838-bf64-d6f85a95cf83",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.65"
}
},
"DefaultPolicy": {
Expand Down Expand Up @@ -567,11 +559,7 @@
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":cloudformation:us-west-2:",
"arn:aws:cloudformation:us-west-2:",
{
"Ref": "AWS::AccountId"
},
Expand Down Expand Up @@ -710,13 +698,13 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.65"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.65"
}
}
},
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

Loading

0 comments on commit 401b428

Please sign in to comment.