github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/aws/r/elastic_beanstalk_environment.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_elastic_beanstalk_environment" 4 sidebar_current: "docs-aws-resource-elastic-beanstalk-environment" 5 description: |- 6 Provides an Elastic Beanstalk Environment Resource 7 --- 8 9 # aws\_elastic\_beanstalk\_<wbr>environment 10 11 Provides an Elastic Beanstalk Environment Resource. Elastic Beanstalk allows 12 you to deploy and manage applications in the AWS cloud without worrying about 13 the infrastructure that runs those applications. 14 15 Environments are often things such as `development`, `integration`, or 16 `production`. 17 18 ## Example Usage 19 20 ```hcl 21 resource "aws_elastic_beanstalk_application" "tftest" { 22 name = "tf-test-name" 23 description = "tf-test-desc" 24 } 25 26 resource "aws_elastic_beanstalk_environment" "tfenvtest" { 27 name = "tf-test-name" 28 application = "${aws_elastic_beanstalk_application.tftest.name}" 29 solution_stack_name = "64bit Amazon Linux 2015.03 v2.0.3 running Go 1.4" 30 } 31 ``` 32 33 ## Argument Reference 34 35 The following arguments are supported: 36 37 * `name` - (Required) A unique name for this Environment. This name is used 38 in the application URL 39 * `application` – (Required) Name of the application that contains the version 40 to be deployed 41 * `cname_prefix` - (Optional) Prefix to use for the fully qualified DNS name of 42 the Environment. 43 * `description` - (Optional) Short description of the Environment 44 * `tier` - (Optional) Elastic Beanstalk Environment tier. Valid values are `Worker` 45 or `WebServer`. If tier is left blank `WebServer` will be used. 46 * `setting` – (Optional) Option settings to configure the new Environment. These 47 override specific values that are set as defaults. The format is detailed 48 below in [Option Settings](#option-settings) 49 * `solution_stack_name` – (Optional) A solution stack to base your environment 50 off of. Example stacks can be found in the [Amazon API documentation][1] 51 * `template_name` – (Optional) The name of the Elastic Beanstalk Configuration 52 template to use in deployment 53 * `wait_for_ready_timeout` - (Default: `10m`) The maximum 54 [duration](https://golang.org/pkg/time/#ParseDuration) that Terraform should 55 wait for an Elastic Beanstalk Environment to be in a ready state before timing 56 out. 57 * `poll_interval` – The time between polling the AWS API to 58 check if changes have been applied. Use this to adjust the rate of API calls 59 for any `create` or `update` action. Minimum `10s`, maximum `180s`. Omit this to 60 use the default behavior, which is an exponential backoff 61 * `version_label` - (Optional) The name of the Elastic Beanstalk Application Version 62 to use in deployment. 63 * `tags` – (Optional) A set of tags to apply to the Environment. **Note:** at 64 this time the Elastic Beanstalk API does not provide a programatic way of 65 changing these tags after initial application 66 67 68 ## Option Settings 69 70 Some options can be stack-specific, check [AWS Docs](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html) 71 for supported options and examples. 72 73 The `setting` and `all_settings` mappings support the following format: 74 75 * `namespace` - unique namespace identifying the option's associated AWS resource 76 * `name` - name of the configuration option 77 * `value` - value for the configuration option 78 * `resource` - (Optional) resource name for [scheduled action](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-autoscalingscheduledaction) 79 80 ### Example With Options 81 82 ```hcl 83 resource "aws_elastic_beanstalk_application" "tftest" { 84 name = "tf-test-name" 85 description = "tf-test-desc" 86 } 87 88 resource "aws_elastic_beanstalk_environment" "tfenvtest" { 89 name = "tf-test-name" 90 application = "${aws_elastic_beanstalk_application.tftest.name}" 91 solution_stack_name = "64bit Amazon Linux 2015.03 v2.0.3 running Go 1.4" 92 93 setting { 94 namespace = "aws:ec2:vpc" 95 name = "VPCId" 96 value = "vpc-xxxxxxxx" 97 } 98 99 setting { 100 namespace = "aws:ec2:vpc" 101 name = "Subnets" 102 value = "subnet-xxxxxxxx" 103 } 104 } 105 ``` 106 107 ## Attributes Reference 108 109 The following attributes are exported: 110 111 * `name` - Name of the Elastic Beanstalk Environment. 112 * `description` - Description of the Elastic Beanstalk Environment. 113 * `tier` - The environment tier specified. 114 * `application` – The Elastic Beanstalk Application specified for this environment. 115 * `setting` – Settings specifically set for this Environment. 116 * `all_settings` – List of all option settings configured in the Environment. These 117 are a combination of default settings and their overrides from `setting` in 118 the configuration. 119 * `cname` - Fully qualified DNS name for the Environment. 120 * `autoscaling_groups` - The autoscaling groups used by this environment. 121 * `instances` - Instances used by this environment. 122 * `launch_configurations` - Launch configurations in use by this environment. 123 * `load_balancers` - Elastic load balancers in use by this environment. 124 * `queues` - SQS queues in use by this environment. 125 * `triggers` - Autoscaling triggers in use by this environment. 126 127 128 129 [1]: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html 130 131 132 ## Import 133 134 Elastic Beanstalk Environments can be imported using the `id`, e.g. 135 136 ``` 137 $ terraform import aws_elastic_beanstalk_environment.prodenv e-rpqsewtp2j 138 ```