aws-cdk
aws-cdk copied to clipboard
fix (elbv2): Use correct format for parsing imported target group ARNs
Currently, the following CDK snippet results in outputting the target group ID, not the target group name.
const importedTgArn = cdk.Fn.importValue('ImportTargetGroupArn');
const importedTg = elbv2.ApplicationTargetGroup.fromTargetGroupAttributes(stack, 'ImportedTg', {
targetGroupArn: importedTgArn,
});
new cdk.CfnOutput(stack, 'TargetGroupOutput', {
value: importedTg.targetGroupName,
});
For example, for a sample target group ARN:
arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/MyTargetGroupName/6a58f7d61e2151d4
The stack above will output 6a58f7d61e2151d4 instead of the desired MyTargetGroupName.
This change fixes the ARN format used for parsing the imported ARN value. It does not impact any existing CDK code passing a raw ARN string (as confirmed by existing unit tests), only CDK code trying to pass tokens such as import values.
All Submissions:
- [x] Have you followed the guidelines in our Contributing guide?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
FYI - Ignore the PR Linter right now.
@Mergifyio update
update
✅ Branch has been successfully updated
@Mergifyio update
update
✅ Branch has been successfully updated
@Mergifyio update
update
✅ Branch has been successfully updated
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).
AWS CodeBuild CI Report
- CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
- Commit ID: d1442ffb5be33ce5125845ec2cd9d36e73f2796e
- Result: SUCCEEDED
- Build Logs (available for 30 days)
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
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).