-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #922 from aws-quickstart/bug/import-cluster-provid…
…er-token-failure Fixes #916
- Loading branch information
Showing
3 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Token } from 'aws-cdk-lib'; | ||
import { v4 as uuid } from 'uuid'; | ||
|
||
/** | ||
* Generates a globally unique identifier. | ||
* @returns string representation of a GUID | ||
*/ | ||
export function uniqueId() : string { | ||
return uuid(); | ||
} | ||
|
||
/** | ||
* Tests the input to see if it is a token (unresolved token representation of a reference in CDK, e.g. ${TOKEN[Bucket.Name.1234]}) | ||
* @param input string containing the string identifier | ||
* @returns true if the passed input is a token | ||
*/ | ||
export function isToken(input: string) : boolean { | ||
return Token.isUnresolved(input); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters