Terraform-从AWS应用程序配置参数获取一个值,然后传递到资源
如何在Terraform脚本中以JSON格式以JSON格式获取AWS配置参数。我想在另一个资源中使用这些参数。 我只想将脚本中的所有变量参数外部化。
例如:我们有数据来源:AWS_SSM_PARAMETER获取AWS SSM参数。
'''
data "aws_ssm_parameter" "foo" {
name = "foo"
}
''
同样,我们如何在Terraform脚本中获得AWS应用程序配置。
How to get aws configuration parameters stored in json format on S3 in terraform scripts. I want to use those parameters in another resources.
I just want to externalise all the variable parameters in the script.
e.g: we have Data Source: aws_ssm_parameter to get AWS ssm parameters.
'''
data "aws_ssm_parameter" "foo" {
name = "foo"
}
'''
Similarly how can we get aws app configurations in terraform scripts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从我的理解来看,您需要读取S3对象的值并将其用于Terraform。
使用的
数据
因为它是我们引用的外部资源。我会这样使用:
要解析JSON您可以使用
JSondecode
From my understanding you need to read S3 objects' value's and use it in terraform.
Used
data
because it's external resource that we're referencing.I would use like this:
To parse JSON you can use
jsondecode