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

State Read Error on adding tags #219

Closed
dpiddock opened this issue Oct 1, 2021 · 1 comment · Fixed by #306
Closed

State Read Error on adding tags #219

dpiddock opened this issue Oct 1, 2021 · 1 comment · Fixed by #306
Labels
bug upstream-plugin-framework Unable to proceed due to missing or broken functionality from terraform-plugin-framework

Comments

@dpiddock
Copy link

dpiddock commented Oct 1, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the Cloudformation Open Coverage Roadmap.

Terraform CLI and Terraform AWS Cloud Control Provider Version

Terraform v1.0.8
on darwin_amd64
+ provider registry.terraform.io/hashicorp/awscc v0.1.0

Affected Resource(s)

  • awscc_aps_workspace

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "awscc_aps_workspace" "amp" {
  alias = "test-amp"
  tags = [
    {
      key   = "a_key"
      value = "a_value"
    }
  ]
}

Debug Output

https://gist.github.com/dpiddock/c02a1e1297f8d34026d32b0a6adc6740

Panic Output

Expected Behavior

Terraform should report a state change, from null tags to a set of tags.

Actual Behavior

Error is thrown:

awscc_aps_workspace.amp: Refreshing state... [id=arn:aws:aps:eu-central-1:111111111111:workspace/ws-b8cf8a14-bebb-4140-bcb8-2a1909181fd8]
╷
│ Error: State Read Error
│ 
│   with awscc_aps_workspace.amp,
│   on main.tf line 12, in resource "awscc_aps_workspace" "amp":
│   12:   tags = [
│   13:     {
│   14:       key   = "a_key"
│   15:       value = "a_value"
│   16:     }
│   17:   ]
│ 
│ An unexpected error was encountered trying to read an attribute from the state. This is always an error in the provider. Please report the following to the provider developer:
│ 
│ ElementKeyValue(tftypes.Object["key":tftypes.String, "value":tftypes.String]<"key":tftypes.String<"a_key">, "value":tftypes.String<"a_value">>).AttributeName("key") still remains in the
│ path: step cannot be applied to this value
╵
╷
│ Error: State Read Error
│ 
│   with awscc_aps_workspace.amp,
│   on main.tf line 12, in resource "awscc_aps_workspace" "amp":
│   12:   tags = [
│   13:     {
│   14:       key   = "a_key"
│   15:       value = "a_value"
│   16:     }
│   17:   ]
│ 
│ An unexpected error was encountered trying to read an attribute from the state. This is always an error in the provider. Please report the following to the provider developer:
│ 
│ ElementKeyValue(tftypes.Object["key":tftypes.String, "value":tftypes.String]<"key":tftypes.String<"a_key">, "value":tftypes.String<"a_value">>).AttributeName("value") still remains in the
│ path: step cannot be applied to this value
╵

Steps to Reproduce

  1. Have a resource without tags.
  2. terraform plan

Important Factoids

How the resource was created or put in to the terraform state file does not matter. It just needs to be returning no tags from the AWS API refresh call when the terraform configuration has tags set.

References

@bflad bflad added bug upstream-plugin-framework Unable to proceed due to missing or broken functionality from terraform-plugin-framework labels Oct 1, 2021
@bflad
Copy link
Contributor

bflad commented Oct 1, 2021

I've preemptively marked this as upstream-plugin-framework as I believe it will be resolved in the next release of that dependency via: hashicorp/terraform-plugin-framework#150 / hashicorp/terraform-plugin-framework#185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug upstream-plugin-framework Unable to proceed due to missing or broken functionality from terraform-plugin-framework
Projects
None yet
2 participants