diff --git a/aws/resource_aws_waf_ipset.go b/aws/resource_aws_waf_ipset.go index 39a744d1a59..e1e2746bf7e 100644 --- a/aws/resource_aws_waf_ipset.go +++ b/aws/resource_aws_waf_ipset.go @@ -17,6 +17,9 @@ func resourceAwsWafIPSet() *schema.Resource { Read: resourceAwsWafIPSetRead, Update: resourceAwsWafIPSetUpdate, Delete: resourceAwsWafIPSetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": &schema.Schema{ diff --git a/aws/resource_aws_waf_ipset_test.go b/aws/resource_aws_waf_ipset_test.go index df6175106af..de7b56aaded 100644 --- a/aws/resource_aws_waf_ipset_test.go +++ b/aws/resource_aws_waf_ipset_test.go @@ -38,6 +38,11 @@ func TestAccAWSWafIPSet_basic(t *testing.T) { regexp.MustCompile(`^arn:[\w-]+:waf::\d{12}:ipset/.+$`)), ), }, + { + ResourceName: "aws_waf_ipset.ipset", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/website/docs/r/waf_ipset.html.markdown b/website/docs/r/waf_ipset.html.markdown index 87b5f105feb..3b508d34d02 100644 --- a/website/docs/r/waf_ipset.html.markdown +++ b/website/docs/r/waf_ipset.html.markdown @@ -45,11 +45,17 @@ The following arguments are supported: * `value` - (Required) An IPv4 or IPv6 address specified via CIDR notation. e.g. `192.0.2.44/32` or `1111:0000:0000:0000:0000:0000:0000:0000/64` -## Remarks - ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `id` - The ID of the WAF IPSet. -* `arn` - The ARN of the WAF IPSet. \ No newline at end of file +* `arn` - The ARN of the WAF IPSet. + +## Import + +WAF IPSets can be imported using their ID, e.g. + +``` +$ terraform import aws_waf_ipset.example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc +```