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

Add dms_event_subscription resource #7170

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

hawknewton
Copy link
Contributor

@hawknewton hawknewton commented Jan 17, 2019

Closes #3057

Changes proposed in this pull request:

  • Add dms_event_subscription resource

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSDmsEventSubscriptionBasic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSDmsEventSubscriptionBasic -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]


=== RUN   TestAccAWSDmsEventSubscriptionBasic
=== PAUSE TestAccAWSDmsEventSubscriptionBasic
=== CONT  TestAccAWSDmsEventSubscriptionBasic
--- PASS: TestAccAWSDmsEventSubscriptionBasic (797.93s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       797.967s
$

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/databasemigrationservice tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 17, 2019
@aeschright aeschright requested a review from a team June 25, 2019 22:09
@aeschright aeschright added the new-resource Introduces a new resource. label Aug 19, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hawknewton 👋 Thank you for submitting this and apologies for the delayed review. Please see the below initial feedback and reach out if you have any questions or do not have time to implement the items. 👍

Comment on lines +10 to +11
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this pull request has been introduced, we have moved to the standalone Terraform Plugin SDK repository (this will need to be fixed in all files here):

Suggested change
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"

Set: schema.HashString,
Required: true,
},
"name": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We can provide simple plan-time validation for this attribute via ValidateFunc: validation.StringLenBetween(1, 255) 👍

Required: true,
ForceNew: true,
},
"sns_topic_arn": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We can provide simple plan-time validation for this attribute via ValidateFunc: validateArn 👍

ForceNew: true,
Optional: true,
},
"source_type": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We can provide simple plan-time validation for this attribute via the below 👍

ValidateFunc: validation.StringInSlice([]string{
  "replication-instance",
  "replication-task",
}, false),

// The API suppors modification but doing so loses all source_ids
ForceNew: true,
},
"tags": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the introduction of this pull request, tagging support in the provider codebase has moved to a shared package, keyvaluetags: #10688

The issue description highlights all the steps to refactor this functionality, although notably it looks like the Read and Update functions below are missing tags handling, so that will need to be added. The Contributing Guide section on Adding Resource Tagging Support shows how to add acceptance testing for this.

@@ -0,0 +1,59 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI will now catch this, but this is missing a sidebar link in website/aws.erb

Provides a DMS (Data Migration Service) event subscription resource.
---

# aws_dms_event_subscription
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation now includes a prefix in the title for additional clarity

Suggested change
# aws_dms_event_subscription
# Resource: aws_dms_event_subscription

* `name` - (Required) Name of event subscription.
* `enabled` - (Optional, Default: true) Whether the event subscription should be enabled.
* `event_categories` - (Optional) List of event categories to listen for, see `DescribeEventCategories` for a canonical list.
* `source_type` - (Optional, Default: all events) If specificed may be either `replication-instance` or `migration-task`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typos 😎

Suggested change
* `source_type` - (Optional, Default: all events) If specificed may be either `replication-instance` or `migration-task`
* `source_type` - (Optional, Default: all events) Type of source for events. Valid values: `replication-instance` or `replication-task`

* `source_ids` - (Required) Ids of sources to listen to.
* `sns_topic_arn` - (Required) SNS topic arn to send events on.

<a id="timeouts"></a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<a id="timeouts"></a>

Comment on lines +49 to +51
- `create` - (Default `30 minutes`) Used for creating event subscriptions.
- `update` - (Default `30 minutes`) Used for event subscription modifications.
- `delete` - (Default `30 minutes`) Used for destroying event descriptions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values should match the resource code:

Suggested change
- `create` - (Default `30 minutes`) Used for creating event subscriptions.
- `update` - (Default `30 minutes`) Used for event subscription modifications.
- `delete` - (Default `30 minutes`) Used for destroying event descriptions.
- `create` - (Default `10m`) Used for creating event subscriptions.
- `update` - (Default `10m`) Used for event subscription modifications.
- `delete` - (Default `10m`) Used for destroying event descriptions.

@bflad bflad self-assigned this Mar 17, 2020
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Mar 17, 2020
@bflad bflad added this to the v2.58.0 milestone Apr 15, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi again @hawknewton 👋 Since we haven't heard back from you, we have implemented the review feedback in a followup commit. Thank you for working on this.

Output from acceptance testing:

--- PASS: TestAccAWSDmsEventSubscription_basic (481.92s)
--- PASS: TestAccAWSDmsEventSubscription_disappears (500.31s)
--- PASS: TestAccAWSDmsEventSubscription_Enabled (584.73s)
--- PASS: TestAccAWSDmsEventSubscription_EventCategories (601.53s)
--- PASS: TestAccAWSDmsEventSubscription_Tags (540.87s)

bflad added a commit that referenced this pull request Apr 15, 2020
Reference: #7170 (review)

Output from acceptance testing:

```
--- PASS: TestAccAWSDmsEventSubscription_basic (481.92s)
--- PASS: TestAccAWSDmsEventSubscription_disappears (500.31s)
--- PASS: TestAccAWSDmsEventSubscription_Enabled (584.73s)
--- PASS: TestAccAWSDmsEventSubscription_EventCategories (601.53s)
--- PASS: TestAccAWSDmsEventSubscription_Tags (540.87s)
```
@bflad bflad merged commit e9447a9 into hashicorp:master Apr 15, 2020
bflad added a commit that referenced this pull request Apr 15, 2020
@ghost
Copy link

ghost commented Apr 17, 2020

This has been released in version 2.58.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented May 15, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators May 15, 2020
@breathingdust breathingdust removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform doesn't support event subscription in DMS
4 participants