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

cli: Availability zones in cdk.context.json

Open cmckni3 opened this issue 6 years ago • 3 comments

In my opinion, Availability Zones in cdk.context.json should not include the account number. Availability Zones are region specific, not account specific.

Kind of related to #6929.

Reproduction Steps

Example cdk.context.json after deploying a stack that uses/creates VPCs.

{
  "availability-zones:account=<AccountId>:region=us-east-1": [
    "us-east-1a",
    "us-east-1b",
    "us-east-1c",
    "us-east-1d",
    "us-east-1e",
    "us-east-1f"
  ]
}

Error Log

N/A

Environment

  • CLI Version : 1.31.0
  • Framework Version: 1.31.0
  • OS : macOS
  • Language : TypeScript

Other


This is :bug: Bug Report

cmckni3 avatar Apr 03 '20 20:04 cmckni3

Availability Zone Names are account specific, surprisingly.

Pre...2018~ish (maybe earlier), they were shuffled where if you had a datacenter in iad , it could be mapped to us-east-1b in one account and us-east-1a in another account. When making cross-account VPC Peering that align with the datacenter (gotta get that low latency!) this is very important to map correctly on an account level, which may require sorting these based on the shuffled values.

Availability Zone Ids are not account specific, but Cloudformation does not yet support referencing by those.

iph avatar Apr 06 '20 18:04 iph

@iph Interesting and makes sense.

I did some searching and found the explanation in the docs as well.

cmckni3 avatar Apr 06 '20 18:04 cmckni3

Thanks @iph for that jam! Im sure this issue, although closed will develop a life of it's own in the internet :)

NetaNir avatar Apr 07 '20 07:04 NetaNir