Skip to content

Commit

Permalink
secrets/awskms: update the example for the AWS ARN use case (#3320)
Browse files Browse the repository at this point in the history
  • Loading branch information
h27771420 authored Oct 11, 2023
1 parent 486d484 commit 4a18be0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/website/data/examples.json

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

5 changes: 3 additions & 2 deletions secrets/awskms/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ func Example_openFromURL() {
}
defer keeperByAlias.Close()

// 3. By ARN.
// 3. By ARN. Note that ARN may contain ":" characters, which cannot be escaped
// in the Host part of a URL, so the "awskms:///<ARN>" form should be used.
const arn = "arn:aws:kms:us-east-1:111122223333:key/" +
"1234abcd-12ab-34bc-56ef-1234567890ab"
keeperByARN, err := secrets.OpenKeeper(ctx,
"awskms://"+arn+"?region=us-east-1")
"awskms:///"+arn+"?region=us-east-1")
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 4a18be0

Please sign in to comment.