【发布时间】:2021-06-20 10:45:00
【问题描述】:
所以我最近开始使用 terraform 和 aws,但我找不到解决问题的方法。我想将 python 脚本文件上传到 AWS 中的存储桶,一切都很好。我正在使用 terraform 提供的这段代码:
resource "aws_s3_bucket_object" "object" {
bucket = "your_bucket_name"
key = "new_object_key"
source = "path/to/file"
# The filemd5() function is available in Terraform 0.11.12 and later
# For Terraform 0.11.11 and earlier, use the md5() function and the file() function:
# etag = "${md5(file("path/to/file"))}"
etag = filemd5("path/to/file")
}
但我的问题是我的脚本中有一些值,我想使用环境变量而不是直接值。我知道它可以用于 lambda 函数资源,但是存储桶文件上传呢?我该怎么做?
【问题讨论】:
标签: python amazon-s3 terraform