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 support import Autoscaling Lifecycle Hook #9336

Merged

Conversation

chaspy
Copy link
Contributor

@chaspy chaspy commented Jul 14, 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 #9142

Release note for CHANGELOG:

resource/aws_autoscaling_lifecycle_hook: Support resource import

Output from acceptance testing:

$ make testacc TESTARGS="-run=TestAccAWSAutoscalingLifecycleHook_basic"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSAutoscalingLifecycleHook_basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSAutoscalingLifecycleHook_basic
=== PAUSE TestAccAWSAutoscalingLifecycleHook_basic
=== CONT  TestAccAWSAutoscalingLifecycleHook_basic
--- PASS: TestAccAWSAutoscalingLifecycleHook_basic (164.47s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	164.539s

Basically, same with 46f4549 . Thank you for the implementation and great support me @kterada0509 🙏

@chaspy chaspy requested a review from a team July 14, 2019 13:11
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/autoscaling Issues and PRs that pertain to the autoscaling service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. size/S Managed by automation to categorize the size of a PR. labels Jul 14, 2019
@chaspy chaspy force-pushed the chaspy/import_aws_autoscaling_lifecycle_hook branch from 12b988c to a42f4a7 Compare July 15, 2019 11:16
@ghost ghost added documentation Introduces or discusses updates to documentation. size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Jul 15, 2019
@chaspy chaspy force-pushed the chaspy/import_aws_autoscaling_lifecycle_hook branch from a42f4a7 to b656507 Compare July 15, 2019 11:45
@chaspy chaspy changed the title [WIP]Import autoscaling lifecycle hook [WIP]Add support Autoscaling Lifecycle Hook import Jul 15, 2019
@chaspy chaspy changed the title [WIP]Add support Autoscaling Lifecycle Hook import [WIP]Add support import Autoscaling Lifecycle Hook Jul 15, 2019
@chaspy chaspy changed the title [WIP]Add support import Autoscaling Lifecycle Hook Add support import Autoscaling Lifecycle Hook Jul 15, 2019
@dvishniakov
Copy link

dvishniakov commented Jul 15, 2019

Thank you, very fast PR!
Will this go only to v2 version of the plugin? If yes, Is it compatible with TF 0.11.x?

@chaspy
Copy link
Contributor Author

chaspy commented Jul 15, 2019

@dvishniakov Thank you for your review 🙏
I didn't understand Will this go only to v2 version of the plugin? (very shame that it is my first PR 😃 )
but I tried testing with TF 0.11.x

# (build)
$ $GOPATH/bin/terraform version
Terraform v0.11.14

Your version of Terraform is out of date! The latest version
is 0.12.4. You can update by downloading from www.terraform.io/downloads.html
$ git checkout chaspy/import_aws_autoscaling_lifecycle_hook

$ make testacc TESTARGS="-run=TestAccAWSAutoscalingLifecycleHook_basic" 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSAutoscalingLifecycleHook_basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSAutoscalingLifecycleHook_basic
=== PAUSE TestAccAWSAutoscalingLifecycleHook_basic
=== CONT  TestAccAWSAutoscalingLifecycleHook_basic
--- PASS: TestAccAWSAutoscalingLifecycleHook_basic (164.47s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	(cached)

If not enough, I'm glad if you tell me what I should do. 🙏

@ghost ghost deleted the chaspy/import_aws_autoscaling_lifecycle_hook branch July 16, 2019 00:59
@chaspy
Copy link
Contributor Author

chaspy commented Jul 16, 2019

Sorry, make testacc don't use local Terraform.
I'll try importing the resource with local TF with v0.11.x 👍

@chaspy
Copy link
Contributor Author

chaspy commented Jul 16, 2019

@dvishniakov
Tested with Terraform v0.11 👍

Target Resource

Screenshot 2019-07-16 14 29 45

Import

$ $GOPATH/bin/terraform version
Terraform v0.11.14
+ provider.aws (unversioned)

Your version of Terraform is out of date! The latest version
is 0.12.4. You can update by downloading from www.terraform.io/downloads.html

$ tail -n2 autoscaling.tf 
resource "aws_autoscaling_lifecycle_hook" "chaspy_import_test_hook" {
}

$ $GOPATH/bin/terraform import aws_autoscaling_lifecycle_hook.chaspy_import_test_hook chaspy-tf-asg/import-test-hook
aws_autoscaling_lifecycle_hook.chaspy_import_test_hook: Importing from ID "chaspy-tf-asg/import-test-hook"...
aws_autoscaling_lifecycle_hook.chaspy_import_test_hook: Import complete!
  Imported aws_autoscaling_lifecycle_hook (ID: import-test-hook)
aws_autoscaling_lifecycle_hook.chaspy_import_test_hook: Refreshing state... (ID: import-test-hook)

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

Please review 🙏

@chaspy chaspy restored the chaspy/import_aws_autoscaling_lifecycle_hook branch July 16, 2019 05:37
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Jul 16, 2019
@bflad bflad added this to the v2.20.0 milestone Jul 16, 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.

LGTM, thanks @chaspy 🚀

Output from acceptance testing:

--- PASS: TestAccAWSAutoscalingLifecycleHook_omitDefaultResult (132.11s)
--- PASS: TestAccAWSAutoscalingLifecycleHook_basic (133.25s)

@bflad bflad merged commit b9af2eb into hashicorp:master Jul 16, 2019
@chaspy chaspy deleted the chaspy/import_aws_autoscaling_lifecycle_hook branch July 16, 2019 13:22
bflad added a commit that referenced this pull request Jul 16, 2019
@ghost
Copy link

ghost commented Nov 2, 2019

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 Nov 2, 2019
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/S 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.

resource aws_autoscaling_lifecycle_hook doesn't support import
3 participants