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

[Bug]: aws_connect_contact_flow is not working correctly after updating provider to 5.77 #40267

Closed
grozdz opened this issue Nov 22, 2024 · 10 comments · Fixed by #40419
Closed
Assignees
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/connect Issues and PRs that pertain to the connect service.
Milestone

Comments

@grozdz
Copy link

grozdz commented Nov 22, 2024

Terraform Core Version

1.9.3

AWS Provider Version

5.77

Affected Resource(s)

aws_connect_contact_flow

Expected Behavior

Resource should work correctly.

Actual Behavior

After updating AWS provider from 5.76 to 5.77, terraform plan is not working anymore, throwing following error message:

Error: reading Connect Contact Flow (b77036e2-67bb-4d3e-be83-xxx:910f221b-5f64-49e6-b206-xxx): operation error Connect: DescribeContactFlow, https response error StatusCode: 200, RequestID: 98a59d3c-d3bc-404c-8970-0cede68a4f1d, deserialization failed, failed to decode response body with invalid JSON, expected Boolean to be of type *bool, got string instead

Flows were deployed wit previous version of provider without any issue, now it's not possible to update the resource as even plan is not working. I managed to workaround the problem by locking provider version to 5.76, but it cannot be a long term solution.
Looks like problem concerns OUTBOUND_WHISPER and CUSTOMER_QUEUE flow type.

Relevant Error/Panic Output Snippet

Error: reading Connect Contact Flow (b77036e2-67bb-4d3e-be83-xxx:910f221b-5f64-49e6-b206-xxx): operation error Connect: DescribeContactFlow, https response error StatusCode: 200, RequestID: 98a59d3c-d3bc-404c-8970-0cede68a4f1d, deserialization failed, failed to decode response body with invalid JSON, expected Boolean to be of type *bool, got string instead

Terraform Configuration Files

resource "aws_connect_contact_flow" "outbound_caller" {
  instance_id = var.amazon_connect_instance_id
  name          = "Flow"
  description = "Flow"
  type            = "OUTBOUND_WHISPER"
  content      = file("../flows/outbound-caller.json")
  tags            = local.tags
}

Steps to Reproduce

  1. Create CUSTOMER_QUEUE flow using aws_connect_contact_flow resource with provider version 5.76.
  2. Update provider to 5.77 and try to perform terraform plan.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@grozdz grozdz added the bug Addresses a defect in current functionality. label Nov 22, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/connect Issues and PRs that pertain to the connect service. needs-triage Waiting for first response or review from a maintainer. labels Nov 22, 2024
@davoclock
Copy link

data.aws_connect_contact_flow type of resources are also affected by this since it also performs Connect:DescribeContactFlow.

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Nov 22, 2024
@ewbankkit
Copy link
Contributor

I can reproduce this with our acceptance tests (v5.77.0):

