From 3a5723f76fb7f6781f242adb6c85bf13fbf3df20 Mon Sep 17 00:00:00 2001 From: larry kirschner Date: Mon, 1 Feb 2021 17:46:19 -0800 Subject: [PATCH] auto solution stack (#3) --- main.tf | 9 ++++++--- vars.tf | 6 ------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/main.tf b/main.tf index 6ec9977..ff6b474 100644 --- a/main.tf +++ b/main.tf @@ -42,6 +42,11 @@ module "elastic_beanstalk_application" { data "aws_elastic_beanstalk_hosted_zone" "current" {} +data "aws_elastic_beanstalk_solution_stack" "multi_docker" { + most_recent = true + name_regex = "^64bit Amazon Linux (.*) Multi-container Docker (.*)$" +} + module "elastic_beanstalk_environment" { source = "git::https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment.git?ref=tags/0.34.0" namespace = var.eb_env_namespace @@ -107,11 +112,9 @@ module "elastic_beanstalk_environment" { healthcheck_url = var.eb_env_healthcheck_url application_port = var.eb_env_application_port - // https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html // https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html#platforms-supported.docker - solution_stack_name = var.eb_env_solution_stack_name - + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.multi_docker.name additional_settings = var.eb_env_additional_settings env_vars = merge( var.eb_env_env_vars, diff --git a/vars.tf b/vars.tf index 7dc1eda..ebe5ec9 100644 --- a/vars.tf +++ b/vars.tf @@ -218,12 +218,6 @@ variable "eb_env_root_volume_type" { default = "gp2" } -variable "eb_env_solution_stack_name" { - type = string - description = "Elastic Beanstalk stack, e.g. Docker, Go, Node, Java, IIS. For more info, see https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html" - default = "64bit Amazon Linux 2018.03 v2.25.0 running Multi-container Docker 19.03.13-ce (Generic)" -} - variable "eb_env_stage" { type = string description = "Stage, e.g. 'prod', 'staging', 'dev', or 'test'"