diff --git a/builtin/providers/aws/import_aws_ses_receipt_filter_test.go b/builtin/providers/aws/import_aws_ses_receipt_filter_test.go new file mode 100644 index 000000000..ecc962b85 --- /dev/null +++ b/builtin/providers/aws/import_aws_ses_receipt_filter_test.go @@ -0,0 +1,28 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSSESReceiptFilter_importBasic(t *testing.T) { + resourceName := "aws_ses_receipt_filter.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckSESReceiptFilterDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSSESReceiptFilterConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_ses_receipt_filter.go b/builtin/providers/aws/resource_aws_ses_receipt_filter.go index 4ea7ccad2..2242d7eca 100644 --- a/builtin/providers/aws/resource_aws_ses_receipt_filter.go +++ b/builtin/providers/aws/resource_aws_ses_receipt_filter.go @@ -14,6 +14,9 @@ func resourceAwsSesReceiptFilter() *schema.Resource { Create: resourceAwsSesReceiptFilterCreate, Read: resourceAwsSesReceiptFilterRead, Delete: resourceAwsSesReceiptFilterDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": &schema.Schema{ @@ -77,6 +80,7 @@ func resourceAwsSesReceiptFilterRead(d *schema.ResourceData, meta interface{}) e if *element.Name == d.Id() { d.Set("cidr", element.IpFilter.Cidr) d.Set("policy", element.IpFilter.Policy) + d.Set("name", element.Name) found = true } }