Merge pull request #7294 from hashicorp/import-aws-iampp

provider/aws: Support Import for `aws_iam_account_password_policy`
This commit is contained in:
James Nugent 2016-06-24 14:44:36 +03:00 committed by GitHub
commit 51af5e793d
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package aws
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccAWSIAMAccountPasswordPolicy_importBasic(t *testing.T) {
resourceName := "aws_iam_account_password_policy.default"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSIAMAccountPasswordPolicyDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccAWSIAMAccountPasswordPolicy,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

View File

@ -17,6 +17,9 @@ func resourceAwsIamAccountPasswordPolicy() *schema.Resource {
Read: resourceAwsIamAccountPasswordPolicyRead,
Update: resourceAwsIamAccountPasswordPolicyUpdate,
Delete: resourceAwsIamAccountPasswordPolicyDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"allow_users_to_change_password": &schema.Schema{