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

Feature/add importer for asg scheduled action #8300

Conversation

taxpon
Copy link
Contributor

@taxpon taxpon commented Apr 12, 2019

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #5617

Changes proposed in this pull request:

  • App the importer for autoscaling group scheduled action

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSAutoscalingSchedule_basicImport'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSAutoscalingSchedule_basicImport -timeout 120m
=== RUN   TestAccAWSAutoscalingSchedule_basicImport
=== PAUSE TestAccAWSAutoscalingSchedule_basicImport
=== CONT  TestAccAWSAutoscalingSchedule_basicImport
--- PASS: TestAccAWSAutoscalingSchedule_basicImport (272.65s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       272.703s
...

@ghost ghost added documentation Introduces or discusses updates to documentation. service/applicationautoscaling service/autoscaling Issues and PRs that pertain to the autoscaling service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. labels Apr 12, 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 @taxpon 👋 This is off to a good start. Two things and we should be able to get this in. Thanks!

testAccCheckScalingScheduleExists("aws_autoscaling_schedule.foobar", &schedule),
),
},
// Test existent resource import
Copy link
Contributor

@bflad bflad Apr 24, 2019

Choose a reason for hiding this comment

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

Instead of creating a new acceptance test that requires creating duplicate testing infrastructure, the new ImportStateVerify: true TestStep should be added to all acceptance tests for the resource (except _disappears) to verify that each resource configuration successfully imports. This can find issues in the resource Read function where we are not properly refreshing the Terraform state. The non-existent resource import TestStep can be added just to the _basic test. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 644a638

@@ -87,3 +87,11 @@ The following arguments are supported:
In addition to all arguments above, the following attributes are exported:

* `arn` - The Amazon Resource Name (ARN) of the scheduled action.

## Import
Copy link
Contributor

Choose a reason for hiding this comment

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

This documentation was added to the aws_appautoscaling_scheduled_action resource page instead of website/docs/r/autoscaling_schedule.html.markdown 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I am sorry for the poor mistake..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 850642a

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Apr 24, 2019
@taxpon taxpon force-pushed the feature-5617-add-importer-for-asg-scheduled-action branch from d7f98c8 to 850642a Compare April 26, 2019 08:09
@taxpon
Copy link
Contributor Author

taxpon commented Apr 26, 2019

@bflad Thank you for your reviewing. I fixed them. Please review this PR again. This is the results of test running:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSAutoscalingSchedule'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSAutoscalingSchedule -timeout 120m
=== RUN   TestAccAWSAutoscalingSchedule_basic
=== PAUSE TestAccAWSAutoscalingSchedule_basic
=== RUN   TestAccAWSAutoscalingSchedule_disappears
=== PAUSE TestAccAWSAutoscalingSchedule_disappears
=== RUN   TestAccAWSAutoscalingSchedule_recurrence
=== PAUSE TestAccAWSAutoscalingSchedule_recurrence
=== RUN   TestAccAWSAutoscalingSchedule_zeroValues
=== PAUSE TestAccAWSAutoscalingSchedule_zeroValues
=== RUN   TestAccAWSAutoscalingSchedule_negativeOne
=== PAUSE TestAccAWSAutoscalingSchedule_negativeOne
=== CONT  TestAccAWSAutoscalingSchedule_basic
=== CONT  TestAccAWSAutoscalingSchedule_zeroValues
=== CONT  TestAccAWSAutoscalingSchedule_negativeOne
=== CONT  TestAccAWSAutoscalingSchedule_recurrence
=== CONT  TestAccAWSAutoscalingSchedule_disappears
--- PASS: TestAccAWSAutoscalingSchedule_disappears (115.73s)
--- PASS: TestAccAWSAutoscalingSchedule_negativeOne (141.48s)
--- PASS: TestAccAWSAutoscalingSchedule_zeroValues (141.76s)
--- PASS: TestAccAWSAutoscalingSchedule_recurrence (141.88s)
--- PASS: TestAccAWSAutoscalingSchedule_basic (144.29s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       147.951s

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Apr 26, 2019
@taxpon
Copy link
Contributor Author

taxpon commented May 13, 2019

@bflad Could you kindly review this again?

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. and removed service/applicationautoscaling labels May 13, 2019
@bflad bflad added this to the v2.11.0 milestone May 13, 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.

Thanks for the gentle reminder, @taxpon! Looks good. 🚀

--- PASS: TestAccAWSAutoscalingSchedule_disappears (107.93s)
--- PASS: TestAccAWSAutoscalingSchedule_recurrence (109.90s)
--- PASS: TestAccAWSAutoscalingSchedule_basic (111.21s)
--- PASS: TestAccAWSAutoscalingSchedule_zeroValues (141.73s)
--- PASS: TestAccAWSAutoscalingSchedule_negativeOne (142.12s)

@bflad bflad merged commit dd1cb43 into hashicorp:master May 13, 2019
bflad added a commit that referenced this pull request May 13, 2019
@taxpon taxpon deleted the feature-5617-add-importer-for-asg-scheduled-action branch May 14, 2019 07:05
@bflad
Copy link
Contributor

bflad commented May 17, 2019

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

@ghost
Copy link

ghost commented Mar 30, 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 Mar 30, 2020
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. enhancement Requests to existing resources that expand the functionality or scope. service/autoscaling Issues and PRs that pertain to the autoscaling service. size/M 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.

Import aws_autoscaling_schedule (just not documented?)
2 participants