Skip to content

Commit

Permalink
Fix flaky test TestAccKmsAliasTs
Browse files Browse the repository at this point in the history
The test is creating a KMS key alias with a static name. When multiple
instances of this test are running in the same AWS account and region they'll race
and occasionally fail because the alias already exists.

This changes the key alias to use a name prefix to guarantee uniqueness.
  • Loading branch information
flostadler committed Apr 15, 2024
1 parent 8f74c96 commit 28d6e36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/kms-alias/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const aliasAutoPrefixedWithAlias = new aws.kms.Alias("should-be-prefixed", {targ

const aliasWithDedicatedName = new aws.kms.Alias("wont-be-autonamed", {
targetKeyId: key.keyId,
name: "alias/my-decicated-name"
namePrefix: "alias/my-decicated-name-"
}, providerOpts);

export const autonamedAlias = aliasAutoPrefixedWithAlias.name;
Expand Down

0 comments on commit 28d6e36

Please sign in to comment.