I'm trying to add tags to a AWS::EKS::Nodegroup resource that contain an output exported by another stack:
Resources:
Nodegroup:
Type: AWS::EKS::Nodegroup
Properties:
Tags:
firstKey: firstValue
!Sub myString-${Fn::ImportValue: myExport}: secondValue
But I'm getting validation errors because the function's colon is being interpreted as the key/value separator: Nested mappings are not allowed in compact mappings
Quoting as suggested here does not help since the intrinsic function is then seen as a string and not executed.
I tried this form as suggested in the documentation:
Tags: !Sub
- 'myString-${myExport}: secondValue'
- myExport: !ImportValue myExport
But apart from getting a string instead of a needed object, I wouldn't know how to add more than one tag.
Is there a way to achieve what I need?
This will not work because this is an array while the AWS::EKS::Nodegroup template wants an object of key-value pairs. Furthermore quoting intrinsic functions does not work.