【发布时间】:2021-05-28 17:49:42
【问题描述】:
使用带有模块 aws_apprunner_service 的 Terraform 我正在创建 AWS App Runner 服务。 According to documentation 我应该可以将环境变量作为映射传递。
在我的情况下,服务创建得很好,但没有任何runtime_environment_variables 被传递给 App Runner。 AWS 提供的所有其他变量都存在。
App Runner 没有用于 env 变量的面板,所以我列出了所有可用的使用 NodeJS 和控制台日志console.log(process.env)
从 AWS 控制台创建 App Runner 并添加变量可以正常工作,我可以看到所有默认变量以及我的自定义变量。
我的模块配置
resource "aws_apprunner_service" "apprunner" {
service_name = var.name
source_configuration {
authentication_configuration {
access_role_arn = var.role_arn
}
image_repository {
image_configuration {
port = var.port
runtime_environment_variables = {
"test" = "xxx"
}
}
image_identifier = var.image
image_repository_type = var.repository_type
}
}
}
【问题讨论】:
标签: amazon-web-services terraform terraform-provider-aws amazon-app-runner