Merge pull request #9220 from AMeng/import-db-event-sub
provider/aws: Import aws_db_event_subscription
This commit is contained in:
commit
aa97ebd0e7
|
@ -0,0 +1,28 @@
|
||||||
|
package aws
|
||||||
|
|
||||||
|
import (
|
||||||
|
"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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
|
@ -18,6 +18,9 @@ func resourceAwsDbEventSubscription() *schema.Resource {
|
||||||
Read: resourceAwsDbEventSubscriptionRead,
|
Read: resourceAwsDbEventSubscriptionRead,
|
||||||
Update: resourceAwsDbEventSubscriptionUpdate,
|
Update: resourceAwsDbEventSubscriptionUpdate,
|
||||||
Delete: resourceAwsDbEventSubscriptionDelete,
|
Delete: resourceAwsDbEventSubscriptionDelete,
|
||||||
|
Importer: &schema.ResourceImporter{
|
||||||
|
State: schema.ImportStatePassthrough,
|
||||||
|
},
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
|
|
@ -35,6 +35,7 @@ To make a resource importable, please see the
|
||||||
* aws_cloudwatch_log_group
|
* aws_cloudwatch_log_group
|
||||||
* aws_cloudwatch_metric_alarm
|
* aws_cloudwatch_metric_alarm
|
||||||
* aws_customer_gateway
|
* aws_customer_gateway
|
||||||
|
* aws_db_event_subscription
|
||||||
* aws_db_instance
|
* aws_db_instance
|
||||||
* aws_db_option_group
|
* aws_db_option_group
|
||||||
* aws_db_parameter_group
|
* aws_db_parameter_group
|
||||||
|
|
|
@ -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.
|
* `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.
|
* `enabled` - (Optional) A boolean flag to enable/disable the subscription. Defaults to true.
|
||||||
* `tags` - (Optional) A mapping of tags to assign to the resource.
|
* `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
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue