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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support import Autoscaling Lifecycle Hook #9336

Conversation

@chaspy
Copy link
Contributor

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 terraform-providers/aws-provider as a code owner Jul 14, 2019

@chaspy chaspy force-pushed the chaspy:chaspy/import_aws_autoscaling_lifecycle_hook branch from 12b988c to a42f4a7 Jul 15, 2019

@hashibot hashibot bot added documentation size/S and removed size/XS labels Jul 15, 2019

@chaspy chaspy force-pushed the chaspy:chaspy/import_aws_autoscaling_lifecycle_hook branch from a42f4a7 to b656507 Jul 15, 2019

@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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor Author

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:chaspy/import_aws_autoscaling_lifecycle_hook branch Jul 16, 2019

@chaspy

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

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:chaspy/import_aws_autoscaling_lifecycle_hook branch Jul 16, 2019

@bflad bflad added the enhancement label Jul 16, 2019

@bflad bflad added this to the v2.20.0 milestone Jul 16, 2019

@bflad

bflad approved these changes Jul 16, 2019

Copy link
Member

left a comment

LGTM, thanks @chaspy 馃殌

Output from acceptance testing:

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

@bflad bflad merged commit b9af2eb into terraform-providers:master Jul 16, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@chaspy chaspy deleted the chaspy:chaspy/import_aws_autoscaling_lifecycle_hook branch Jul 16, 2019

bflad added a commit that referenced this pull request Jul 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.