-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable tags for Lambda functions #13352
Conversation
Key: name, | ||
Value: val, | ||
} | ||
tags = append(tags, tag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add validation on the tags see.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html
Looking at the documentation there are limit on lenght and they cannot start with aws:
Key
The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.
Required: Yes
Type: String
Value
The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.
Required: Yes
Type: String
if strings.HasPrefix(key, "aws:") { | ||
return fmt.Errorf("key '%s' cannot be prefixed with 'aws:'", key) | ||
} | ||
if strings.HasPrefix(val, "aws:") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "aws:" is only a limitation for keys not the values.
Limitation for the value is 255 not 127 (127 is only for the key) as mentioned in the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"aws:" is limitation for both key and value. But you are right about the lenghts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah crap you are right about the value, weird, things, I guess they scan the whole structure to make a decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Failing tests are unrelated. |
New option is added to configure tags for functions named
tags
. It expects key-value pairs.Closes #13080