-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Conversation
There was a problem hiding this 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. 👍
"github.com/hashicorp/terraform/helper/resource" | ||
"github.com/hashicorp/terraform/helper/schema" |
There was a problem hiding this comment.
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):
"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": { |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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 @@ | |||
--- |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
# 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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typos 😎
* `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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<a id="timeouts"></a> |
- `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. |
There was a problem hiding this comment.
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:
- `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. |
There was a problem hiding this 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)
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) ```
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! |
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! |
Closes #3057
Changes proposed in this pull request:
dms_event_subscription
resourceOutput from acceptance testing: