aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

feat(core): use literal for stack.partition (under feature flag)

Open jgrebholz opened this issue 3 years ago • 5 comments

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.


All Submissions:

Adding new Unconventional Dependencies:

  • [ ] This PR adds new unconventional dependencies following the process described here

New Features

  • [ ] Have you added the new feature to an integration test?
    • [ ] 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

jgrebholz avatar Aug 02 '22 13:08 jgrebholz

gitpod-io[bot] avatar Aug 02 '22 13:08 gitpod-io[bot]

Thanks for your review @TheRealAmazonKendra I've updated the PR to include a feature flag, a minor update to the README, and confirmed the previously failing aws-iam integ tests are passing now.

jgrebholz avatar Aug 02 '22 21:08 jgrebholz

Oh, I almost forgot, now that this is behind a feature flag, please update your PR to reflect that. We have specific formatting instructions in our contributing guide.

TheRealAmazonKendra avatar Aug 02 '22 23:08 TheRealAmazonKendra

The most recent push includes the results of yarn integ --update-on-failed for each of the failing integration tests needed for my local run of ./build.sh to succeed. I'll review the results of the build fleet tomorrow and update as needed. I'm not sure why so many integ tests reported UNCHANGED on their snapshot comparisons, but I'm happy to investigate any that you think should be objecting. Is it possible they're using AWS.Region or a stack parameter for region?

The RegionInfo looks correct to me with 30 regions:

$ cat built-ins.generated.ts | grep FactName.PARTITION | awk '{print $3, $7;}'
"af-south-1", "aws"
"ap-east-1", "aws"
"ap-northeast-1", "aws"
"ap-northeast-2", "aws"
"ap-northeast-3", "aws"
"ap-south-1", "aws"
"ap-southeast-1", "aws"
"ap-southeast-2", "aws"
"ap-southeast-3", "aws"
"ca-central-1", "aws"
"cn-north-1", "aws-cn"
"cn-northwest-1", "aws-cn"
"eu-central-1", "aws"
"eu-north-1", "aws"
"eu-south-1", "aws"
"eu-south-2", "aws"
"eu-west-1", "aws"
"eu-west-2", "aws"
"eu-west-3", "aws"
"me-south-1", "aws"
"sa-east-1", "aws"
"us-east-1", "aws"
"us-east-2", "aws"
"us-gov-east-1", "aws-us-gov"
"us-gov-west-1", "aws-us-gov"
"us-iso-east-1", "aws-iso"
"us-iso-west-1", "aws-iso"
"us-isob-east-1", "aws-iso-b"
"us-west-1", "aws"
"us-west-2", "aws"

jgrebholz avatar Aug 11 '22 06:08 jgrebholz

I'm confused about why the linter is failing. There are updates to READMEs in this change.

TheRealAmazonKendra avatar Aug 11 '22 15:08 TheRealAmazonKendra

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

mergify[bot] avatar Aug 12 '22 14:08 mergify[bot]

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

mergify[bot] avatar Aug 12 '22 14:08 mergify[bot]

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0f827985079c132bf73f4d1acc3811adee8b0af2
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

aws-cdk-automation avatar Aug 12 '22 15:08 aws-cdk-automation

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

mergify[bot] avatar Aug 12 '22 15:08 mergify[bot]