Home

Awesome

<!-- markdownlint-disable -->

<a href="https://cpco.io/homepage"><img src="https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/blob/main/.github/banner.png?raw=true" alt="Project Banner"/></a><br/> <p align="right"> <a href="https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/releases/latest"><img src="https://img.shields.io/github/release/cloudposse/terraform-aws-elastic-beanstalk-environment.svg?style=for-the-badge" alt="Latest Release"/></a><a href="https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/commits"><img src="https://img.shields.io/github/last-commit/cloudposse/terraform-aws-elastic-beanstalk-environment.svg?style=for-the-badge" alt="Last Updated"/></a><a href="https://slack.cloudposse.com"><img src="https://slack.cloudposse.com/for-the-badge.svg" alt="Slack Community"/></a></p>

<!-- markdownlint-restore --> <!-- ** DO NOT EDIT THIS FILE ** ** This file was automatically generated by the `cloudposse/build-harness`. ** 1) Make all changes to `README.yaml` ** 2) Run `make init` (you only need to do this once) ** 3) Run`make readme` to rebuild this file. ** ** (We maintain HUNDREDS of open source projects. This is how we maintain our sanity.) ** -->

Terraform module to provision AWS Elastic Beanstalk environment

Searching for Maintainer!

The Cloud Posse team no longer utilizes Beanstalk all that much, but this module is still fairly popular. In an effort to give it the attention it deserves, we're searching for a volunteer maintainer to manage this specific repository's issues and pull requests (of which a number are already stacked up). This is a great opportunity for anyone who is looking to solidify and strengthen their Terraform skillset while also giving back to the SweetOps open source community!

You can learn more about being a SweetOps contributor on our docs site here.

If you're interested, reach out to us via the #terraform channel in the SweetOps Slack or directly via email @ hello@cloudposse.com

[!TIP]

πŸ‘½ Use Atmos with Terraform

Cloud Posse uses atmos to easily orchestrate multiple environments using Terraform. <br/> Works with Github Actions, Atlantis, or Spacelift.

<details> <summary><strong>Watch demo of using Atmos with Terraform</strong></summary> <img src="https://github.com/cloudposse/atmos/blob/master/docs/demo.gif?raw=true"/><br/> <i>Example of running <a href="https://atmos.tools"><code>atmos</code></a> to manage infrastructure from our <a href="https://atmos.tools/quick-start/">Quick Start</a> tutorial.</i> </detalis>

Usage

For a complete example, see examples/complete

  provider "aws" {
    region = var.region
  }
  
  module "vpc" {
    source = "cloudposse/vpc/aws"
    # Cloud Posse recommends pinning every module to a specific version
    version = "x.x.x"
    
    cidr_block = "172.16.0.0/16"

    context = module.this.context
  }
  
  module "subnets" {
    source = "cloudposse/dynamic-subnets/aws"
    # Cloud Posse recommends pinning every module to a specific version
    version = "x.x.x"
    
    availability_zones   = var.availability_zones
    vpc_id               = module.vpc.vpc_id
    igw_id               = module.vpc.igw_id
    cidr_block           = module.vpc.vpc_cidr_block
    nat_gateway_enabled  = true
    nat_instance_enabled = false
  
    context = module.this.context
  }
  
  module "elastic_beanstalk_application" {
    source = "cloudposse/elastic-beanstalk-application/aws"
    # Cloud Posse recommends pinning every module to a specific version
    version = "x.x.x"
    
    description = "Test Elastic Beanstalk application"
  
    context = module.this.context
  }
  
  module "elastic_beanstalk_environment" {
    source                     = "../../"
  
    description                = var.description
    region                     = var.region
    availability_zone_selector = var.availability_zone_selector
    dns_zone_id                = var.dns_zone_id
  
    wait_for_ready_timeout             = var.wait_for_ready_timeout
    elastic_beanstalk_application_name = module.elastic_beanstalk_application.elastic_beanstalk_application_name
    environment_type                   = var.environment_type
    loadbalancer_type                  = var.loadbalancer_type
    elb_scheme                         = var.elb_scheme
    tier                               = var.tier
    version_label                      = var.version_label
    force_destroy                      = var.force_destroy
  
    instance_type    = var.instance_type
    root_volume_size = var.root_volume_size
    root_volume_type = var.root_volume_type
  
    autoscale_min             = var.autoscale_min
    autoscale_max             = var.autoscale_max
    autoscale_measure_name    = var.autoscale_measure_name
    autoscale_statistic       = var.autoscale_statistic
    autoscale_unit            = var.autoscale_unit
    autoscale_lower_bound     = var.autoscale_lower_bound
    autoscale_lower_increment = var.autoscale_lower_increment
    autoscale_upper_bound     = var.autoscale_upper_bound
    autoscale_upper_increment = var.autoscale_upper_increment
  
    vpc_id               = module.vpc.vpc_id
    loadbalancer_subnets = module.subnets.public_subnet_ids
    application_subnets  = module.subnets.private_subnet_ids
  
    allow_all_egress = true

    additional_security_group_rules = [
      {
        type                     = "ingress"
        from_port                = 0
        to_port                  = 65535
        protocol                 = "-1"
        source_security_group_id = module.vpc.vpc_default_security_group_id
        description              = "Allow all inbound traffic from trusted Security Groups"
      }
    ]
  
    rolling_update_enabled  = var.rolling_update_enabled
    rolling_update_type     = var.rolling_update_type
    updating_min_in_service = var.updating_min_in_service
    updating_max_batch      = var.updating_max_batch
  
    healthcheck_url  = var.healthcheck_url
    application_port = var.application_port
  
    solution_stack_name = var.solution_stack_name    
    additional_settings = var.additional_settings
    env_vars            = var.env_vars
  
    extended_ec2_policy_document = data.aws_iam_policy_document.minimal_s3_permissions.json
    prefer_legacy_ssm_policy     = false
    prefer_legacy_service_policy = false
    scheduled_actions            = var.scheduled_actions
  
    context = module.this.context
  }
    
  data "aws_iam_policy_document" "minimal_s3_permissions" {
    statement {
      sid = "AllowS3OperationsOnElasticBeanstalkBuckets"
      actions = [
      "s3:ListAllMyBuckets",
      "s3:GetBucketLocation"
    ]
    resources = ["*"]
  }
}

