hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.85k stars 9.19k forks source link

aws_cognito_user_pool_client doesn't update if a new attribute is added #5004

Closed ghost closed 6 years ago

ghost commented 6 years ago

This issue was originally opened by @scala-guy as hashicorp/terraform#18337. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform crashes when I add a new attribute in aws_cognito_user_pool_client.

I created a list of clients using count and element initially. It worked. When I added an attribute later, terraform apply crashed with error aws_cognito_user_pool_client.client.0: unexpected EOF

Here is my code for first run:

resource "aws_cognito_user_pool_client" "client" { count = "2"

name = "${element(var.userpoolclients, count.index)}" user_pool_id = "${aws_cognito_user_pool.pool.id}" supported_identity_providers = ["${aws_cognito_identity_provider.provider.provider_name}"] callback_urls = ["${var.callback_url["${element(var.userpoolclients, count.index)}"]}"] logout_urls = ["${var.logout_url["${element(var.userpoolclients, count.index)}"]}"] allowed_oauth_flows = ["${var.allowed_oauth_flow["${element(var.userpoolclients, count.index)}"]}"] allowed_oauth_scopes = ["${var.allowed_oauth_scope["${element(var.userpoolclients, count.index)}"]}"] }

Here is my code for second run

resource "aws_cognito_user_pool_client" "client" { count = "2"

name = "${element(var.userpoolclients, count.index)}" user_pool_id = "${aws_cognito_user_pool.pool.id}" supported_identity_providers = ["${aws_cognito_identity_provider.provider.provider_name}"] callback_urls = ["${var.callback_url["${element(var.userpoolclients, count.index)}"]}"] logout_urls = ["${var.logout_url["${element(var.userpoolclients, count.index)}"]}"] allowed_oauth_flows = ["${var.allowed_oauth_flow["${element(var.userpoolclients, count.index)}"]}"] allowed_oauth_scopes = ["${var.allowed_oauth_scope["${element(var.userpoolclients, count.index)}"]}"] refresh_token_validity = "1" }

Terraform Version

Terraform v0.10.8

...

Terraform Configuration Files

...

Debug Output

Crash Output

