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
I am setting up an MemoryDB cluster and a ECSFargate service. The service should access the MemoryDB. I therefore try to populate the ClusterEndpointAddress and ClusterEndpointPort as ENV variables in the ContainerDefinition of the service.
If I do this:
which doesn't work at deployment, because the port is retrieved as a number: #/ContainerDefinitions/0/Environment/0/Value: expected type: String, found: Integer
Template error: every Fn::Join object requires two parameters,
(1) a string delimiter and
(2) a list of strings to be joined or a function that returns a list of strings (such as Fn::GetAZs) to be joined.
Which is in my opinion erroneous, because there both parameters are present.
This also happens when I try to concat the string:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am setting up an MemoryDB cluster and a ECSFargate service. The service should access the MemoryDB. I therefore try to populate the ClusterEndpointAddress and ClusterEndpointPort as ENV variables in the ContainerDefinition of the service.
If I do this:
CDK creates a CF template:
which doesn't work at deployment, because the port is retrieved as a number:
#/ContainerDefinitions/0/Environment/0/Value: expected type: String, found: Integer
If I try to use a template string:
CDK produces a CF template like:
This fails with the error message:
Which is in my opinion erroneous, because there both parameters are present.
This also happens when I try to concat the string:
Update:
If I use a literal
it produces a correct template:
Trying to use this "trick" with the CfnAttributes
leads to the same template as if I used the attribute directly.
Does anybody have an idea how I can pass a numeric value from CfnAttributes as ENV vars in a ContainerDefinition?
Beta Was this translation helpful? Give feedback.
All reactions