-
Notifications
You must be signed in to change notification settings - Fork 4.1k
aws_Route53: (HostedZone.add_vpc set incorrect region) #20496
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
Comments
The problem seems to be here: https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-route53/lib/hosted-zone.ts#L179 public addVpc(vpc: ec2.IVpc) { It seems that IVpc derives from IResource which has an env member of type ResourceEnvironment which has a region field. Should it be?
Of course that assumes that the resource provider plugin correctly sets the region. |
You're right @cartalla - this should indeed be the region of the So that this doesn't break existing users - we could set the region to be the region set on the Vpc if defined, and otherwise set the region based on the stack of the Vpc. Will have to document that we recommend setting the region on the Vpc when using this method |
This is required for now because of a CDK bug: aws/aws-cdk#20496 The PR for the above bug is: aws/aws-cdk#20530 Fix use of existing hosted zone.
This is required for now because of a CDK bug: aws/aws-cdk#20496 The PR for the above bug is: aws/aws-cdk#20530 Fix use of existing hosted zone.
This is required for now because of a CDK bug: aws/aws-cdk#20496 The PR for the above bug is: aws/aws-cdk#20530 Fix use of existing hosted zone.
Add Regions and AZs to the InstanceConfig The code has been updated support multiple regions. The instance types that are available and the pricing varies by region so all instance type info must be maintained by region. Spot pricing additionally varies by instance type and by AZ and this commit adds an updated EC2InstanceTypeInfoPkg package that looks up the spot pricing for each instance type in each AZ and region. The Region/AZ configuration is added to the InstanceConfig section of the config file. The region requires the VpcId, CIDR, and SshKeyPair. The AZ requires the subnet ID and priority. The slurm node configuration has been updated to add the AZ id to all compute nodes and add the AZ name to all partitions. Users can specify multiple partitions with sbatch if they want jobs to be spread across multiple AZs. The modulefile has been updated to set the partition to the list of all regional/az partitions so that all nodes are available to the jobs in the priority configured in the config file. Create compute node security groups for other regions using a custom resource. Save regional security group ids in ssm parameter store. Update multi-region route53 hosted zone Fix IAM permissions to handle multiple regions Decode iam permissions messsages Update security groups with remote region cidrs Create slurmfs ARecord for use in other regions. This required adding a lambda to do DNS lookups. Add custom resource to add regional VPCs to the Route53 hosted zone. This is required for now because of a CDK bug: aws/aws-cdk#20496 The PR for the above bug is: aws/aws-cdk#20530 Update github-pages to use mkdocs Add github-docs target to Makefile Update to cdk@2.28.1 Create AZ and interactive partitions, set default partitions Resolves [FEATURE #22: Support mutiple availability zones and regions](#2)
* Add multi-AZ and multi-region support Add Regions and AZs to the InstanceConfig The code has been updated support multiple regions. The instance types that are available and the pricing varies by region so all instance type info must be maintained by region. Spot pricing additionally varies by instance type and by AZ and this commit adds an updated EC2InstanceTypeInfoPkg package that looks up the spot pricing for each instance type in each AZ and region. The Region/AZ configuration is added to the InstanceConfig section of the config file. The region requires the VpcId, CIDR, and SshKeyPair. The AZ requires the subnet ID and priority. The slurm node configuration has been updated to add the AZ id to all compute nodes and add the AZ name to all partitions. Users can specify multiple partitions with sbatch if they want jobs to be spread across multiple AZs. The modulefile has been updated to set the partition to the list of all regional/az partitions so that all nodes are available to the jobs in the priority configured in the config file. Create compute node security groups for other regions using a custom resource. Save regional security group ids in ssm parameter store. Update multi-region route53 hosted zone Fix IAM permissions to handle multiple regions Decode iam permissions messsages Update security groups with remote region cidrs Create slurmfs ARecord for use in other regions. This required adding a lambda to do DNS lookups. Add custom resource to add regional VPCs to the Route53 hosted zone. This is required for now because of a CDK bug: aws/aws-cdk#20496 The PR for the above bug is: aws/aws-cdk#20530 Update github-pages to use mkdocs Add github-docs target to Makefile Update to cdk@2.28.1 Create AZ and interactive partitions, set default partitions Resolves [FEATURE #22: Support mutiple availability zones and regions](#2) * Review fixes
Fixes #20496 This PR implements the proposed change in #20496 - When a region is set in the vpc it is used in the CloudFormation template. Otherwise the region from the respective stack is used. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*
|
…20530) Fixes aws#20496 This PR implements the proposed change in aws#20496 - When a region is set in the vpc it is used in the CloudFormation template. Otherwise the region from the respective stack is used. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*
This is still broken in 2.44.0 (Python). Our workaround was to use CfnHostedZone (instead of HostedZone), per the following (in a us-east-1 & us-east-2 vpc association). CfnHostedZone(
self,
"id goes here",
name = "domain name goes here",
vpcs = [
CfnHostedZone.VPCProperty(vpc_id="us-east-1 VPC ID goes here", vpc_region = "us-east-1"),
CfnHostedZone.VPCProperty(vpc_id="us-east-2 VPC ID goes here", vpc_region = "us-east-2")
]
) |
This is still a problem in 2.121.1 (python). |
Describe the bug
route53.HostZone.add_vpc sets regions for the stack's regions, not the VPC's region.
Expected Behavior
The regions for the VPCs should be correct.
Current Behavior
The resulting CFN template has the correct VpcIds, but the incorrect regions:
Reproduction Steps
I'm creating a Route53.HostedZone for use in 3 VPCs that are located in 3 different regions.
The VPCs aren't part of the stack and are created in CDK using
This causes an update to cdk.context.json where the VPC ids and regions are correct.
Extract from cdk.context.json:
I create the Hosted Zone:
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.25.0
Framework Version
No response
Node.js Version
16.15.0
OS
AmazonLinux2
Language
Python
Language Version
Python 3.7.10
Other information
No response
The text was updated successfully, but these errors were encountered: