diff --git a/aws/resource_aws_neptune_event_subscription.go b/aws/resource_aws_neptune_event_subscription.go index e5fb2e0043b..7e2e1194087 100644 --- a/aws/resource_aws_neptune_event_subscription.go +++ b/aws/resource_aws_neptune_event_subscription.go @@ -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), diff --git a/aws/resource_aws_neptune_event_subscription_test.go b/aws/resource_aws_neptune_event_subscription_test.go index 45cb0d632d1..30a56c99ca9 100644 --- a/aws/resource_aws_neptune_event_subscription_test.go +++ b/aws/resource_aws_neptune_event_subscription_test.go @@ -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, + }, }, }) } @@ -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"}, + }, }, }) } @@ -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, + }, }, }) } @@ -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, + }, }, }) } diff --git a/website/docs/r/neptune_event_subscription.html.markdown b/website/docs/r/neptune_event_subscription.html.markdown index d036ee528b7..57fe1dae2bb 100644 --- a/website/docs/r/neptune_event_subscription.html.markdown +++ b/website/docs/r/neptune_event_subscription.html.markdown @@ -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. \ No newline at end of file +- `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 +```