[!IMPORTANT] In Cloud Posse's examples, we avoid pinning modules to specific versions to prevent discrepancies between the documentation and the latest released versions. However, for your own projects, we strongly advise pinning each module to the exact version you're using. This practice ensures the stability of your infrastructure. Additionally, we recommend implementing a systematic approach for updating versions to avoid unexpected changes.

<!-- markdownlint-disable -->

Makefile Targets

Available targets:

  help                                Help screen
  help/all                            Display help for all targets
  help/short                          This help short screen
  lint                                Lint terraform code

<!-- markdownlint-restore --> <!-- markdownlint-disable -->

Requirements

NameVersion
<a name="requirement_terraform"></a> terraform>= 1.3.0
<a name="requirement_aws"></a> aws>= 4.0
<a name="requirement_random"></a> random>= 3.5.1

Providers

NameVersion
<a name="provider_aws"></a> aws>= 4.0
<a name="provider_random"></a> random>= 3.5.1

Modules

NameSourceVersion
<a name="module_aws_security_group"></a> aws_security_groupcloudposse/security-group/aws1.0.1
<a name="module_dns_hostname"></a> dns_hostnamecloudposse/route53-cluster-hostname/aws0.12.2
<a name="module_elb_logs"></a> elb_logscloudposse/lb-s3-bucket/aws0.20.0
<a name="module_this"></a> thiscloudposse/label/null0.25.0

Resources

NameType
aws_elastic_beanstalk_environment.defaultresource
aws_iam_instance_profile.ec2resource
aws_iam_role.ec2resource
aws_iam_role.serviceresource
aws_iam_role_policy.defaultresource
aws_iam_role_policy_attachment.ecr_readonlyresource
aws_iam_role_policy_attachment.elastic_beanstalk_multi_container_dockerresource
aws_iam_role_policy_attachment.enhanced_healthresource
aws_iam_role_policy_attachment.serviceresource
aws_iam_role_policy_attachment.ssm_automationresource
aws_iam_role_policy_attachment.ssm_ec2resource
aws_iam_role_policy_attachment.web_tierresource
aws_iam_role_policy_attachment.worker_tierresource
aws_lb_listener_rule.redirect_http_to_httpsresource
aws_ssm_activation.ec2resource
random_string.elb_logs_suffixresource
aws_iam_policy_document.defaultdata source
aws_iam_policy_document.ec2data source
aws_iam_policy_document.extendeddata source
aws_iam_policy_document.servicedata source
aws_lb_listener.httpdata source
aws_partition.currentdata source

Inputs

NameDescriptionTypeDefaultRequired
<a name="input_additional_security_group_rules"></a> additional_security_group_rulesA list of Security Group rule objects to add to the created security group, in addition to the ones<br/>this module normally creates. (To suppress the module's rules, set create_security_group to false<br/>and supply your own security group via associated_security_group_ids.)<br/>The keys and values of the objects are fully compatible with the aws_security_group_rule resource, except<br/>for security_group_id which will be ignored, and the optional "key" which, if provided, must be unique and known at "plan" time.<br/>To get more info see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule .list(any)[]no
<a name="input_additional_settings"></a> additional_settingsAdditional Elastic Beanstalk setttings. For full list of options, see https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html<pre>list(object({<br/> namespace = string<br/> name = string<br/> value = string<br/> }))</pre>[]no
<a name="input_additional_tag_map"></a> additional_tag_mapAdditional key-value pairs to add to each map in tags_as_list_of_maps. Not added to tags or id.<br/>This is for some rare cases where resources want additional configuration of tags<br/>and therefore take a list of maps with tag key, value, and additional configuration.map(string){}no
<a name="input_alb_zone_id"></a> alb_zone_idALB zone idmap(string)<pre>{<br/> "af-south-1": "Z1EI3BVKMKK4AM",<br/> "ap-east-1": "ZPWYUBWRU171A",<br/> "ap-northeast-1": "Z1R25G3KIG2GBW",<br/> "ap-northeast-2": "Z3JE5OI70TWKCP",<br/> "ap-south-1": "Z18NTBI3Y7N9TZ",<br/> "ap-southeast-1": "Z16FZ9L249IFLT",<br/> "ap-southeast-2": "Z2PCDNR3VC2G1N",<br/> "ca-central-1": "ZJFCZL7SSZB5I",<br/> "eu-central-1": "Z1FRNW7UH4DEZJ",<br/> "eu-north-1": "Z23GO28BZ5AETM",<br/> "eu-south-1": "Z10VDYYOA2JFKM",<br/> "eu-west-1": "Z2NYPWQ7DFZAZH",<br/> "eu-west-2": "Z1GKAAAUGATPF1",<br/> "eu-west-3": "Z3Q77PNBQS71R4",<br/> "me-south-1": "Z2BBTEKR2I36N2",<br/> "sa-east-1": "Z10X7K2B4QSOFV",<br/> "us-east-1": "Z117KPS5GTRQ2G",<br/> "us-east-2": "Z14LCN19Q5QHIC",<br/> "us-gov-east-1": "Z2NIFVYYW2VKV1",<br/> "us-gov-west-1": "Z31GFT0UA1I2HV",<br/> "us-west-1": "Z1LQECGX5PH1X",<br/> "us-west-2": "Z38NKT9BP95V3O"<br/>}</pre>no
<a name="input_allow_all_egress"></a> allow_all_egressIf true, the created security group will allow egress on all ports and protocols to all IP addresses.<br/>If this is false and no egress rules are otherwise specified, then no egress will be allowed.booltrueno
<a name="input_ami_id"></a> ami_idThe id of the AMI to associate with the Amazon EC2 instancesstringnullno
<a name="input_application_port"></a> application_portPort application is listening onnumber80no
<a name="input_application_subnets"></a> application_subnetsList of subnets to place EC2 instanceslist(string)n/ayes
<a name="input_associate_public_ip_address"></a> associate_public_ip_addressWhether to associate public IP addresses to the instancesboolfalseno
<a name="input_associated_security_group_ids"></a> associated_security_group_idsA list of IDs of Security Groups to associate the created resource with, in addition to the created security group.<br/>These security groups will not be modified and, if create_security_group is false, must have rules providing the desired access.list(string)[]no
<a name="input_attributes"></a> attributesID element. Additional attributes (e.g. workers or cluster) to add to id,<br/>in the order they appear in the list. New attributes are appended to the<br/>end of the list. The elements of the list are joined by the delimiter<br/>and treated as a single ID element.list(string)[]no
<a name="input_autoscale_lower_bound"></a> autoscale_lower_boundMinimum level of autoscale metric to remove an instancenumber20no
<a name="input_autoscale_lower_increment"></a> autoscale_lower_incrementHow many Amazon EC2 instances to remove when performing a scaling activity.number-1no
<a name="input_autoscale_max"></a> autoscale_maxMaximum instances to launchnumber3no
<a name="input_autoscale_measure_name"></a> autoscale_measure_nameMetric used for your Auto Scaling triggerstring"CPUUtilization"no
<a name="input_autoscale_min"></a> autoscale_minMinumum instances to launchnumber2no
<a name="input_autoscale_statistic"></a> autoscale_statisticStatistic the trigger should use, such as Averagestring"Average"no
<a name="input_autoscale_unit"></a> autoscale_unitUnit for the trigger measurement, such as Bytesstring"Percent"no
<a name="input_autoscale_upper_bound"></a> autoscale_upper_boundMaximum level of autoscale metric to add an instancenumber80no
<a name="input_autoscale_upper_increment"></a> autoscale_upper_incrementHow many Amazon EC2 instances to add when performing a scaling activitynumber1no
<a name="input_availability_zone_selector"></a> availability_zone_selectorAvailability Zone selectorstring"Any 2"no
<a name="input_context"></a> contextSingle object for setting entire context at once.<br/>See description of individual variables for details.<br/>Leave string and numeric variables as null to use default value.<br/>Individual variable settings (non-null) override settings in context object,<br/>except for attributes, tags, and additional_tag_map, which are merged.any<pre>{<br/> "additional_tag_map": {},<br/> "attributes": [],<br/> "delimiter": null,<br/> "descriptor_formats": {},<br/> "enabled": true,<br/> "environment": null,<br/> "id_length_limit": null,<br/> "label_key_case": null,<br/> "label_order": [],<br/> "label_value_case": null,<br/> "labels_as_tags": [<br/> "unset"<br/> ],<br/> "name": null,<br/> "namespace": null,<br/> "regex_replace_chars": null,<br/> "stage": null,<br/> "tags": {},<br/> "tenant": null<br/>}</pre>no
<a name="input_create_security_group"></a> create_security_groupSet true to create and configure a Security Group for the cluster.booltrueno
<a name="input_delimiter"></a> delimiterDelimiter to be used between ID elements.<br/>Defaults to - (hyphen). Set to "" to use no delimiter at all.stringnullno
<a name="input_deployment_batch_size"></a> deployment_batch_sizePercentage or fixed number of Amazon EC2 instances in the Auto Scaling group on which to simultaneously perform deployments. Valid values vary per deployment_batch_size_type settingnumber1no
<a name="input_deployment_batch_size_type"></a> deployment_batch_size_typeThe type of number that is specified in deployment_batch_size_typestring"Fixed"no
<a name="input_deployment_ignore_health_check"></a> deployment_ignore_health_checkDo not cancel a deployment due to failed health checksboolfalseno
<a name="input_deployment_policy"></a> deployment_policyUse the DeploymentPolicy option to set the deployment type. The following values are supported: AllAtOnce, Rolling, RollingWithAdditionalBatch, Immutable, TrafficSplittingstring"Rolling"no
<a name="input_deployment_timeout"></a> deployment_timeoutNumber of seconds to wait for an instance to complete executing commandsnumber600no
<a name="input_description"></a> descriptionShort description of the Environmentstring""no
<a name="input_descriptor_formats"></a> descriptor_formatsDescribe additional descriptors to be output in the descriptors output map.<br/>Map of maps. Keys are names of descriptors. Values are maps of the form<br/>{<br/> format = string<br/> labels = list(string)<br/>}<br/>(Type is any so the map values can later be enhanced to provide additional options.)<br/>format is a Terraform format string to be passed to the format() function.<br/>labels is a list of labels, in order, to pass to format() function.<br/>Label values will be normalized before being passed to format() so they will be<br/>identical to how they appear in id.<br/>Default is {} (descriptors output will be empty).any{}no
<a name="input_dns_subdomain"></a> dns_subdomainThe subdomain to create on Route53 for the EB environment. For the subdomain to be created, the dns_zone_id variable must be set as wellstring""no
<a name="input_dns_zone_id"></a> dns_zone_idRoute53 parent zone ID. The module will create sub-domain DNS record in the parent zone for the EB environmentstring""no
<a name="input_elastic_beanstalk_application_name"></a> elastic_beanstalk_application_nameElastic Beanstalk application namestringn/ayes
<a name="input_elb_scheme"></a> elb_schemeSpecify internal if you want to create an internal load balancer in your Amazon VPC so that your Elastic Beanstalk application cannot be accessed from outside your Amazon VPCstring"public"no
<a name="input_enable_capacity_rebalancing"></a> enable_capacity_rebalancingSpecifies whether to enable the Capacity Rebalancing feature for Spot Instances in your Auto Scaling Groupboolfalseno
<a name="input_enable_loadbalancer_logs"></a> enable_loadbalancer_logsWhether to enable Load Balancer Logging to the S3 bucket.booltrueno
<a name="input_enable_log_publication_control"></a> enable_log_publication_controlCopy the log files for your application's Amazon EC2 instances to the Amazon S3 bucket associated with your applicationboolfalseno
<a name="input_enable_spot_instances"></a> enable_spot_instancesEnable Spot Instance requests for your environmentboolfalseno
<a name="input_enable_stream_logs"></a> enable_stream_logsWhether to create groups in CloudWatch Logs for proxy and deployment logs, and stream logs from each instance in your environmentboolfalseno
<a name="input_enabled"></a> enabledSet to false to prevent the module from creating any resourcesboolnullno
<a name="input_enhanced_reporting_enabled"></a> enhanced_reporting_enabledWhether to enable "enhanced" health reporting for this environment. If false, "basic" reporting is used. When you set this to false, you must also set enable_managed_actions to falsebooltrueno
<a name="input_env_vars"></a> env_varsMap of custom ENV variables to be provided to the application running on Elastic Beanstalk, e.g. env_vars = { DB_USER = 'admin' DB_PASS = 'xxxxxx' }map(string){}no
<a name="input_environment"></a> environmentID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT'stringnullno
<a name="input_environment_type"></a> environment_typeEnvironment type, e.g. 'LoadBalanced' or 'SingleInstance'. If setting to 'SingleInstance', rolling_update_type must be set to 'Time', updating_min_in_service must be set to 0, and loadbalancer_subnets will be unused (it applies to the ELB, which does not exist in SingleInstance environments)string"LoadBalanced"no
<a name="input_extended_ec2_policy_document"></a> extended_ec2_policy_documentExtensions or overrides for the IAM role assigned to EC2 instancesstring""no
<a name="input_force_destroy"></a> force_destroyForce destroy the S3 bucket for load balancer logsboolfalseno
<a name="input_health_streaming_delete_on_terminate"></a> health_streaming_delete_on_terminateWhether to delete the log group when the environment is terminated. If false, the health data is kept RetentionInDays days.boolfalseno
<a name="input_health_streaming_enabled"></a> health_streaming_enabledFor environments with enhanced health reporting enabled, whether to create a group in CloudWatch Logs for environment health and archive Elastic Beanstalk environment health data. For information about enabling enhanced health, see aws:elasticbeanstalk:healthreporting:system.boolfalseno
<a name="input_health_streaming_retention_in_days"></a> health_streaming_retention_in_daysThe number of days to keep the archived health data before it expires.number7no
<a name="input_healthcheck_healthy_threshold_count"></a> healthcheck_healthy_threshold_countThe number of consecutive successful requests before Elastic Load Balancing changes the instance health statusnumber3no
<a name="input_healthcheck_httpcodes_to_match"></a> healthcheck_httpcodes_to_matchList of HTTP codes that indicate that an instance is healthy. Note that this option is only applicable to environments with a network or application load balancerlist(string)<pre>[<br/> "200"<br/>]</pre>no
<a name="input_healthcheck_interval"></a> healthcheck_intervalThe interval of time, in seconds, that Elastic Load Balancing checks the health of the Amazon EC2 instances of your applicationnumber10no
<a name="input_healthcheck_timeout"></a> healthcheck_timeoutThe amount of time, in seconds, to wait for a response during a health check. Note that this option is only applicable to environments with an application load balancernumber5no
<a name="input_healthcheck_unhealthy_threshold_count"></a> healthcheck_unhealthy_threshold_countThe number of consecutive unsuccessful requests before Elastic Load Balancing changes the instance health statusnumber3no
<a name="input_healthcheck_url"></a> healthcheck_urlApplication Health Check URL. Elastic Beanstalk will call this URL to check the health of the application running on EC2 instancesstring"/"no
<a name="input_http_listener_enabled"></a> http_listener_enabledEnable port 80 (http)booltrueno
<a name="input_id_length_limit"></a> id_length_limitLimit id to this many characters (minimum 6).<br/>Set to 0 for unlimited length.<br/>Set to null for keep the existing setting, which defaults to 0.<br/>Does not affect id_full.numbernullno
<a name="input_instance_refresh_enabled"></a> instance_refresh_enabledEnable weekly instance replacement.booltrueno
<a name="input_instance_type"></a> instance_typeInstances typestring"t2.micro"no
<a name="input_keypair"></a> keypairName of SSH key that will be deployed on Elastic Beanstalk and DataPipeline instance. The key should be present in AWSstring""no
<a name="input_label_key_case"></a> label_key_caseControls the letter case of the tags keys (label names) for tags generated by this module.<br/>Does not affect keys of tags passed in via the tags input.<br/>Possible values: lower, title, upper.<br/>Default value: title.stringnullno
<a name="input_label_order"></a> label_orderThe order in which the labels (ID elements) appear in the id.<br/>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br/>You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present.list(string)nullno
<a name="input_label_value_case"></a> label_value_caseControls the letter case of ID elements (labels) as included in id,<br/>set as tag values, and output by this module individually.<br/>Does not affect values of tags passed in via the tags input.<br/>Possible values: lower, title, upper and none (no transformation).<br/>Set this to title and set delimiter to "" to yield Pascal Case IDs.<br/>Default value: lower.stringnullno
<a name="input_labels_as_tags"></a> labels_as_tagsSet of labels (ID elements) to include as tags in the tags output.<br/>Default is to include all labels.<br/>Tags with empty values will not be included in the tags output.<br/>Set to [] to suppress all generated tags.<br/>Notes:<br/> The value of the name tag, if included, will be the id, not the name.<br/> Unlike other null-label inputs, the initial setting of labels_as_tags cannot be<br/> changed in later chained modules. Attempts to change it will be silently ignored.set(string)<pre>[<br/> "default"<br/>]</pre>no
<a name="input_loadbalancer_certificate_arn"></a> loadbalancer_certificate_arnLoad Balancer SSL certificate ARN. The certificate must be present in AWS Certificate Managerstring""no
<a name="input_loadbalancer_connection_idle_timeout"></a> loadbalancer_connection_idle_timeoutClassic load balancer only: Number of seconds that the load balancer waits for any data to be sent or received over the connection. If no data has been sent or received after this time period elapses, the load balancer closes the connection.number60no
<a name="input_loadbalancer_crosszone"></a> loadbalancer_crosszoneConfigure the classic load balancer to route traffic evenly across all instances in all Availability Zones rather than only within each zone.booltrueno
<a name="input_loadbalancer_is_shared"></a> loadbalancer_is_sharedFlag to create a shared application loadbalancer. Only when loadbalancer_type = "application" https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-alb-shared.htmlboolfalseno
<a name="input_loadbalancer_managed_security_group"></a> loadbalancer_managed_security_groupLoad balancer managed security groupstring""no
<a name="input_loadbalancer_redirect_http_to_https"></a> loadbalancer_redirect_http_to_httpsRedirect HTTP traffic to HTTPS listenerboolfalseno
<a name="input_loadbalancer_redirect_http_to_https_host"></a> loadbalancer_redirect_http_to_https_hostDefines the host for the HTTP to HTTPS redirection rulestring"#{host}"no
<a name="input_loadbalancer_redirect_http_to_https_path_pattern"></a> loadbalancer_redirect_http_to_https_path_patternDefines the path pattern for the HTTP to HTTPS redirection rulelist(string)<pre>[<br/> "*"<br/>]</pre>no
<a name="input_loadbalancer_redirect_http_to_https_port"></a> loadbalancer_redirect_http_to_https_portDefines the port for the HTTP to HTTPS redirection rulestring"443"no
<a name="input_loadbalancer_redirect_http_to_https_priority"></a> loadbalancer_redirect_http_to_https_priorityDefines the priority for the HTTP to HTTPS redirection rulenumber1no
<a name="input_loadbalancer_redirect_http_to_https_status_code"></a> loadbalancer_redirect_http_to_https_status_codeThe redirect status codestring"HTTP_301"no
<a name="input_loadbalancer_security_groups"></a> loadbalancer_security_groupsLoad balancer security groupslist(string)[]no
<a name="input_loadbalancer_ssl_policy"></a> loadbalancer_ssl_policySpecify a security policy to apply to the listener. This option is only applicable to environments with an application load balancerstring""no
<a name="input_loadbalancer_subnets"></a> loadbalancer_subnetsList of subnets to place Elastic Load Balancerlist(string)[]no
<a name="input_loadbalancer_type"></a> loadbalancer_typeLoad Balancer type, e.g. 'application' or 'classic'string"classic"no
<a name="input_logs_delete_on_terminate"></a> logs_delete_on_terminateWhether to delete the log groups when the environment is terminated. If false, the logs are kept RetentionInDays daysboolfalseno
<a name="input_logs_retention_in_days"></a> logs_retention_in_daysThe number of days to keep log events before they expire.number7no
<a name="input_managed_actions_enabled"></a> managed_actions_enabledEnable managed platform updates. When you set this to true, you must also specify a PreferredStartTime and UpdateLevelbooltrueno
<a name="input_name"></a> nameID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br/>This is the only ID element not also included as a tag.<br/>The "name" tag is set to the full id string. There is no tag with the value of the name input.stringnullno
<a name="input_namespace"></a> namespaceID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally uniquestringnullno
<a name="input_prefer_legacy_service_policy"></a> prefer_legacy_service_policyWhether to use AWSElasticBeanstalkService (deprecated) or AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy policybooltrueno
<a name="input_prefer_legacy_ssm_policy"></a> prefer_legacy_ssm_policyWhether to use AmazonEC2RoleforSSM (will soon be deprecated) or AmazonSSMManagedInstanceCore policybooltrueno
<a name="input_preferred_start_time"></a> preferred_start_timeConfigure a maintenance window for managed actions in UTCstring"Sun:10:00"no
<a name="input_regex_replace_chars"></a> regex_replace_charsTerraform regular expression (regex) string.<br/>Characters matching the regex will be removed from the ID elements.<br/>If not set, "/[^a-zA-Z0-9-]/" is used to remove all characters other than hyphens, letters and digits.stringnullno
<a name="input_region"></a> regionAWS regionstringn/ayes
<a name="input_rolling_update_enabled"></a> rolling_update_enabledWhether to enable rolling updatebooltrueno
<a name="input_rolling_update_type"></a> rolling_update_typeHealth or Immutable. Set it to Immutable to apply the configuration change to a fresh group of instancesstring"Health"no
<a name="input_root_volume_iops"></a> root_volume_iopsThe IOPS of the EBS root volume (only applies for gp3 and io1 types)numbernullno
<a name="input_root_volume_size"></a> root_volume_sizeThe size of the EBS root volumenumber8no
<a name="input_root_volume_throughput"></a> root_volume_throughputThe type of the EBS root volume (only applies for gp3 type)numbernullno
<a name="input_root_volume_type"></a> root_volume_typeThe type of the EBS root volumestring"gp2"no
<a name="input_s3_bucket_access_log_bucket_name"></a> s3_bucket_access_log_bucket_nameName of the S3 bucket where s3 access log will be sent tostring""no
<a name="input_s3_bucket_versioning_enabled"></a> s3_bucket_versioning_enabledWhen set to 'true' the s3 origin bucket will have versioning enabledbooltrueno
<a name="input_scheduled_actions"></a> scheduled_actionsDefine a list of scheduled actions<pre>list(object({<br/> name = string<br/> minsize = string<br/> maxsize = string<br/> desiredcapacity = string<br/> starttime = string<br/> endtime = string<br/> recurrence = string<br/> suspend = bool<br/> }))</pre>[]no
<a name="input_security_group_create_before_destroy"></a> security_group_create_before_destroySet true to enable Terraform create_before_destroy behavior on the created security group.<br/>We recommend setting this true on new security groups, but default it to false because true<br/>will cause existing security groups to be replaced, possibly requiring the resource to be deleted and recreated.<br/>Note that changing this value will always cause the security group to be replaced.boolfalseno
<a name="input_security_group_create_timeout"></a> security_group_create_timeoutHow long to wait for the security group to be created.string"10m"no
<a name="input_security_group_delete_timeout"></a> security_group_delete_timeoutHow long to retry on DependencyViolation errors during security group deletion from<br/>lingering ENIs left by certain AWS services such as Elastic Load Balancing.string"15m"no
<a name="input_security_group_description"></a> security_group_descriptionThe description to assign to the created Security Group.<br/>Warning: Changing the description causes the security group to be replaced.string"Security Group for the EB environment"no
<a name="input_security_group_name"></a> security_group_nameThe name to assign to the created security group. Must be unique within the VPC.<br/>If not provided, will be derived from the null-label.context passed in.<br/>If create_before_destroy is true, will be used as a name prefix.list(string)[]no
<a name="input_shared_loadbalancer_arn"></a> shared_loadbalancer_arnARN of the shared application load balancer. Only when loadbalancer_type = "application".string""no
<a name="input_solution_stack_name"></a> solution_stack_nameElastic Beanstalk stack, e.g. Docker, Go, Node, Java, IIS. For more info, see https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.htmlstringn/ayes
<a name="input_spot_fleet_on_demand_above_base_percentage"></a> spot_fleet_on_demand_above_base_percentageThe percentage of On-Demand Instances as part of additional capacity that your Auto Scaling group provisions beyond the SpotOnDemandBase instances. This option is relevant only when enable_spot_instances is true.number-1no
<a name="input_spot_fleet_on_demand_base"></a> spot_fleet_on_demand_baseThe minimum number of On-Demand Instances that your Auto Scaling group provisions before considering Spot Instances as your environment scales up. This option is relevant only when enable_spot_instances is true.number0no
<a name="input_spot_max_price"></a> spot_max_priceThe maximum price per unit hour, in US$, that you're willing to pay for a Spot Instance. This option is relevant only when enable_spot_instances is true. Valid values are between 0.001 and 20.0number-1no
<a name="input_ssh_listener_enabled"></a> ssh_listener_enabledEnable SSH portboolfalseno
<a name="input_ssh_listener_port"></a> ssh_listener_portSSH portnumber22no
<a name="input_stage"></a> stageID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release'stringnullno
<a name="input_tags"></a> tagsAdditional tags (e.g. {'BusinessUnit': 'XYZ'}).<br/>Neither the tag keys nor the tag values will be modified by this module.map(string){}no
<a name="input_tenant"></a> tenantID element _(Rarely used, not included by default)_. A customer identifier, indicating who this instance of a resource is forstringnullno
<a name="input_tier"></a> tierElastic Beanstalk Environment tier, 'WebServer' or 'Worker'string"WebServer"no
<a name="input_update_level"></a> update_levelThe highest level of update to apply with managed platform updatesstring"minor"no
<a name="input_updating_max_batch"></a> updating_max_batchMaximum number of instances to update at oncenumber1no
<a name="input_updating_min_in_service"></a> updating_min_in_serviceMinimum number of instances in service during updatenumber1no
<a name="input_version_label"></a> version_labelElastic Beanstalk Application version to deploystring""no
<a name="input_vpc_id"></a> vpc_idID of the VPC in which to provision the AWS resourcesstringn/ayes
<a name="input_wait_for_ready_timeout"></a> wait_for_ready_timeoutThe maximum duration to wait for the Elastic Beanstalk Environment to be in a ready state before timing outstring"20m"no

Outputs

NameDescription
<a name="output_all_settings"></a> all_settingsList of all option settings configured in the environment. These are a combination of default settings and their overrides from setting in the configuration
<a name="output_application"></a> applicationThe Elastic Beanstalk Application for this environment
<a name="output_autoscaling_groups"></a> autoscaling_groupsThe autoscaling groups used by this environment
<a name="output_ec2_instance_profile_role_name"></a> ec2_instance_profile_role_nameInstance IAM role name
<a name="output_elb_zone_id"></a> elb_zone_idELB zone ID
<a name="output_endpoint"></a> endpointFully qualified DNS name for the environment
<a name="output_hostname"></a> hostnameDNS hostname
<a name="output_id"></a> idID of the Elastic Beanstalk environment
<a name="output_instances"></a> instancesInstances used by this environment
<a name="output_launch_configurations"></a> launch_configurationsLaunch configurations in use by this environment
<a name="output_load_balancer_log_bucket"></a> load_balancer_log_bucketName of bucket where Load Balancer logs are stored (if enabled)
<a name="output_load_balancers"></a> load_balancersElastic Load Balancers in use by this environment
<a name="output_name"></a> nameName of the Elastic Beanstalk environment
<a name="output_queues"></a> queuesSQS queues in use by this environment
<a name="output_security_group_arn"></a> security_group_arnElastic Beanstalk environment Security Group ARN
<a name="output_security_group_id"></a> security_group_idElastic Beanstalk environment Security Group ID
<a name="output_security_group_name"></a> security_group_nameElastic Beanstalk environment Security Group name
<a name="output_setting"></a> settingSettings specifically set for this environment
<a name="output_tier"></a> tierThe environment tier
<a name="output_triggers"></a> triggersAutoscaling triggers in use by this environment
<!-- markdownlint-restore -->

Related Projects

Check out these related projects.

[!TIP]

Use Terraform Reference Architectures for AWS

Use Cloud Posse's ready-to-go terraform architecture blueprints for AWS to get up and running quickly.

βœ… We build it together with your team.<br/> βœ… Your team owns everything.<br/> βœ… 100% Open Source and backed by fanatical support.<br/>

<a href="https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elastic-beanstalk-environment&utm_content=commercial_support"><img alt="Request Quote" src="https://img.shields.io/badge/request%20quote-success.svg?style=for-the-badge"/></a>

<details><summary>πŸ“š <strong>Learn More</strong></summary> <br/>

Cloud Posse is the leading DevOps Accelerator for funded startups and enterprises.

Your team can operate like a pro today.

Ensure that your team succeeds by using Cloud Posse's proven process and turnkey blueprints. Plus, we stick around until you succeed.

Day-0: Your Foundation for Success

<a href="https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elastic-beanstalk-environment&utm_content=commercial_support"><img alt="Request Quote" src="https://img.shields.io/badge/request%20quote-success.svg?style=for-the-badge"/></a>

Day-2: Your Operational Mastery

<a href="https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elastic-beanstalk-environment&utm_content=commercial_support"><img alt="Request Quote" src="https://img.shields.io/badge/request%20quote-success.svg?style=for-the-badge"/></a>

</details>

✨ Contributing

This project is under active development, and we encourage contributions from our community.

Many thanks to our outstanding contributors:

<a href="https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/graphs/contributors"> <img src="https://contrib.rocks/image?repo=cloudposse/terraform-aws-elastic-beanstalk-environment&max=24" /> </a>

For πŸ› bug reports & feature requests, please use the issue tracker.

In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

  1. Review our Code of Conduct and Contributor Guidelines.
  2. Fork the repo on GitHub
  3. Clone the project to your own machine
  4. Commit changes to your own branch
  5. Push your work back up to your fork
  6. Submit a Pull Request so that we can review your changes

NOTE: Be sure to merge the latest changes from "upstream" before making a pull request!

🌎 Slack Community

Join our Open Source Community on Slack. It's FREE for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally sweet infrastructure.

πŸ“° Newsletter

Sign up for our newsletter and join 3,000+ DevOps engineers, CTOs, and founders who get insider access to the latest DevOps trends, so you can always stay in the know. Dropped straight into your Inbox every week β€” and usually a 5-minute read.

πŸ“† Office Hours <a href="https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elastic-beanstalk-environment&utm_content=office_hours"><img src="https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png" align="right" /></a>

Join us every Wednesday via Zoom for your weekly dose of insider DevOps trends, AWS news and Terraform insights, all sourced from our SweetOps community, plus a live Q&A that you can’t find anywhere else. It's FREE for everyone!

License

<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="License"></a>

<details> <summary>Preamble to the Apache License, Version 2.0</summary> <br/> <br/>

Complete license is available in the LICENSE file.

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
</details>

Trademarks

All other trademarks referenced herein are the property of their respective owners.


Copyright Β© 2017-2024 Cloud Posse, LLC

<a href="https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elastic-beanstalk-environment&utm_content=readme_footer_link"><img alt="README footer" src="https://cloudposse.com/readme/footer/img"/></a>

<img alt="Beacon" width="0" src="https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-aws-elastic-beanstalk-environment?pixel&cs=github&cm=readme&an=terraform-aws-elastic-beanstalk-environment"/>