Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make stack.partition concrete if region is concrete #4092

Closed
eladb opened this issue Sep 16, 2019 · 4 comments · Fixed by #21420
Closed

Make stack.partition concrete if region is concrete #4092

eladb opened this issue Sep 16, 2019 · 4 comments · Fixed by #21420
Labels
@aws-cdk/core Related to core CDK functionality effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@eladb
Copy link
Contributor

eladb commented Sep 16, 2019

🚀 Feature Request

Description

If users specify env.region when they define a Stack, we should be able to return a concrete value for stack.partition instead of { "Ref": "AWS::Partition" }

Proposed Solution

Create a map from region to partition in region-info.

Environment

  • CDK CLI Version:
  • Module Version:
  • OS:
  • Language:
@eladb eladb added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. @aws-cdk/core Related to core CDK functionality and removed needs-triage This issue or PR still needs to be triaged. labels Sep 16, 2019
@eladb eladb self-assigned this Sep 16, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Dec 2, 2019

We can, but what's the advantage?

@eladb eladb added effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md labels Jan 23, 2020
@hlascelles
Copy link

For me, cleaner, smaller and easier to read stack diffs. eg, what is simpler to scan here:

            Principal:
              AWS:
                Fn::Join:
                  - ""
                  - - "arn:"
                    - Ref: AWS::Partition
                    - :iam::123456789876:root

or

            Principal:
              AWS: "arn:aws:iam::123456789876:root"

@eladb
Copy link
Contributor Author

eladb commented Apr 4, 2020

Contributions are welcome

@eladb eladb added the p2 label Aug 17, 2020
@eladb eladb assigned rix0rrr and unassigned eladb Aug 17, 2020
@rix0rrr rix0rrr removed their assignment Jun 3, 2021
jgrebholz added a commit to jgrebholz/aws-cdk that referenced this issue Aug 2, 2022
closes aws#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.
jgrebholz added a commit to jgrebholz/aws-cdk that referenced this issue Aug 2, 2022
closes aws#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.
jgrebholz added a commit to jgrebholz/aws-cdk that referenced this issue Aug 2, 2022
closes aws#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.
jgrebholz added a commit to jgrebholz/aws-cdk that referenced this issue Aug 11, 2022
closes aws#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.
jgrebholz added a commit to jgrebholz/aws-cdk that referenced this issue Aug 11, 2022
closes aws#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.
jgrebholz added a commit to jgrebholz/aws-cdk that referenced this issue Aug 11, 2022
closes aws#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.
@mergify mergify bot closed this as completed in #21420 Aug 12, 2022
mergify bot pushed a commit that referenced this issue Aug 12, 2022
)

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*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

josephedward pushed a commit to josephedward/aws-cdk that referenced this issue Aug 30, 2022
…#21420)

closes aws#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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants