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,
|
Create: resourceAwsLaunchConfigurationCreate,
|
||||||
Read: resourceAwsLaunchConfigurationRead,
|
Read: resourceAwsLaunchConfigurationRead,
|
||||||
Delete: resourceAwsLaunchConfigurationDelete,
|
Delete: resourceAwsLaunchConfigurationDelete,
|
||||||
|
Importer: &schema.ResourceImporter{
|
||||||
|
State: schema.ImportStatePassthrough,
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": &schema.Schema{
|
||||||
|
@ -110,8 +113,8 @@ func resourceAwsLaunchConfiguration() *schema.Resource {
|
||||||
"associate_public_ip_address": &schema.Schema{
|
"associate_public_ip_address": &schema.Schema{
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Default: false,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"spot_price": &schema.Schema{
|
"spot_price": &schema.Schema{
|
||||||
|
@ -495,6 +498,7 @@ func resourceAwsLaunchConfigurationRead(d *schema.ResourceData, meta interface{}
|
||||||
d.Set("instance_type", lc.InstanceType)
|
d.Set("instance_type", lc.InstanceType)
|
||||||
d.Set("name", lc.LaunchConfigurationName)
|
d.Set("name", lc.LaunchConfigurationName)
|
||||||
|
|
||||||
|
d.Set("associate_public_ip_address", lc.AssociatePublicIpAddress)
|
||||||
d.Set("iam_instance_profile", lc.IamInstanceProfile)
|
d.Set("iam_instance_profile", lc.IamInstanceProfile)
|
||||||
d.Set("ebs_optimized", lc.EbsOptimized)
|
d.Set("ebs_optimized", lc.EbsOptimized)
|
||||||
d.Set("spot_price", lc.SpotPrice)
|
d.Set("spot_price", lc.SpotPrice)
|
||||||
|
|
Loading…
Reference in New Issue