【发布时间】:2022-01-23 00:09:42
【问题描述】:
我正在尝试通过 terrafom 为 aws 添加 SSM 参数值,但 terrafom 考虑使用 %{ 来定义条件并给出以下错误。
错误:- 无效的模板指令;模板指令关键字(“if”、“for”等)应位于 %!{(MISSING) 序列的开头。
但我需要将其作为我的 SSM 参数值的字符串,以便我的容器调用它们的变量。
那是我的terragrunt.hcl。有人可以帮我吗?
# ONLY FOR THIS DEPLOYMENT!
inputs = {
parameter_write = [
{
name = "/teamname/${local.common_vars.dns}/index"
value = "dev-ws-${local.common_vars.name}-%{+YYYY.MM.dd}"
type = "String"
overwrite = "false"
description = "Index"
}
]
}
【问题讨论】:
-
能否提供完整的TF代码和模板示例?
-
请使用格式正确的代码块编辑问题。
-
@Marcin - 添加了它的片段
-
请不要对代码使用屏幕截图。请read instructions如何在SO上使用代码块。
-
您可以同时使用两个功能。使用 terraform terraform.io/language/functions/timestamp 和 terraform.io/language/functions/formatdate 的
timestamp+formatdate
标签: python string terraform devops terragrunt