Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/aws_neptune_event_subscription: Support resource import #5491

Merged
merged 1 commit into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```