Skip to content

Commit

Permalink
Merge pull request #5491 from terraform-providers/f-aws_neptune_event…
Browse files Browse the repository at this point in the history
…_subscription-import

resource/aws_neptune_event_subscription: Support resource import
  • Loading branch information
bflad committed Aug 13, 2018
2 parents b472583 + 9c6c00f commit c996f69
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions aws/resource_aws_neptune_event_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func resourceAwsNeptuneEventSubscription() *schema.Resource {
Read: resourceAwsNeptuneEventSubscriptionRead,
Update: resourceAwsNeptuneEventSubscriptionUpdate,
Delete: resourceAwsNeptuneEventSubscriptionDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(40 * time.Minute),
Expand Down
21 changes: 21 additions & 0 deletions aws/resource_aws_neptune_event_subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ func TestAccAWSNeptuneEventSubscription_basic(t *testing.T) {
resource.TestCheckResourceAttr("aws_neptune_event_subscription.bar", "tags.Name", "tf-acc-test1"),
),
},
{
ResourceName: "aws_neptune_event_subscription.bar",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand All @@ -67,6 +72,12 @@ func TestAccAWSNeptuneEventSubscription_withPrefix(t *testing.T) {
"aws_neptune_event_subscription.bar", "name", startsWithPrefix),
),
},
{
ResourceName: "aws_neptune_event_subscription.bar",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name_prefix"},
},
},
})
}
Expand Down Expand Up @@ -100,6 +111,11 @@ func TestAccAWSNeptuneEventSubscription_withSourceIds(t *testing.T) {
"aws_neptune_event_subscription.bar", "source_ids.#", "2"),
),
},
{
ResourceName: "aws_neptune_event_subscription.bar",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down Expand Up @@ -133,6 +149,11 @@ func TestAccAWSNeptuneEventSubscription_withCategories(t *testing.T) {
"aws_neptune_event_subscription.bar", "event_categories.#", "1"),
),
},
{
ResourceName: "aws_neptune_event_subscription.bar",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down
10 changes: 9 additions & 1 deletion website/docs/r/neptune_event_subscription.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,12 @@ configuration options:

- `create` - (Default `40m`) How long to wait for creating event subscription to become available.
- `delete` - (Default `40m`) How long to wait for deleting event subscription to become fully deleted.
- `update` - (Default `40m`) How long to wait for updating event subscription to complete updates.
- `update` - (Default `40m`) How long to wait for updating event subscription to complete updates.

## Import

`aws_neptune_event_subscription` can be imported by using the event subscription name, e.g.

```
$ terraform import aws_neptune_event_subscription.example my-event-subscription
```

0 comments on commit c996f69

Please sign in to comment.