-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Refresh aws_autoscaling_schedule from state on 404 #9659
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LGTM |
jen20
approved these changes
Oct 27, 2016
Fixes #9654 Before the fix, I created an ASG with a schedule on it. Went to the AWS console and deleted the schedule. A terraform plan looked as follows: ``` % terraform plan See https://www.terraform.io/docs/internals/internal-plugins.html Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_launch_configuration.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_group.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar) Error refreshing state: 1 error(s) occurred: * aws_autoscaling_schedule.foobar: Unable to find Autoscaling * Scheduled Action: []*autoscaling.ScheduledUpdateGroupAction(nil) ``` After the fix: ``` terraform plan 1 ↵ Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_launch_configuration.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_group.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar) The Terraform execution plan has been generated and is shown below. Resources are shown in alphabetical order for quick scanning. Green resources will be created (or destroyed and then created if an existing resource exists), yellow resources are being changed in-place, and red resources will be destroyed. Cyan entries are data sources to be read. Note: You didn't specify an "-out" parameter to save this plan, so when "apply" is called, Terraform can't guarantee this is what will execute. + aws_autoscaling_schedule.foobar arn: "<computed>" autoscaling_group_name: "terraform-test-foobar5" desired_capacity: "0" end_time: "2018-01-16T13:00:00Z" max_size: "0" min_size: "0" recurrence: "<computed>" scheduled_action_name: "foobar" start_time: "2018-01-16T07:00:00Z" Plan: 1 to add, 0 to change, 0 to destroy. ``` Tests run as expected: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAutoscalingSchedule_' 2 ↵ ✹ ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2016/10/27 17:45:19 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSAutoscalingSchedule_ -timeout 120m === RUN TestAccAWSAutoscalingSchedule_basic --- PASS: TestAccAWSAutoscalingSchedule_basic (140.94s) === RUN TestAccAWSAutoscalingSchedule_disappears --- PASS: TestAccAWSAutoscalingSchedule_disappears (179.17s) === RUN TestAccAWSAutoscalingSchedule_recurrence --- PASS: TestAccAWSAutoscalingSchedule_recurrence (186.72s) === RUN TestAccAWSAutoscalingSchedule_zeroValues --- PASS: TestAccAWSAutoscalingSchedule_zeroValues (167.73s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 674.530s ```
stack72
force-pushed
the
aws-refresh-asg_schedule-on-404
branch
from
October 27, 2016 17:27
c3076aa
to
9a05436
Compare
antonbabenko
pushed a commit
to antonbabenko/terraform
that referenced
this pull request
Oct 27, 2016
…hicorp#9659) Fixes hashicorp#9654 Before the fix, I created an ASG with a schedule on it. Went to the AWS console and deleted the schedule. A terraform plan looked as follows: ``` % terraform plan See https://www.terraform.io/docs/internals/internal-plugins.html Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_launch_configuration.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_group.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar) Error refreshing state: 1 error(s) occurred: * aws_autoscaling_schedule.foobar: Unable to find Autoscaling * Scheduled Action: []*autoscaling.ScheduledUpdateGroupAction(nil) ``` After the fix: ``` terraform plan 1 ↵ Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_launch_configuration.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_group.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar) The Terraform execution plan has been generated and is shown below. Resources are shown in alphabetical order for quick scanning. Green resources will be created (or destroyed and then created if an existing resource exists), yellow resources are being changed in-place, and red resources will be destroyed. Cyan entries are data sources to be read. Note: You didn't specify an "-out" parameter to save this plan, so when "apply" is called, Terraform can't guarantee this is what will execute. + aws_autoscaling_schedule.foobar arn: "<computed>" autoscaling_group_name: "terraform-test-foobar5" desired_capacity: "0" end_time: "2018-01-16T13:00:00Z" max_size: "0" min_size: "0" recurrence: "<computed>" scheduled_action_name: "foobar" start_time: "2018-01-16T07:00:00Z" Plan: 1 to add, 0 to change, 0 to destroy. ``` Tests run as expected: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAutoscalingSchedule_' 2 ↵ ✹ ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2016/10/27 17:45:19 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSAutoscalingSchedule_ -timeout 120m === RUN TestAccAWSAutoscalingSchedule_basic --- PASS: TestAccAWSAutoscalingSchedule_basic (140.94s) === RUN TestAccAWSAutoscalingSchedule_disappears --- PASS: TestAccAWSAutoscalingSchedule_disappears (179.17s) === RUN TestAccAWSAutoscalingSchedule_recurrence --- PASS: TestAccAWSAutoscalingSchedule_recurrence (186.72s) === RUN TestAccAWSAutoscalingSchedule_zeroValues --- PASS: TestAccAWSAutoscalingSchedule_zeroValues (167.73s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 674.530s ```
mathieuherbert
pushed a commit
to mathieuherbert/terraform
that referenced
this pull request
Oct 30, 2016
…hicorp#9659) Fixes hashicorp#9654 Before the fix, I created an ASG with a schedule on it. Went to the AWS console and deleted the schedule. A terraform plan looked as follows: ``` % terraform plan See https://www.terraform.io/docs/internals/internal-plugins.html Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_launch_configuration.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_group.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar) Error refreshing state: 1 error(s) occurred: * aws_autoscaling_schedule.foobar: Unable to find Autoscaling * Scheduled Action: []*autoscaling.ScheduledUpdateGroupAction(nil) ``` After the fix: ``` terraform plan 1 ↵ Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_launch_configuration.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_group.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar) The Terraform execution plan has been generated and is shown below. Resources are shown in alphabetical order for quick scanning. Green resources will be created (or destroyed and then created if an existing resource exists), yellow resources are being changed in-place, and red resources will be destroyed. Cyan entries are data sources to be read. Note: You didn't specify an "-out" parameter to save this plan, so when "apply" is called, Terraform can't guarantee this is what will execute. + aws_autoscaling_schedule.foobar arn: "<computed>" autoscaling_group_name: "terraform-test-foobar5" desired_capacity: "0" end_time: "2018-01-16T13:00:00Z" max_size: "0" min_size: "0" recurrence: "<computed>" scheduled_action_name: "foobar" start_time: "2018-01-16T07:00:00Z" Plan: 1 to add, 0 to change, 0 to destroy. ``` Tests run as expected: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAutoscalingSchedule_' 2 ↵ ✹ ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2016/10/27 17:45:19 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSAutoscalingSchedule_ -timeout 120m === RUN TestAccAWSAutoscalingSchedule_basic --- PASS: TestAccAWSAutoscalingSchedule_basic (140.94s) === RUN TestAccAWSAutoscalingSchedule_disappears --- PASS: TestAccAWSAutoscalingSchedule_disappears (179.17s) === RUN TestAccAWSAutoscalingSchedule_recurrence --- PASS: TestAccAWSAutoscalingSchedule_recurrence (186.72s) === RUN TestAccAWSAutoscalingSchedule_zeroValues --- PASS: TestAccAWSAutoscalingSchedule_zeroValues (167.73s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 674.530s ```
gusmat
pushed a commit
to gusmat/terraform
that referenced
this pull request
Dec 6, 2016
…hicorp#9659) Fixes hashicorp#9654 Before the fix, I created an ASG with a schedule on it. Went to the AWS console and deleted the schedule. A terraform plan looked as follows: ``` % terraform plan See https://www.terraform.io/docs/internals/internal-plugins.html Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_launch_configuration.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_group.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar) Error refreshing state: 1 error(s) occurred: * aws_autoscaling_schedule.foobar: Unable to find Autoscaling * Scheduled Action: []*autoscaling.ScheduledUpdateGroupAction(nil) ``` After the fix: ``` terraform plan 1 ↵ Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_launch_configuration.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_group.foobar: Refreshing state... (ID: terraform-test-foobar5) aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar) The Terraform execution plan has been generated and is shown below. Resources are shown in alphabetical order for quick scanning. Green resources will be created (or destroyed and then created if an existing resource exists), yellow resources are being changed in-place, and red resources will be destroyed. Cyan entries are data sources to be read. Note: You didn't specify an "-out" parameter to save this plan, so when "apply" is called, Terraform can't guarantee this is what will execute. + aws_autoscaling_schedule.foobar arn: "<computed>" autoscaling_group_name: "terraform-test-foobar5" desired_capacity: "0" end_time: "2018-01-16T13:00:00Z" max_size: "0" min_size: "0" recurrence: "<computed>" scheduled_action_name: "foobar" start_time: "2018-01-16T07:00:00Z" Plan: 1 to add, 0 to change, 0 to destroy. ``` Tests run as expected: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAutoscalingSchedule_' 2 ↵ ✹ ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2016/10/27 17:45:19 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSAutoscalingSchedule_ -timeout 120m === RUN TestAccAWSAutoscalingSchedule_basic --- PASS: TestAccAWSAutoscalingSchedule_basic (140.94s) === RUN TestAccAWSAutoscalingSchedule_disappears --- PASS: TestAccAWSAutoscalingSchedule_disappears (179.17s) === RUN TestAccAWSAutoscalingSchedule_recurrence --- PASS: TestAccAWSAutoscalingSchedule_recurrence (186.72s) === RUN TestAccAWSAutoscalingSchedule_zeroValues --- PASS: TestAccAWSAutoscalingSchedule_zeroValues (167.73s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 674.530s ```
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
ghost
locked and limited conversation to collaborators
Apr 21, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #9654
Before the fix, I created an ASG with a schedule on it. Went to the AWS
console and deleted the schedule. A terraform plan looked as follows:
After the fix:
Tests run as expected: