We need to tag our AWS lambdas and resources with standard tags for billing.
I want to define a common set of tags that applies application-wide, then for each lambda and resource, set a specific “Name” tag.
I can define the common list like:
custom:
common_tags:
Application: "OCREVA"
cloud_env: "govcloud"
op_env: dev
customer: EVA
And I can apply it successfully to my Lambda like:
functions:
my_lambda:
handler: my_lambda.s3created
tags: ${self:custom.custom_tags}
In my Lambda spec I want to base the AWS tags on the common_tags and add a unique Name tag. I tried this:
functions:
my_lambda:
handler: my_lambda.s3created
tags:
<<: ${self:custom.common_tags}
Name: UNIQUE NAME FOR LAMBDA
But it fails:
Y A M L Exception --------------------------------------
cannot merge mappings; the provided source object is unacceptable in
"PATHTO/serverless.yml" at line 158, column 40:
... <: ${self:custom.custom_tags}
Am I mangling the YAML merge syntax or is there no way to do this?
Thanks!