From 1170111c7eb498590dd9d411fe3ae516e6f95a49 Mon Sep 17 00:00:00 2001 From: Tomotaka Sakuma Date: Sun, 2 Nov 2014 08:21:55 +0900 Subject: [PATCH 1/2] support associate_public_ip_address for aws_launch_configuration --- builtin/providers/aws/resource_aws_launch_configuration.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/builtin/providers/aws/resource_aws_launch_configuration.go b/builtin/providers/aws/resource_aws_launch_configuration.go index 0cb80c395..0b3fcacb5 100644 --- a/builtin/providers/aws/resource_aws_launch_configuration.go +++ b/builtin/providers/aws/resource_aws_launch_configuration.go @@ -75,6 +75,12 @@ func resourceAwsLaunchConfiguration() *schema.Resource { return hashcode.String(v.(string)) }, }, + + "associate_public_ip_address": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Default: false, + }, }, } } @@ -90,6 +96,7 @@ func resourceAwsLaunchConfigurationCreate(d *schema.ResourceData, meta interface createLaunchConfigurationOpts.InstanceType = d.Get("instance_type").(string) createLaunchConfigurationOpts.KeyName = d.Get("key_name").(string) createLaunchConfigurationOpts.UserData = d.Get("user_data").(string) + createLaunchConfigurationOpts.AssociatePublicIpAddress = d.Get("associate_public_ip_address").(bool) if v, ok := d.GetOk("security_groups"); ok { createLaunchConfigurationOpts.SecurityGroups = expandStringList( From db8256a4a780e96488184e84e99a252474034255 Mon Sep 17 00:00:00 2001 From: Tomotaka Sakuma Date: Mon, 24 Nov 2014 13:26:03 +0900 Subject: [PATCH 2/2] add associate_public_ip_address attr to the acceptance test of aws_launch_configuration --- .../providers/aws/resource_aws_launch_configuration_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/providers/aws/resource_aws_launch_configuration_test.go b/builtin/providers/aws/resource_aws_launch_configuration_test.go index 820cdf723..e38eecddb 100644 --- a/builtin/providers/aws/resource_aws_launch_configuration_test.go +++ b/builtin/providers/aws/resource_aws_launch_configuration_test.go @@ -28,6 +28,8 @@ func TestAccAWSLaunchConfiguration(t *testing.T) { "aws_launch_configuration.bar", "name", "foobar-terraform-test"), resource.TestCheckResourceAttr( "aws_launch_configuration.bar", "instance_type", "t1.micro"), + resource.TestCheckResourceAttr( + "aws_launch_configuration.bar", "associate_public_ip_address", "true"), ), }, }, @@ -124,5 +126,6 @@ resource "aws_launch_configuration" "bar" { image_id = "ami-21f78e11" instance_type = "t1.micro" user_data = "foobar-user-data" + associate_public_ip_address = true } `