providers/aws: launch configuration import
This commit is contained in:
parent
a992860b8d
commit
519f0ae4d6
|
@ -0,0 +1,29 @@
|
|||
package aws
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccAWSLaunchConfiguration_importBasic(t *testing.T) {
|
||||
resourceName := "aws_launch_configuration.bar"
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccAWSLaunchConfigurationNoNameConfig,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
ImportStateVerifyIgnore: []string{"user_data"},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
|
@ -24,6 +24,9 @@ func resourceAwsLaunchConfiguration() *schema.Resource {
|
|||
Create: resourceAwsLaunchConfigurationCreate,
|
||||
Read: resourceAwsLaunchConfigurationRead,
|
||||
Delete: resourceAwsLaunchConfigurationDelete,
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: schema.ImportStatePassthrough,
|
||||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
|
@ -110,8 +113,8 @@ func resourceAwsLaunchConfiguration() *schema.Resource {
|
|||
"associate_public_ip_address": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
Default: false,
|
||||
},
|
||||
|
||||
"spot_price": &schema.Schema{
|
||||
|
@ -495,6 +498,7 @@ func resourceAwsLaunchConfigurationRead(d *schema.ResourceData, meta interface{}
|
|||
d.Set("instance_type", lc.InstanceType)
|
||||
d.Set("name", lc.LaunchConfigurationName)
|
||||
|
||||
d.Set("associate_public_ip_address", lc.AssociatePublicIpAddress)
|
||||
d.Set("iam_instance_profile", lc.IamInstanceProfile)
|
||||
d.Set("ebs_optimized", lc.EbsOptimized)
|
||||
d.Set("spot_price", lc.SpotPrice)
|
||||
|
|
Loading…
Reference in New Issue