You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//^-- NOTE: AWS tag restrictions vary by service, but generally only letters, numbers, spaces, and the following characters are allowed: + - = . _ : / @
15
+
// Tags are validated by the validateTag() function in lib/Utilities.ts before deployment
//^-- NOTE: AWS tag restrictions vary by service, but generally only letters, numbers, spaces, and the following characters are allowed: + - = . _ : / @
8
+
// Tags are validated by the validateTag() function in lib/Utilities.ts before deployment
throw"Error validating tags. See details above"// Using throw here to stop the checks; otherwise an error will print out for every place this tag would be applied, and the process will continue
throw"Error validating tags. See details above"// Using throw here to stop the checks; otherwise an error will print out for every place this tag would be applied, and the process will continue
constallowedChars="^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$";// https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Tag.html; also using cfn-lint as a baseline
10
+
// The set of allowed characters varies by service, from basically any character to a strict set of English alphanumeric characters and a few symbols
11
+
constallowedCharsText="The string can only contain Unicode letters, digits, whitespace, and the characters _.:/=+\-@";
12
+
constallowedRegex=newRegExp(allowedChars,"mu");
13
+
14
+
if(!allowedRegex.test(key)){
15
+
thrownewInvalidInputError(`Invalid tag key: "${key}". ${allowedCharsText}`)
16
+
}elseif(key.toLowerCase().startsWith("aws:")){
17
+
thrownewInvalidInputError(`Invalid tag key "${key}". Tag keys cannot start with "aws:".`)
18
+
}elseif(!allowedRegex.test(value)){
19
+
thrownewInvalidInputError(`Invalid tag value: "${value}". ${allowedCharsText}`)
0 commit comments