我在 elastic beanstalk terraform 文档中找不到启动模板的选项。有没有办法使用
答案1
您向资源添加配置设置aws_elastic_beanstalk_environment
,类似于此示例
setting {
namespace = "aws:autoscaling:launchconfiguration"
name = "IamInstanceProfile"
value = aws_iam_instance_profile.example.name
}
更新 关于模板,您可能需要一系列的资源。
resource "aws_launch_template" "example" {
#...
}
resource "aws_autoscaling_group" "example" {
#...
launch_template {
id = "${aws_launch_template.example.id}"
version = "$Latest"
}
}
resource "aws_elastic_beanstalk_environment" "example" {
#...
autoscaling_groups = ["${aws_autoscaling_group.example.id}"]
}