diff --git a/README.md b/README.md index 74a3852..0c3de6d 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ The following resources will be created: | alarm\_alb\_latency\_anomaly\_threshold | ALB Latency anomaly detection width (use 0 to disable this alarm) | `number` | `4` | no | | alarm\_asg\_high\_cpu\_threshold | Max threshold average CPU percentage allowed in a 2 minutes interval (use 0 to disable this alarm) | `number` | `80` | no | | alarm\_sns\_topics | Alarm topics to create and alert on ECS service metrics. Leaving empty disables all alarms. | `list` | `[]` | no | +| ami\_id | ElasticBeanstalk custom AMI ID | `string` | `""` | no | | application\_port | Port application is listening on | `number` | `80` | no | | application\_subnets | List of subnets to place EC2 instances | `list(string)` | n/a | yes | | asg\_max | Max number of instances for autoscaling group | `number` | `4` | no | diff --git a/_variables.tf b/_variables.tf index 2816222..a457785 100644 --- a/_variables.tf +++ b/_variables.tf @@ -606,3 +606,11 @@ variable "solutions_stack_name_regex" { default = "" description = "Regex string to apply to the solution stack list returned by AWS" } + + +variable "ami_id" { + type = string + default = "" + description = "ElasticBeanstalk custom AMI ID" +} + diff --git a/eb.tf b/eb.tf index 441580e..b5de528 100644 --- a/eb.tf +++ b/eb.tf @@ -408,6 +408,11 @@ locals { ] eb_launch_config = [ + { + name = "ImageId" + namespace = "aws:autoscaling:launchconfiguration" + value = var.ami_id + }, { name = "InstanceType" namespace = "aws:autoscaling:launchconfiguration"