diff --git a/builtin/providers/aws/provider.go b/builtin/providers/aws/provider.go index 2a90cb893809..247494eb497a 100644 --- a/builtin/providers/aws/provider.go +++ b/builtin/providers/aws/provider.go @@ -141,6 +141,7 @@ func Provider() terraform.ResourceProvider { "aws_elasticache_security_group": resourceAwsElasticacheSecurityGroup(), "aws_elasticache_subnet_group": resourceAwsElasticacheSubnetGroup(), "aws_elastic_beanstalk_application": resourceAwsElasticBeanstalkApplication(), + "aws_elastic_beanstalk_application_version": resourceAwsElasticBeanstalkApplicationVersion(), "aws_elastic_beanstalk_configuration_template": resourceAwsElasticBeanstalkConfigurationTemplate(), "aws_elastic_beanstalk_environment": resourceAwsElasticBeanstalkEnvironment(), "aws_elasticsearch_domain": resourceAwsElasticSearchDomain(), diff --git a/builtin/providers/aws/resource_aws_elastic_beanstalk_application_version.go b/builtin/providers/aws/resource_aws_elastic_beanstalk_application_version.go new file mode 100644 index 000000000000..b79e0ec5db0a --- /dev/null +++ b/builtin/providers/aws/resource_aws_elastic_beanstalk_application_version.go @@ -0,0 +1,164 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/hashicorp/terraform/helper/schema" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/elasticbeanstalk" +) + +func resourceAwsElasticBeanstalkApplicationVersion() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsElasticBeanstalkApplicationVersionCreate, + Read: resourceAwsElasticBeanstalkApplicationVersionRead, + Update: resourceAwsElasticBeanstalkApplicationVersionUpdate, + Delete: resourceAwsElasticBeanstalkApplicationVersionDelete, + + Schema: map[string]*schema.Schema{ + "application": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, + "bucket": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "key": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + }, + } +} + +func resourceAwsElasticBeanstalkApplicationVersionCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).elasticbeanstalkconn + + application := d.Get("application").(string) + description := d.Get("description").(string) + bucket := d.Get("bucket").(string) + key := d.Get("key").(string) + name := d.Get("name").(string) + + s3Location := elasticbeanstalk.S3Location{ + S3Bucket: aws.String(bucket), + S3Key: aws.String(key), + } + + createOpts := elasticbeanstalk.CreateApplicationVersionInput{ + + ApplicationName: aws.String(application), + Description: aws.String(description), + SourceBundle: &s3Location, + VersionLabel: aws.String(name), + } + + log.Printf("[DEBUG] Elastic Beanstalk Application Version create opts: %s", createOpts) + _, err := conn.CreateApplicationVersion(&createOpts) + if err != nil { + return err + } + + d.SetId(name) + log.Printf("[INFO] Elastic Beanstalk Application Version Label: %s", name) + + return resourceAwsElasticBeanstalkApplicationVersionRead(d, meta) +} + +func resourceAwsElasticBeanstalkApplicationVersionRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).elasticbeanstalkconn + + name := d.Id() + + resp, err := conn.DescribeApplicationVersions(&elasticbeanstalk.DescribeApplicationVersionsInput{ + VersionLabels: []*string{aws.String(name)}, + }) + + if err != nil { + return err + } + + if len(resp.ApplicationVersions) == 0 { + log.Printf("[DEBUG] Elastic Beanstalk application version read: application version not found") + + d.SetId("") + + return nil + } else if len(resp.ApplicationVersions) != 1 { + return fmt.Errorf("Error reading application version properties: found %d application versions, expected 1", len(resp.ApplicationVersions)) + } + + if err := d.Set("description", resp.ApplicationVersions[0].Description); err != nil { + return err + } + + return nil +} + +func resourceAwsElasticBeanstalkApplicationVersionUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).elasticbeanstalkconn + + if d.HasChange("description") { + if err := resourceAwsElasticBeanstalkApplicationVersionDescriptionUpdate(conn, d); err != nil { + return err + } + } + + return resourceAwsElasticBeanstalkApplicationVersionRead(d, meta) + +} + +func resourceAwsElasticBeanstalkApplicationVersionDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).elasticbeanstalkconn + + application := d.Get("application").(string) + name := d.Id() + + _, err := conn.DeleteApplicationVersion(&elasticbeanstalk.DeleteApplicationVersionInput{ + ApplicationName: aws.String(application), + VersionLabel: aws.String(name), + }) + + d.SetId("") + + if awserr, ok := err.(awserr.Error); ok { + // application version is pending delete, or no longer exists. + if awserr.Code() == "InvalidParameterValue" { + return nil + } + + } + return err +} + +func resourceAwsElasticBeanstalkApplicationVersionDescriptionUpdate(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { + application := d.Get("application").(string) + description := d.Get("description").(string) + name := d.Get("name").(string) + + log.Printf("[DEBUG] Elastic Beanstalk application version: %s, update description: %s", name, description) + + _, err := conn.UpdateApplicationVersion(&elasticbeanstalk.UpdateApplicationVersionInput{ + ApplicationName: aws.String(application), + Description: aws.String(description), + VersionLabel: aws.String(name), + }) + + return err +} diff --git a/builtin/providers/aws/resource_aws_elastic_beanstalk_application_version_test.go b/builtin/providers/aws/resource_aws_elastic_beanstalk_application_version_test.go new file mode 100644 index 000000000000..e1419fb0c835 --- /dev/null +++ b/builtin/providers/aws/resource_aws_elastic_beanstalk_application_version_test.go @@ -0,0 +1,123 @@ +package aws + +import ( + "fmt" + "log" + "testing" + + "github.com/hashicorp/terraform/helper/acctest" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/elasticbeanstalk" +) + +func TestAccAWSBeanstalkAppVersion_basic(t *testing.T) { + + var appVersion elasticbeanstalk.ApplicationVersionDescription + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckApplicationVersionDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccBeanstalkApplicationVersionConfig(acctest.RandInt()), + Check: resource.ComposeTestCheckFunc( + testAccCheckApplicationVersionExists("aws_elastic_beanstalk_application_version.default", &appVersion), + ), + }, + }, + }) +} + +func testAccCheckApplicationVersionDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).elasticbeanstalkconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_elastic_beanstalk_application_version" { + continue + } + + describeApplicationVersionOpts := &elasticbeanstalk.DescribeApplicationVersionsInput{ + VersionLabels: []*string{aws.String(rs.Primary.ID)}, + } + resp, err := conn.DescribeApplicationVersions(describeApplicationVersionOpts) + if err == nil { + if len(resp.ApplicationVersions) > 0 { + return fmt.Errorf("Elastic Beanstalk Application Verson still exists.") + } + + return nil + } + ec2err, ok := err.(awserr.Error) + if !ok { + return err + } + if ec2err.Code() != "InvalidParameterValue" { + return err + } + } + + return nil +} + +func testAccCheckApplicationVersionExists(n string, app *elasticbeanstalk.ApplicationVersionDescription) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Elastic Beanstalk Application Version is not set") + } + + conn := testAccProvider.Meta().(*AWSClient).elasticbeanstalkconn + describeApplicationVersionOpts := &elasticbeanstalk.DescribeApplicationVersionsInput{ + VersionLabels: []*string{aws.String(rs.Primary.ID)}, + } + + log.Printf("[DEBUG] Elastic Beanstalk Application Version TEST describe opts: %s", describeApplicationVersionOpts) + + resp, err := conn.DescribeApplicationVersions(describeApplicationVersionOpts) + if err != nil { + return err + } + if len(resp.ApplicationVersions) == 0 { + return fmt.Errorf("Elastic Beanstalk Application Version not found.") + } + + *app = *resp.ApplicationVersions[0] + + return nil + } +} + +func testAccBeanstalkApplicationVersionConfig(randInt int) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "default" { + bucket = "tftest.applicationversion.bucket-%d" +} + +resource "aws_s3_bucket_object" "default" { + bucket = "${aws_s3_bucket.default.id}" + key = "beanstalk/go-v1.zip" + source = "test-fixtures/beanstalk-go-v1.zip" +} + +resource "aws_elastic_beanstalk_application" "default" { + name = "tf-test-name" + description = "tf-test-desc" +} + +resource "aws_elastic_beanstalk_application_version" "default" { + application = "tf-test-name" + name = "tf-test-version-label" + bucket = "${aws_s3_bucket.default.id}" + key = "${aws_s3_bucket_object.default.id}" + } + `, randInt) +} diff --git a/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go b/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go index a22b9fa841f6..7da319b60b46 100644 --- a/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go +++ b/builtin/providers/aws/resource_aws_elastic_beanstalk_environment.go @@ -56,6 +56,10 @@ func resourceAwsElasticBeanstalkEnvironment() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "version_label": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, "cname": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -96,6 +100,7 @@ func resourceAwsElasticBeanstalkEnvironmentCreate(d *schema.ResourceData, meta i cname := d.Get("cname").(string) app := d.Get("application").(string) desc := d.Get("description").(string) + version := d.Get("version_label").(string) settings := d.Get("setting").(*schema.Set) solutionStack := d.Get("solution_stack_name").(string) templateName := d.Get("template_name").(string) @@ -126,13 +131,16 @@ func resourceAwsElasticBeanstalkEnvironmentCreate(d *schema.ResourceData, meta i createOpts.TemplateName = aws.String(templateName) } + if version != "" { + createOpts.VersionLabel = aws.String(version) + } + log.Printf("[DEBUG] Elastic Beanstalk Environment create opts: %s", createOpts) resp, err := conn.CreateEnvironment(&createOpts) if err != nil { return err } - // Assign the application name as the resource ID d.SetId(*resp.EnvironmentId) stateConf := &resource.StateChangeConf{ @@ -157,50 +165,18 @@ func resourceAwsElasticBeanstalkEnvironmentCreate(d *schema.ResourceData, meta i func resourceAwsElasticBeanstalkEnvironmentUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).elasticbeanstalkconn - if d.HasChange("description") { - if err := resourceAwsElasticBeanstalkEnvironmentDescriptionUpdate(conn, d); err != nil { - return err - } - } - - if d.HasChange("solution_stack_name") { - if err := resourceAwsElasticBeanstalkEnvironmentSolutionStackUpdate(conn, d); err != nil { - return err - } - } - - if d.HasChange("setting") { - if err := resourceAwsElasticBeanstalkEnvironmentOptionSettingsUpdate(conn, d); err != nil { - return err - } - } - - return resourceAwsElasticBeanstalkEnvironmentRead(d, meta) -} - -func resourceAwsElasticBeanstalkEnvironmentDescriptionUpdate(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { - name := d.Get("name").(string) - desc := d.Get("description").(string) envId := d.Id() - log.Printf("[DEBUG] Elastic Beanstalk application: %s, update description: %s", name, desc) - - _, err := conn.UpdateEnvironment(&elasticbeanstalk.UpdateEnvironmentInput{ + updateOpts := elasticbeanstalk.UpdateEnvironmentInput{ EnvironmentId: aws.String(envId), - Description: aws.String(desc), - }) - - return err -} - -func resourceAwsElasticBeanstalkEnvironmentOptionSettingsUpdate(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { - name := d.Get("name").(string) - envId := d.Id() + } - log.Printf("[DEBUG] Elastic Beanstalk application: %s, update options", name) + if d.HasChange("description") { + updateOpts.Description = aws.String(d.Get("description").(string)) + } - req := &elasticbeanstalk.UpdateEnvironmentInput{ - EnvironmentId: aws.String(envId), + if d.HasChange("solution_stack_name") { + updateOpts.SolutionStackName = aws.String(d.Get("solution_stack_name").(string)) } if d.HasChange("setting") { @@ -215,29 +191,36 @@ func resourceAwsElasticBeanstalkEnvironmentOptionSettingsUpdate(conn *elasticbea os := o.(*schema.Set) ns := n.(*schema.Set) - req.OptionSettings = extractOptionSettings(ns.Difference(os)) + updateOpts.OptionSettings = extractOptionSettings(ns.Difference(os)) } - if _, err := conn.UpdateEnvironment(req); err != nil { - return err + if d.HasChange("version_label") { + updateOpts.VersionLabel = aws.String(d.Get("version_label").(string)) } - return nil -} - -func resourceAwsElasticBeanstalkEnvironmentSolutionStackUpdate(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { - name := d.Get("name").(string) - solutionStack := d.Get("solution_stack_name").(string) - envId := d.Id() + log.Printf("[DEBUG] Elastic Beanstalk Environment update opts: %s", updateOpts) + _, err := conn.UpdateEnvironment(&updateOpts) + if err != nil { + return err + } - log.Printf("[DEBUG] Elastic Beanstalk application: %s, update solution_stack_name: %s", name, solutionStack) + stateConf := &resource.StateChangeConf{ + Pending: []string{"Launching", "Updating"}, + Target: []string{"Ready"}, + Refresh: environmentStateRefreshFunc(conn, d.Id()), + Timeout: 10 * time.Minute, + Delay: 10 * time.Second, + MinTimeout: 3 * time.Second, + } - _, err := conn.UpdateEnvironment(&elasticbeanstalk.UpdateEnvironmentInput{ - EnvironmentId: aws.String(envId), - SolutionStackName: aws.String(solutionStack), - }) + _, err = stateConf.WaitForState() + if err != nil { + return fmt.Errorf( + "Error waiting for Elastic Beanstalk Environment (%s) to become ready: %s", + d.Id(), err) + } - return err + return resourceAwsElasticBeanstalkEnvironmentRead(d, meta) } func resourceAwsElasticBeanstalkEnvironmentRead(d *schema.ResourceData, meta interface{}) error { @@ -283,6 +266,10 @@ func resourceAwsElasticBeanstalkEnvironmentRead(d *schema.ResourceData, meta int return err } + if err := d.Set("version_label", env.VersionLabel); err != nil { + return err + } + return resourceAwsElasticBeanstalkEnvironmentSettingsRead(d, meta) } diff --git a/builtin/providers/aws/resource_aws_elastic_beanstalk_environment_test.go b/builtin/providers/aws/resource_aws_elastic_beanstalk_environment_test.go index 5e4b8e3e11db..9fee5eb28dbc 100644 --- a/builtin/providers/aws/resource_aws_elastic_beanstalk_environment_test.go +++ b/builtin/providers/aws/resource_aws_elastic_beanstalk_environment_test.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" + "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) @@ -30,6 +31,24 @@ func TestAccAWSBeanstalkEnv_basic(t *testing.T) { }) } +func TestAccAWSBeanstalkEnv_version_label(t *testing.T) { + var app elasticbeanstalk.EnvironmentDescription + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckBeanstalkEnvDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccBeanstalkEnvApplicationVersionConfig(acctest.RandInt()), + Check: resource.ComposeTestCheckFunc( + testAccCheckBeanstalkApplicationVersionDeployed("aws_elastic_beanstalk_environment.default", &app), + ), + }, + }, + }) +} + func testAccCheckBeanstalkEnvDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).elasticbeanstalkconn @@ -102,6 +121,42 @@ func testAccCheckBeanstalkEnvExists(n string, app *elasticbeanstalk.EnvironmentD } } +func testAccCheckBeanstalkApplicationVersionDeployed(n string, env *elasticbeanstalk.EnvironmentDescription) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Elastic Beanstalk ENV is not set") + } + + conn := testAccProvider.Meta().(*AWSClient).elasticbeanstalkconn + describeBeanstalkEnvOpts := &elasticbeanstalk.DescribeEnvironmentsInput{ + EnvironmentIds: []*string{aws.String(rs.Primary.ID)}, + } + + log.Printf("[DEBUG] Elastic Beanstalk Environment TEST describe opts: %s", describeBeanstalkEnvOpts) + + resp, err := conn.DescribeEnvironments(describeBeanstalkEnvOpts) + if err != nil { + return err + } + if len(resp.Environments) == 0 { + return fmt.Errorf("Elastic Beanstalk ENV not found.") + } + + if *resp.Environments[0].VersionLabel != rs.Primary.Attributes["version_label"] { + return fmt.Errorf("Elastic Beanstalk version deployed %s. Expected %s", resp.Environments[0].VersionLabel, rs.Primary.Attributes["version_label"]) + } + + *env = *resp.Environments[0] + + return nil + } +} + const testAccBeanstalkEnvConfig = ` resource "aws_elastic_beanstalk_application" "tftest" { name = "tf-test-name" @@ -115,3 +170,36 @@ resource "aws_elastic_beanstalk_environment" "tfenvtest" { #solution_stack_name = } ` + +func testAccBeanstalkEnvApplicationVersionConfig(randInt int) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "default" { + bucket = "tftest.applicationversion.buckets-%d" +} + +resource "aws_s3_bucket_object" "default" { + bucket = "${aws_s3_bucket.default.id}" + key = "beanstalk/go-v1.zip" + source = "test-fixtures/beanstalk-go-v1.zip" +} + +resource "aws_elastic_beanstalk_application" "default" { + name = "tf-test-name" + description = "tf-test-desc" +} + +resource "aws_elastic_beanstalk_application_version" "default" { + application = "tf-test-name" + name = "tf-test-version-label" + bucket = "${aws_s3_bucket.default.id}" + key = "${aws_s3_bucket_object.default.id}" +} + +resource "aws_elastic_beanstalk_environment" "default" { + name = "tf-test-name" + application = "${aws_elastic_beanstalk_application.default.name}" + version_label = "${aws_elastic_beanstalk_application_version.default.name}" + solution_stack_name = "64bit Amazon Linux 2015.09 v2.0.4 running Go 1.4" +} +`, randInt) +} diff --git a/builtin/providers/aws/test-fixtures/beanstalk-go-v1.zip b/builtin/providers/aws/test-fixtures/beanstalk-go-v1.zip new file mode 100644 index 000000000000..c8a5e9939e7f Binary files /dev/null and b/builtin/providers/aws/test-fixtures/beanstalk-go-v1.zip differ diff --git a/website/source/docs/providers/aws/r/elastic_beanstalk_application_version.html.markdown b/website/source/docs/providers/aws/r/elastic_beanstalk_application_version.html.markdown new file mode 100644 index 000000000000..22ca5f86bf0f --- /dev/null +++ b/website/source/docs/providers/aws/r/elastic_beanstalk_application_version.html.markdown @@ -0,0 +1,59 @@ +--- +layout: "aws" +page_title: "AWS: aws_elastic_beanstalk_application_version" +sidebar_current: "docs-aws-resource-elastic-beanstalk-application-version" +description: |- + Provides an Elastic Beanstalk Application Version Resource +--- + +# aws\_elastic\_beanstalk\_application\_version + +Provides an Elastic Beanstalk Application Version Resource. Elastic Beanstalk allows +you to deploy and manage applications in the AWS cloud without worrying about +the infrastructure that runs those applications. + +This resource creates a Beanstalk Application Version that can be deployed to a Beanstalk +Environment. + +## Example Usage + +``` +resource "aws_s3_bucket" "default" { + bucket = "tftest.applicationversion.bucket" +} + +resource "aws_s3_bucket_object" "default" { + bucket = "${aws_s3_bucket.default.id}" + key = "beanstalk/go-v1.zip" + source = "go-v1.zip" +} + +resource "aws_elastic_beanstalk_application" "default" { + name = "tf-test-name" + description = "tf-test-desc" +} + +resource "aws_elastic_beanstalk_application_version" "default" { + name = "tf-test-version-label" + application = "tf-test-name" + description = "application version created by terraform" + bucket = "${aws_s3_bucket.default.id}" + key = "${aws_s3_bucket_object.default.id}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) A unique name for the this Application Version. +* `application` - (Required) Name of the Beanstalk Application the version is associated with. +* `description` - (Optional) Short description of the Application Version. +* `bucket` - (Required) S3 bucket that contains the Application Version source bundle. +* `key` - (Required) S3 object that is the Application Version source bundle. + +## Attributes Reference + +The following attributes are exported: + +* `name` - The Application Version name. diff --git a/website/source/docs/providers/aws/r/elastic_beanstalk_environment.html.markdown b/website/source/docs/providers/aws/r/elastic_beanstalk_environment.html.markdown index d9d28a63b951..6b618f6166aa 100644 --- a/website/source/docs/providers/aws/r/elastic_beanstalk_environment.html.markdown +++ b/website/source/docs/providers/aws/r/elastic_beanstalk_environment.html.markdown @@ -8,11 +8,11 @@ description: |- # aws\_elastic\_beanstalk\_environment -Provides an Elastic Beanstalk Environment Resource. Elastic Beanstalk allows -you to deploy and manage applications in the AWS cloud without worrying about +Provides an Elastic Beanstalk Environment Resource. Elastic Beanstalk allows +you to deploy and manage applications in the AWS cloud without worrying about the infrastructure that runs those applications. -Environments are often things such as `development`, `integration`, or +Environments are often things such as `development`, `integration`, or `production`. ## Example Usage @@ -35,21 +35,23 @@ resource "aws_elastic_beanstalk_environment" "tfenvtest" { The following arguments are supported: -* `name` - (Required) A unique name for the this Environment. This name is used - in the application URL -* `application` – (Required) Name of the application that contains the version - to be deployed -* `description` - (Optional) Short description of the Environment -* `setting` – (Optional) Option settings to configure the new Environment. These +* `name` - (Required) A unique name for the this Environment. This name is used + in the application URL. +* `application` - (Required) Name of the application that contains the version + to be deployed. +* `description` - (Optional) Short description of the Environment. +* `setting` - (Optional) Option settings to configure the new Environment. These override specific values that are set as defaults. The format is detailed - below in [Option Settings](#option-settings) -* `solution_stack_name` – (Optional) A solution stack to base your environment -off of. Example stacks can be found in the [Amazon API documentation][1] -* `template_name` – (Optional) The name of the Elastic Beanstalk Configuration - template to use in deployment -* `tags` – (Optional) A set of tags to apply to the Environment. **Note:** at + below in [Option Settings](#option-settings). +* `solution_stack_name` - (Optional) A solution stack to base your environment +off of. Example stacks can be found in the [Amazon API documentation][1]. +* `template_name` - (Optional) The name of the Elastic Beanstalk Configuration + template to use in deployment. +* `version_label` - (Optional) The name of the Elastic Beanstalk Application Version + to use in deployment. +* `tags` - (Optional) A set of tags to apply to the Environment. **Note:** at this time the Elastic Beanstalk API does not provide a programatic way of -changing these tags after initial application +changing these tags after initial application. @@ -57,7 +59,7 @@ changing these tags after initial application The `setting` and `all_settings` mappings support the following format: -* `namespace` - (Optional) unique namespace identifying the option's +* `namespace` - (Optional) unique namespace identifying the option's associated AWS resource * `name` - (Optional) name of the configuration option * `value` - (Optional) value for the configuration option @@ -66,15 +68,15 @@ The `setting` and `all_settings` mappings support the following format: The following attributes are exported: -* `name` -* `description` -* `application` – the application specified -* `setting` – Settings specifically set for this Environment -* `all_settings` – List of all option settings configured in the Environment. These +* `name` - The Elastic Beanstalk environment name. +* `description` - The Elastic Beanstalk environment description. +* `application` - The application specified. +* `version_label` - The Elastic Beanstalk Application Version specified. +* `cname` - The Elastic Beanstalk CNAME poiting to this Environment. +* `setting` - Settings specifically set for this Environment. +* `all_settings` - List of all option settings configured in the Environment. These are a combination of default settings and their overrides from `settings` in - the configuration + the configuration. [1]: http://docs.aws.amazon.com/fr_fr/elasticbeanstalk/latest/dg/concepts.platforms.html - -