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 aws_redshift_scheduled_action resource #13474

Merged
merged 27 commits into from
Sep 29, 2021
Merged

Add aws_redshift_scheduled_action resource #13474

merged 27 commits into from
Sep 29, 2021

Conversation

waneal
Copy link

@waneal waneal commented May 23, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #12745

Release note for CHANGELOG:

New Resource: aws_redshift_scheduled_action

Output from acceptance testing:

make testacc TEST=./aws TESTARGS='-run=TestAccAWSRedshiftScheduledAction'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSRedshiftScheduledAction -timeout 120m
=== RUN   TestAccAWSRedshiftScheduledActionPauseCluster_basic
=== PAUSE TestAccAWSRedshiftScheduledActionPauseCluster_basic
=== RUN   TestAccAWSRedshiftScheduledActionPauseCluster_WithOptions
=== PAUSE TestAccAWSRedshiftScheduledActionPauseCluster_WithOptions
=== RUN   TestAccAWSRedshiftScheduledActionResumeCluster_basic
=== PAUSE TestAccAWSRedshiftScheduledActionResumeCluster_basic
=== RUN   TestAccAWSRedshiftScheduledActionResizeCluster_basic
=== PAUSE TestAccAWSRedshiftScheduledActionResizeCluster_basic
=== RUN   TestAccAWSRedshiftScheduledActionResizeCluster_WithOptions
=== PAUSE TestAccAWSRedshiftScheduledActionResizeCluster_WithOptions
=== CONT  TestAccAWSRedshiftScheduledActionPauseCluster_basic
=== CONT  TestAccAWSRedshiftScheduledActionResizeCluster_basic
=== CONT  TestAccAWSRedshiftScheduledActionResumeCluster_basic
=== CONT  TestAccAWSRedshiftScheduledActionPauseCluster_WithOptions
=== CONT  TestAccAWSRedshiftScheduledActionResizeCluster_WithOptions
--- PASS: TestAccAWSRedshiftScheduledActionPauseCluster_WithOptions (51.01s)
--- PASS: TestAccAWSRedshiftScheduledActionResizeCluster_WithOptions (51.24s)
--- PASS: TestAccAWSRedshiftScheduledActionResizeCluster_basic (75.16s)
--- PASS: TestAccAWSRedshiftScheduledActionResumeCluster_basic (75.98s)
--- PASS: TestAccAWSRedshiftScheduledActionPauseCluster_basic (76.85s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       79.310s

@waneal waneal requested a review from a team May 23, 2020 15:41
@ghost ghost added size/L Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. provider Pertains to the provider itself, rather than any interaction with AWS. service/redshift Issues and PRs that pertain to the redshift service. labels May 23, 2020
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. and removed size/L Managed by automation to categorize the size of a PR. labels Jun 6, 2020
@waneal waneal changed the title [WIP]Redshift scheduled actions Redshift scheduled actions Jun 6, 2020
@waneal waneal changed the title Redshift scheduled actions Add aws_redshift_scheduled_action resource Jun 9, 2020
Comment on lines 177 to 188
if aws.TimeValue(scheduledAction.StartTime).Format(time.RFC3339) != "0001-01-01T00:00:00Z" {
d.Set("start_time", aws.TimeValue(scheduledAction.StartTime).Format(time.RFC3339))
}

if aws.TimeValue(scheduledAction.EndTime).Format(time.RFC3339) != "0001-01-01T00:00:00Z" {
d.Set("end_time", aws.TimeValue(scheduledAction.EndTime).Format(time.RFC3339))
}
Copy link
Author

Choose a reason for hiding this comment

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

If each of StartTime and EndTime are not set, "0001-01-01T00:00:00Z" was returned. So when it was returned, start_time and end_time are not set.

Copy link
Contributor

Choose a reason for hiding this comment

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

You may be able to check against scheduledAction.StartTime != nil and scheduledAction.EndTime != nil instead 👍

Copy link
Author

Choose a reason for hiding this comment

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

@bflad Thank you for telling, I fixed it!

@tomaszdudek7
Copy link

So, any chance of merging it soon?

@waneal
Copy link
Author

waneal commented Jul 11, 2020

@bflad Do I have to do more things? Or wait for review?

@teamterraform
Copy link

Notification of Recent and Upcoming Changes to Contributions

Thank you for this contribution! There have been a few recent development changes that affect this pull request. We apologize for the inconvenience, especially if there have been long review delays up until now. Please note that this is automated message from an unmonitored account. See the FAQ for additional information on the maintainer team and review prioritization.

If you are unable to complete these updates, please leave a comment for the community and maintainers so someone can potentially continue the work. The maintainers will encourage other contributors to use the existing contribution as the base for additional changes as appropriate. Otherwise, contributions that do not receive updated code or comments from the original contributor may be closed in the future so the maintainers can focus on active items.

For the most up to date information about Terraform AWS Provider development, see the Contributing Guide. Additional technical debt changes can be tracked with the technical-debt label on issues.

As part of updating a pull request with these changes, the most current unit testing and linting will run. These may report issues that were not previously reported.

Terraform 0.12 Syntax

Reference: #8950
Reference: #14417

Version 3 and later of the Terraform AWS Provider, which all existing contributions would potentially be added, only supports Terraform 0.12 and later. Certain syntax elements of Terraform 0.11 and earlier show deprecation warnings during runs with Terraform 0.12. Documentation and test configurations, such as those including deprecated string interpolations (some_attribute = "${aws_service_thing.example.id}") should be updated to the newer syntax (some_attribute = aws_service_thing.example.id). Contribution testing will automatically fail on older syntax in the near future. Please see the referenced issues for additional information.

Action Required: Terraform Plugin SDK Version 2

Reference: #14551

The Terraform AWS Provider has been upgraded to the latest version of the Terraform Plugin SDK. Generally, most changes to contributions should only involve updating Go import paths in source code files. Please see the referenced issue for additional information.

Action Required: Removal of website/aws.erb File

Reference: #14712

Any changes to the website/aws.erb file are no longer necessary and should be removed from this contribution to prevent merge issues in the near future when the file is removed from the repository. Please see the referenced issue for additional information.

Upcoming Change of Git Branch Naming

Reference: #14292

Development environments will need their upstream Git branch updated from master to main in the near future. Please see the referenced issue for additional information and scheduling.

Upcoming Change of GitHub Organization

Reference: #14715

This repository will be migrating from https://github.com/terraform-providers/terraform-provider-aws to https://github.com/hashicorp/terraform-provider-aws. No practitioner or developer action is anticipated and most GitHub functionality will automatically redirect to the new location. Go import paths including terraform-providers can remain for now. Please see the referenced issue for additional information and scheduling.

@waneal
Copy link
Author

waneal commented Sep 1, 2020

I will update by end of September!

@waneal
Copy link
Author

waneal commented Sep 6, 2020

> make testacc TEST=./aws TESTARGS='-run=TestAccAWSRedshiftScheduledAction'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSRedshiftScheduledAction -timeout 120m
=== RUN   TestAccAWSRedshiftScheduledActionPauseCluster_basic
=== PAUSE TestAccAWSRedshiftScheduledActionPauseCluster_basic
=== RUN   TestAccAWSRedshiftScheduledActionPauseCluster_WithOptions
=== PAUSE TestAccAWSRedshiftScheduledActionPauseCluster_WithOptions
=== RUN   TestAccAWSRedshiftScheduledActionResumeCluster_basic
=== PAUSE TestAccAWSRedshiftScheduledActionResumeCluster_basic
=== RUN   TestAccAWSRedshiftScheduledActionResizeCluster_basic
=== PAUSE TestAccAWSRedshiftScheduledActionResizeCluster_basic
=== RUN   TestAccAWSRedshiftScheduledActionResizeCluster_WithOptions
=== PAUSE TestAccAWSRedshiftScheduledActionResizeCluster_WithOptions
=== CONT  TestAccAWSRedshiftScheduledActionPauseCluster_basic
=== CONT  TestAccAWSRedshiftScheduledActionResizeCluster_basic
=== CONT  TestAccAWSRedshiftScheduledActionResizeCluster_WithOptions
=== CONT  TestAccAWSRedshiftScheduledActionResumeCluster_basic
=== CONT  TestAccAWSRedshiftScheduledActionPauseCluster_WithOptions
--- PASS: TestAccAWSRedshiftScheduledActionResizeCluster_WithOptions (70.56s)
--- PASS: TestAccAWSRedshiftScheduledActionPauseCluster_WithOptions (72.91s)
--- PASS: TestAccAWSRedshiftScheduledActionResumeCluster_basic (107.14s)
--- PASS: TestAccAWSRedshiftScheduledActionResizeCluster_basic (107.36s)
--- PASS: TestAccAWSRedshiftScheduledActionPauseCluster_basic (107.87s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       109.269s

@waneal
Copy link
Author

waneal commented Oct 1, 2020

Can someone review this please?

@tedivm
Copy link

tedivm commented Dec 2, 2020

I'd love to be able to use this or somethign similar. AWS has updated the functionality around this as well.

@mohsen0
Copy link

mohsen0 commented Jan 19, 2021

Hi Guys, any update on this PR?

Base automatically changed from master to main January 23, 2021 00:57
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:57
@Chagui-
Copy link

Chagui- commented Mar 30, 2021

Hoping this PR doesn't get lost after so much time.

@waneal
Copy link
Author

waneal commented Jun 18, 2021

1 year has passed since this pull request got ready, please someone review

@breathingdust breathingdust added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 21, 2021
@github-actions github-actions bot added the service/iam Issues and PRs that pertain to the iam service. label Sep 29, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

Commercial
% make testacc TESTARGS='-run=TestAccAWSRedshiftScheduledAction_'                                                      
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSRedshiftScheduledAction_ -timeout 180m
=== RUN   TestAccAWSRedshiftScheduledAction_basicPauseCluster
=== PAUSE TestAccAWSRedshiftScheduledAction_basicPauseCluster
=== RUN   TestAccAWSRedshiftScheduledAction_PauseClusterWithOptions
=== PAUSE TestAccAWSRedshiftScheduledAction_PauseClusterWithOptions
=== RUN   TestAccAWSRedshiftScheduledAction_basicResumeCluster
=== PAUSE TestAccAWSRedshiftScheduledAction_basicResumeCluster
=== RUN   TestAccAWSRedshiftScheduledAction_basicResizeCluster
=== PAUSE TestAccAWSRedshiftScheduledAction_basicResizeCluster
=== RUN   TestAccAWSRedshiftScheduledAction_ResizeClusterWithOptions
=== PAUSE TestAccAWSRedshiftScheduledAction_ResizeClusterWithOptions
=== RUN   TestAccAWSRedshiftScheduledAction_disappears
=== PAUSE TestAccAWSRedshiftScheduledAction_disappears
=== CONT  TestAccAWSRedshiftScheduledAction_basicPauseCluster
=== CONT  TestAccAWSRedshiftScheduledAction_ResizeClusterWithOptions
=== CONT  TestAccAWSRedshiftScheduledAction_disappears
=== CONT  TestAccAWSRedshiftScheduledAction_basicResumeCluster
=== CONT  TestAccAWSRedshiftScheduledAction_basicResizeCluster
=== CONT  TestAccAWSRedshiftScheduledAction_PauseClusterWithOptions
--- PASS: TestAccAWSRedshiftScheduledAction_disappears (28.22s)
--- PASS: TestAccAWSRedshiftScheduledAction_PauseClusterWithOptions (31.07s)
--- PASS: TestAccAWSRedshiftScheduledAction_ResizeClusterWithOptions (31.21s)
--- PASS: TestAccAWSRedshiftScheduledAction_basicResumeCluster (45.87s)
--- PASS: TestAccAWSRedshiftScheduledAction_basicPauseCluster (45.88s)
--- PASS: TestAccAWSRedshiftScheduledAction_basicResizeCluster (45.89s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	49.841s
GovCloud
% make testacc TESTARGS='-run=TestAccAWSRedshiftScheduledAction_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSRedshiftScheduledAction_ -timeout 180m
=== RUN   TestAccAWSRedshiftScheduledAction_basicPauseCluster
=== PAUSE TestAccAWSRedshiftScheduledAction_basicPauseCluster
=== RUN   TestAccAWSRedshiftScheduledAction_PauseClusterWithOptions
=== PAUSE TestAccAWSRedshiftScheduledAction_PauseClusterWithOptions
=== RUN   TestAccAWSRedshiftScheduledAction_basicResumeCluster
=== PAUSE TestAccAWSRedshiftScheduledAction_basicResumeCluster
=== RUN   TestAccAWSRedshiftScheduledAction_basicResizeCluster
=== PAUSE TestAccAWSRedshiftScheduledAction_basicResizeCluster
=== RUN   TestAccAWSRedshiftScheduledAction_ResizeClusterWithOptions
=== PAUSE TestAccAWSRedshiftScheduledAction_ResizeClusterWithOptions
=== RUN   TestAccAWSRedshiftScheduledAction_disappears
=== PAUSE TestAccAWSRedshiftScheduledAction_disappears
=== CONT  TestAccAWSRedshiftScheduledAction_basicPauseCluster
=== CONT  TestAccAWSRedshiftScheduledAction_ResizeClusterWithOptions
=== CONT  TestAccAWSRedshiftScheduledAction_basicResizeCluster
=== CONT  TestAccAWSRedshiftScheduledAction_PauseClusterWithOptions
=== CONT  TestAccAWSRedshiftScheduledAction_basicResumeCluster
=== CONT  TestAccAWSRedshiftScheduledAction_disappears
--- PASS: TestAccAWSRedshiftScheduledAction_disappears (32.61s)
--- PASS: TestAccAWSRedshiftScheduledAction_PauseClusterWithOptions (35.95s)
--- PASS: TestAccAWSRedshiftScheduledAction_ResizeClusterWithOptions (36.04s)
--- PASS: TestAccAWSRedshiftScheduledAction_basicPauseCluster (51.05s)
--- PASS: TestAccAWSRedshiftScheduledAction_basicResizeCluster (51.12s)
--- PASS: TestAccAWSRedshiftScheduledAction_basicResumeCluster (53.16s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	56.301s

@ewbankkit ewbankkit merged commit e34c315 into hashicorp:main Sep 29, 2021
@github-actions github-actions bot added this to the v3.61.0 milestone Sep 29, 2021
@waneal
Copy link
Author

waneal commented Oct 4, 2021

@ewbankkit Thank you for fixing!

@waneal waneal deleted the redshift-scheduled-actions branch October 4, 2021 09:43
@github-actions
Copy link

github-actions bot commented Oct 7, 2021

This functionality has been released in v3.61.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. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2022
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. service/iam Issues and PRs that pertain to the iam service. service/redshift Issues and PRs that pertain to the redshift service. 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.

Add support for Redshift scheduled actions
10 participants