Skip to content

Commit

Permalink
provider/aws: Import aws_db_event_subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
AMeng committed Oct 4, 2016
1 parent 828aa7c commit 662de0f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
29 changes: 29 additions & 0 deletions builtin/providers/aws/import_aws_db_event_subscription_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package aws

import (
"os"
"testing"

"github.com/hashicorp/terraform/helper/resource"
)

func TestAccAWSDBEventSubscription_importBasic(t *testing.T) {
resourceName := "aws_db_event_subscription.bar"

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSDBEventSubscriptionDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccAWSDBEventSubscriptionConfig,
},

resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
3 changes: 3 additions & 0 deletions builtin/providers/aws/resource_aws_db_event_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func resourceAwsDbEventSubscription() *schema.Resource {
Read: resourceAwsDbEventSubscriptionRead,
Update: resourceAwsDbEventSubscriptionUpdate,
Delete: resourceAwsDbEventSubscriptionDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Expand Down
1 change: 1 addition & 0 deletions website/source/docs/import/importability.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ To make a resource importable, please see the
* aws_cloudwatch_log_group
* aws_cloudwatch_metric_alarm
* aws_customer_gateway
* aws_db_event_subscription
* aws_db_instance
* aws_db_option_group
* aws_db_parameter_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ The following arguments are supported:
* `event_categories` - (Optional) A list of event categories for a SourceType that you want to subscribe to.
* `enabled` - (Optional) A boolean flag to enable/disable the subscription. Defaults to true.
* `tags` - (Optional) A mapping of tags to assign to the resource.


## Import

DB Event Subscriptions can be imported using the `name`, e.g.

```
$ terraform import aws_db_event_subscription.default rds-event-sub
```

0 comments on commit 662de0f

Please sign in to comment.