Skip to content

Commit

Permalink
Merge pull request #4979 from terraform-providers/f-aws_waf_ipset-import
Browse files Browse the repository at this point in the history
resource/aws_waf_ipset: Support resource import
  • Loading branch information
bflad authored Jun 25, 2018
2 parents 0490212 + 742357c commit 24e937a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions aws/resource_aws_waf_ipset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
5 changes: 5 additions & 0 deletions aws/resource_aws_waf_ipset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
})
}
Expand Down
12 changes: 9 additions & 3 deletions website/docs/r/waf_ipset.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* `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
```

0 comments on commit 24e937a

Please sign in to comment.