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