ndor/github.com/hashicorp/terraform/helper/schema.(Provider).Apply(0xc420fd7180, 0xc4203447d0, 0xc420344820, 0xc4208702c0, 0x7fa2e0049000, 0x0, 0xc420feb9a0) viders/terraform-provider-aws/ve I, [2018-06-27T04:31:52.706133 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: /opt/teamcity-ag thub.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:283 +0xa4 ent/work/222ea50a1b4f75f4/src/gi I, [2018-06-27T04:31:52.706155 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: github.com/terraform-pro ndor/github.com/hashicorp/terraform/plugin.(ResourceProviderServer).Apply(0xc420690b00, 0xc4208701c0, 0xc42084e4d0, 0x0, 0x0) viders/terraform-provider-aws/ve I, [2018-06-27T04:31:52.706184 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: /opt/teamcity-ag thub.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:527 +0x57 ent/work/222ea50a1b4f75f4/src/gi I, [2018-06-27T04:31:52.706210 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: reflect.Value.call(0xc42 cc6fa5, 0x4, 0xc420053f20, 0x3, 0x3, 0x0, 0x0, ...) 005eba0, 0xc420e0e118, 0x13, 0x2 I, [2018-06-27T04:31:52.706237 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: /usr/local/go/sr I, [2018-06-27T04:31:52.706257 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: reflect.Value.Call(0xc42c/reflect/value.go:434 +0x905 420358f20, 0x3, 0x3, 0x4a86160, 0xc4200ceb00, 0xc4210b0000) 005eba0, 0xc420e0e118, 0x13, 0xc I, [2018-06-27T04:31:52.706511 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: /usr/local/go/sr I, [2018-06-27T04:31:52.706540 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: net/rpc.(service).call(c/reflect/value.go:302 +0xa4 2062e858, 0xc420a34e80, 0xc420679c60, 0x2374b00, 0xc4208701c0, 0x16, 0x2374b40, 0xc42084e4d0, ...) 0xc420e07580, 0xc420c91ea0, 0xc4 I, [2018-06-27T04:31:52.706566 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: /usr/local/go/sr I, [2018-06-27T04:31:52.706588 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: created by net/rpc.(Serc/net/rpc/server.go:381 +0x142 I, [2018-06-27T04:31:52.706612 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.682Z [DEBUG] plugin.terraform-provider-aws_v1.21.0_x4: /usr/local/go/srver).ServeCodec I, [2018-06-27T04:31:52.706631 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalWriteState c/net/rpc/server.go:475 +0x36b I, [2018-06-27T04:31:52.706648 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalApplyProvisioners I, [2018-06-27T04:31:52.706664 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalIf I, [2018-06-27T04:31:52.706689 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalWriteState I, [2018-06-27T04:31:52.706709 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalWriteDiff I, [2018-06-27T04:31:52.706730 hashicorp/terraform#5407] INFO -- default-test: 2018-06-27T04:31:52.685Z [DEBUG] plugin: plugin process exited: path=/home/sanjayyadav/gitrepo/terr gins/linux_amd64/terraform-provider-aws_v1.21.0_x4 aform-aws-cognito/.terraform/plu I, [2018-06-27T04:31:52.707619 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalApplyPost I, [2018-06-27T04:31:52.707680 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [ERROR] root.cognito_test: eval: terraform.EvalApplyPost, err: 1 error(s) occu I, [2018-06-27T04:31:52.707708 hashicorp/terraform#5407] INFO -- default-test: rred: I, [2018-06-27T04:31:52.707739 hashicorp/terraform#5407] INFO -- default-test: aws_cognito_user_pool_client.client.1: unexpected EOF I, [2018-06-27T04:31:52.707769 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [ERROR] root.cognito_test: eval: terraform.EvalSequence, err: 1 error(s) occur I, [2018-06-27T04:31:52.707792 hashicorp/terraform#5407] INFO -- default-test: red: I, [2018-06-27T04:31:52.707821 hashicorp/terraform#5407] INFO -- default-test: aws_cognito_user_pool_client.client.1: unexpected EOF I, [2018-06-27T04:31:52.707851 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] [walkApply] Exiting eval tree: module.cognito_test.aws_cognito_user_poo I, [2018-06-27T04:31:52.707888 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalWriteState l_client.client[1] I, [2018-06-27T04:31:52.707926 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalApplyProvisioners I, [2018-06-27T04:31:52.708006 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalIf I, [2018-06-27T04:31:52.708037 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalWriteState I, [2018-06-27T04:31:52.708060 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalWriteDiff I, [2018-06-27T04:31:52.708081 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] root.cognito_test: eval: terraform.EvalApplyPost I, [2018-06-27T04:31:52.708099 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [ERROR] root.cognito_test: eval: terraform.EvalApplyPost, err: 1 error(s) occu I, [2018-06-27T04:31:52.708118 hashicorp/terraform#5407] INFO -- default-test: rred: I, [2018-06-27T04:31:52.708136 hashicorp/terraform#5407] INFO -- default-test: aws_cognito_user_pool_client.client.0: unexpected EOF I, [2018-06-27T04:31:52.708155 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [ERROR] root.cognito_test: eval: terraform.EvalSequence, err: 1 error(s) occur I, [2018-06-27T04:31:52.708172 hashicorp/terraform#5407] INFO -- default-test: red: I, [2018-06-27T04:31:52.708191 hashicorp/terraform#5407] INFO -- default-test: aws_cognito_user_pool_client.client.0: unexpected EOF I, [2018-06-27T04:31:52.708208 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] [walkApply] Exiting eval tree: module.cognito_test.aws_cognito_user_poo I, [2018-06-27T04:31:52.708229 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] dag/walk: upstream errored, not walking "provider.aws (close)" l_client.client[0] I, [2018-06-27T04:31:52.708246 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] dag/walk: upstream errored, not walking "module.cognito_test.output.app I, [2018-06-27T04:31:52.708266 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] dag/walk: upstream errored, not walking "module.cognito_test.output.appclient_id" I, [2018-06-27T04:31:52.708282 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] dag/walk: upstream errored, not walking "output.appclient_name" client_name" I, [2018-06-27T04:31:52.708298 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] dag/walk: upstream errored, not walking "output.appclient_id" I, [2018-06-27T04:31:52.708319 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] dag/walk: upstream errored, not walking "meta.count-boundary (count bou I, [2018-06-27T04:31:52.708337 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] dag/walk: upstream errored, not walking "root" ndary fixup)" I, [2018-06-27T04:31:52.708354 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] Preserving existing state lineage "747872cf-01ea-48a7-8846-a618e3b9e7be I, [2018-06-27T04:31:52.708377 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] Preserving existing state lineage "747872cf-01ea-48a7-8846-a618e3b9e7be" I, [2018-06-27T04:31:52.708394 hashicorp/terraform#5407] INFO -- default-test: 2018/06/27 04:31:52 [TRACE] Preserving existing state lineage "747872cf-01ea-48a7-8846-a618e3b9e7b17%1

Expected Behavior

The clients in list should have updated refresh_token_validity = "1"

Actual Behavior

Terraform crashed.

Steps to Reproduce

Additional Context

References

bflad commented 6 years ago

This was previously fixed in version 1.24.0 of the AWS provider and has been available in all releases since. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

ghost commented 4 years ago

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!