% make testacc TESTARGS='-run=TestAccConnect_serial/^ContactFlow$$/basic' PKG=connect
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/connect/... -v -count 1 -parallel 20  -run=TestAccConnect_serial/^ContactFlow$/basic -timeout 360m
2024/11/22 10:38:01 Initializing Terraform AWS Provider...
=== RUN   TestAccConnect_serial
=== PAUSE TestAccConnect_serial
=== CONT  TestAccConnect_serial
=== RUN   TestAccConnect_serial/ContactFlow
=== RUN   TestAccConnect_serial/ContactFlow/basic
    contact_flow_test.go:29: Step 1/3 error: Error running apply: exit status 1
        
        Error: reading Connect Contact Flow (09d5b286-4ac5-48f1-b1d4-a62efb50d473:bb7fed29-8244-4200-83ad-50259d7c808c): operation error Connect: DescribeContactFlow, https response error StatusCode: 200, RequestID: dc15e5b8-c97b-4741-9aae-67eb70e62a92, deserialization failed, failed to decode response body with invalid JSON, expected Boolean to be of type *bool, got string instead
        
          with aws_connect_contact_flow.test,
          on terraform_plugin_test.tf line 19, in resource "aws_connect_contact_flow" "test":
          19: resource "aws_connect_contact_flow" "test" {
        
    panic.go:629: Error running post-test destroy, there may be dangling resources: operation error Connect: DescribeContactFlow, serialization failed: serialization failed: input member ContactFlowId must not be empty
--- FAIL: TestAccConnect_serial (76.21s)
    --- FAIL: TestAccConnect_serial/ContactFlow (76.21s)
        --- FAIL: TestAccConnect_serial/ContactFlow/basic (76.21s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/connect	81.346s
FAIL
make: *** [testacc] Error 1

@ewbankkit ewbankkit added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label Nov 22, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 22, 2024
@ewbankkit
Copy link
Contributor

ewbankkit commented Nov 22, 2024

My initial thoughts are that this problem was introduced with an upstream aws-sdk-go-v2 change (Release 2024-11-18) as the Terraform resource did not change for the v5.77.0 provider release. Investigating...

@ewbankkit
Copy link
Contributor

ewbankkit commented Nov 22, 2024

2024-11-22T10:43:15.364-0500 [DEBUG] aws: HTTP Response Received: tf_req_id=d23b71e6-c4dc-e0bf-067a-8004d84aea04 rpc.system=aws-api rpc.service=Connect http.duration=237 http.response.header.access_control_allow_origin="*" http.response.header.date="Fri, 22 Nov 2024 15:43:15 GMT" http.status_code=200 http.response.header.x_amzn_requestid=4d517ec8-c33b-41d4-a29b-81d8e20e9d12 aws.region=us-west-2 tf_aws.signing_region="" rpc.method=DescribeContactFlow tf_rpc=ApplyResourceChange tf_mux_provider="*schema.GRPCProviderServer" http.response_content_length=1397 http.response.header.x_amzn_trace_id=Root=1-6740a693-71e5bd832412a07c0ddb07aa tf_provider_addr=registry.terraform.io/hashicorp/aws tf_resource_type=aws_connect_contact_flow tf_aws.sdk=aws-sdk-go-v2 http.response.header.content_type=application/json http.response.header.x_amz_apigw_id=Bp73DGFGPHcEXDg=
  http.response.body=
  | {
  |   "ContactFlow" : {
  |     "Arn" : "arn:aws:connect:us-west-2:123456789012:instance/5d367605-5d5b-4d98-a442-fe88e573aaaa/contact-flow/2f3b8896-ee32-48d5-981b-e287673e8f4f",
  |     "Id" : "2f3b8896-ee32-48d5-981b-e287673e8f4f",
  |     "IsDefault" : "false",
  |     "Name" : "resource-test-terraform-7075749418873109470",
  |     "Type" : "CONTACT_FLOW",
  |     "State" : "ACTIVE",
  |     "Status" : "PUBLISHED",
  |     "LastModifiedRegion" : "us-west-2",
  |     "LastModifiedTime" : 1.73229019499E9,
  |     "FlowContentSha256" : "9b5906e4b563c7d71dadd8f911d8c88db02ccd38a92edd17b55f92e302c6afaf",
  |     "Description" : "Created",
  |     "Content" : "    {\n\t\t\"Version\": \"2019-10-30\",\n\t\t\"StartAction\": \"12345678-1234-1234-1234-123456789012\",\n\t\t\"Actions\": [\n\t\t\t{\n\t\t\t\t\"Identifier\": \"12345678-1234-1234-1234-123456789012\",\n\t\t\t\t\"Type\": \"MessageParticipant\",\n\t\t\t\t\"Transitions\": {\n\t\t\t\t\t\"NextAction\": \"abcdef-abcd-abcd-abcd-abcdefghijkl\",\n\t\t\t\t\t\"Errors\": [],\n\t\t\t\t\t\"Conditions\": []\n\t\t\t\t},\n\t\t\t\t\"Parameters\": {\n\t\t\t\t\t\"Text\": \"Created\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Identifier\": \"abcdef-abcd-abcd-abcd-abcdefghijkl\",\n\t\t\t\t\"Type\": \"DisconnectParticipant\",\n\t\t\t\t\"Transitions\": {},\n\t\t\t\t\"Parameters\": {}\n\t\t\t}\n\t\t]\n    }\n",
  |     "Tags" : {
  |       "Method" : "Created",
  |       "Name" : "Test Contact Flow"
  |     }
  |   }
  | }
  
2024-11-22T10:43:15.365-0500 [DEBUG] aws: request failed with unretryable error https response error StatusCode: 200, RequestID: 4d517ec8-c33b-41d4-a29b-81d8e20e9d12, deserialization failed, failed to decode response body with invalid JSON, expected Boolean to be of type *bool, got string instead: tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=d23b71e6-c4dc-e0bf-067a-8004d84aea04 rpc.system=aws-api tf_mux_provider="*schema.GRPCProviderServer" tf_aws.sdk=aws-sdk-go-v2 aws.region=us-west-2 rpc.service=Connect rpc.method=DescribeContactFlow tf_rpc=ApplyResourceChange tf_resource_type=aws_connect_contact_flow

connect@v1.116.0

Terraform AWS Provider v5.77.0.

ContactFlow
	// Amazon Connect includes a set of default flows that have already been
	// published. It uses them to power your contact center.
	IsDefault bool
awsRestjson1_deserializeDocumentContactFlow
		case "IsDefault":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
				}
				sv.IsDefault = jtv
			}

connect@v1.115.2

Terraform AWS Provider v5.76.0.

No field IsDefault in ContactFlow structure.

@ewbankkit
Copy link
Contributor

Opened aws/aws-sdk-go-v2#2909.

@pmmonier
Copy link

5.78 was released 2 hours ago and this is still happening...
Error: reading Connect Contact Flow (xxxxxxx:xxxxxx): operation error Connect: DescribeContactFlow, https response error StatusCode: 200, RequestID: xxxxxxx, deserialization failed, failed to decode response body with invalid JSON, expected Boolean to be of type *bool, got string instead

Copy link

github-actions bot commented Dec 3, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.80.0 milestone Dec 3, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 4, 2024
Copy link

github-actions bot commented Dec 4, 2024

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Jan 4, 2025

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/connect Issues and PRs that pertain to the connect service.
Projects
None yet
4 participants