Skip to content

Commit

Permalink
Stabilizing integ test for record set weight from param
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaschiasson committed Oct 27, 2024
1 parent e20b3bb commit 0b850c4
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 45 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Name": "cdk.dev."
}
},
"RecordWeightedFromCfnParameter0FB5DFC65": {
"RecordWithParamWeight01950FDF7": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneId": {
Expand All @@ -24,7 +24,7 @@
{
"Ref": "RecordWeight0"
},
"_ID_recordweigParameter04970FE98"
"_ID_recordweightParamWeight059BCC4E1"
]
]
},
Expand All @@ -35,7 +35,7 @@
}
}
},
"RecordWeightedFromCfnParameter11D8E5896": {
"RecordWithParamWeight182FF0BDE": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneId": {
Expand All @@ -53,7 +53,7 @@
{
"Ref": "RecordWeight1"
},
"_ID_recordweigParameter1EB51A657"
"_ID_recordweightParamWeight1304B1475"
]
]
},
Expand All @@ -64,7 +64,7 @@
}
}
},
"RecordWeightedFromCfnParameter2B12A1DFB": {
"RecordWithParamWeight2C5120D0E": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneId": {
Expand All @@ -82,7 +82,7 @@
{
"Ref": "RecordWeight2"
},
"_ID_recordweigParameter208409FED"
"_ID_recordweightParamWeight25B9D18F1"
]
]
},
Expand All @@ -93,7 +93,7 @@
}
}
},
"RecordWeightedFromCfnParameter3D5E67423": {
"RecordWithParamWeight37D431545": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneId": {
Expand All @@ -111,7 +111,7 @@
{
"Ref": "RecordWeight3"
},
"_ID_recordweigParameter3841525F4"
"_ID_recordweightParamWeight37DA83B23"
]
]
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TestStack extends Stack {
{ target: '3.4.5.6', weight: new CfnParameter(this, 'RecordWeight2', weightParameterProps) },
{ target: '4.5.6.7', weight: new CfnParameter(this, 'RecordWeight3', weightParameterProps) },
].forEach((data, index) => {
new route53.ARecord(this, `RecordWeightedFromCfnParameter${index}`, {
new route53.ARecord(this, `RecordWithParamWeight${index}`, {
zone: hostedZone,
recordName: 'www',
weight: data.weight.valueAsNumber,
Expand Down
5 changes: 4 additions & 1 deletion packages/aws-cdk-lib/aws-route53/lib/record-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,10 @@ export class RecordSet extends Resource implements IRecordSet {
}

if (this.weight !== undefined) {
const idPrefix = `WEIGHT_${this.weight}_ID_`;
const idPrefix = `WEIGHT_${Token.isUnresolved(this.weight)
? Token.asString(this.weight)
: this.weight
}_ID_`;
return this.createIdentifier(idPrefix);
}

Expand Down

0 comments on commit 0b850c4

Please sign in to comment.