0

I have a terraform script which creates a multi container docker beanstalk application. I am using value

most_recent = true, But still it is picking up Amazon linux 1. Ideally its should pick latest Amazon linux 2 image.

data "aws_elastic_beanstalk_solution_stack" "multi_docker" {
  most_recent = true

  name_regex = "^64bit Amazon Linux (.*) Multi-container Docker (.*)$"
}
resource "aws_elastic_beanstalk_environment" "environment" {
  name = var.env
  application = "helloworld"
  solution_stack_name = "${data.aws_elastic_beanstalk_solution_stack.multi_docker.id}"
  version_label       = "${aws_elastic_beanstalk_application_version.default.name}"
  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name = "IamInstanceProfile"
    value = "aws-elasticbeanstalk-ec2-role"
  }
markwalker_
  • 12,078
  • 7
  • 62
  • 99
Jaishree Mishra
  • 545
  • 2
  • 5
  • 24
  • There isn't an Elastic Beanstalk stack that runs Amazon Linux 2 other than the two beta Corretto (Java) stacks. – ydaetskcoR Feb 05 '20 at 12:49
  • @ydaetskcoR Below url refer to version 2, or I am seeing something different? https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-docker-multi.html – Jaishree Mishra Feb 05 '20 at 13:06
  • Which platform there do you think is Amazon Linux 2? – ydaetskcoR Feb 05 '20 at 13:35
  • @ydaetskcoR 64bit Amazon Linux 2018.03 v2.18.0 running Multi-container Docker 18.09.9-ce (Generic) one, It do have v2 – Jaishree Mishra Feb 05 '20 at 14:01
  • 1
    That's Amazon Linux 1 still. Amazon Linux 2 looks like the ones mentioned in https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-beta.html as you can also see by running `aws elasticbeanstalk list-available-solution-stacks --query 'SolutionStacks'` – ydaetskcoR Feb 05 '20 at 15:33
  • @ydaetskcoR Yes you are right, I read some documentation and it says that beta release, So there is no other way hmm, I wanted to use systemd rather then upstat – Jaishree Mishra Feb 05 '20 at 17:01
  • @ydaetskcoR I have a requirement to upgrade Amazon-linux-2. But AWS documentation is still confusing. Can I upgrade to Amazon-Linux-2 using multi container. I have read this https://stackoverflow.com/questions/68988175/how-to-use-multi-container-docker-in-elastic-beanstalk-using-amazon-linux-2, But that needs a docker-compose file. – Jaishree Mishra Apr 07 '22 at 20:21
  • Value of command is null. sh-4.2$ aws elasticbeanstalk list-available-solution-stacks --region us-east-2 --query SolutionStacks [] – Jaishree Mishra Apr 07 '22 at 20:25

0 Answers0