Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(kms): prefer new
aliasArn
to keyArn
for getting arn of an a…
…lias (#28197) **Motivation:** The current implementation of `keyArn` within the AWS CDK AWS KMS module returns the Key ARN for a key and an alias, which causes confusion for users expecting the Alias ARN. This PR aims to alleviate this confusion by providing clearer access to the Alias ARN. **Changes:** Introducing a new attribute `aliasArn` that mirrors the value from `keyArn` specifically for aliases to explicitly retrieve the Alias ARN. ```typescript /** * The ARN of the alias. * * @Attribute * @deprecated use `aliasArn` instead */ public get keyArn(): string { return Stack.of(this).formatArn({ service: 'kms', // aliasName already contains the '/' resource: this.aliasName, }); } /** * The ARN of the alias. * * @Attribute */ public get aliasArn(): string { return this.keyArn; } ``` **Query:** Should we deprecate the existing `keyArn` and mirror it in `aliasArn` or change the logic within `keyArn` to `aliasArn` and use the `keyArn` as the mirror? > Your feedback on the preferred approach would be greatly appreciated! Closes #28105. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information