Replacing number value in template #1187
-
Hey Hairyhenderson, I really like your tool. Thanks for sharing this. I have an AWS ECS task definition which I template using gomplate. String replacement works fine, but I am having issues to find a solution to replace numbers in my .json file (e.g. the CPU size). Considering the following JSON file where AWS_ECS_TASK_CPU is a number.
How do I replace the CPU value in the JSON? I tried the following approach. But it says that replaceAll needs a String. I checked the documentation but did not find any proper solution.
Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@Tobi0322 It looks like you're trying to use the datasource as a template. Is there a reason not to simply make it the template? Something like:
If that doesn't make sense, maybe you could provide more context (the full command, as well as all datasources)... |
Beta Was this translation helpful? Give feedback.
@Tobi0322 It looks like you're trying to use the datasource as a template. Is there a reason not to simply make it the template?
Something like:
If that doesn't make sense, maybe you could provide more context (the full command, as well as all datasources)...