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]: Existing aws_dx_connection cannot be decoded from state #31732

Closed
bodgit opened this issue Jun 2, 2023 · 4 comments · Fixed by #31735
Closed

[Bug]: Existing aws_dx_connection cannot be decoded from state #31732

bodgit opened this issue Jun 2, 2023 · 4 comments · Fixed by #31735
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/directconnect Issues and PRs that pertain to the directconnect service.

Comments

@bodgit
Copy link
Contributor

bodgit commented Jun 2, 2023

Terraform Core Version

1.3.9

AWS Provider Version

5.1.0

Affected Resource(s)

  • aws_dx_connection

Expected Behavior

Existing aws_dx_connection resources should be decoded from state

Actual Behavior

Using version 5.1.0 of the AWS provider existing aws_dx_connection resources cannot be decoded from state

Relevant Error/Panic Output Snippet

╷
│ Error: Failed to decode resource from state
│ 
│ Error decoding "aws_dx_connection.wl_ireland" from previous state: a number
│ is required
╵
╷
│ Error: a number is required
│ 
│   with aws_dx_connection.el_ireland,
│   on main.tf line 60, in resource "aws_dx_connection" "el_ireland":
│   60: resource "aws_dx_connection" "el_ireland" {
│ 
╵
╷
│ Error: a number is required
│ 
│   with aws_dx_connection.wl_ireland,
│   on main.tf line 67, in resource "aws_dx_connection" "wl_ireland":
│   67: resource "aws_dx_connection" "wl_ireland" {
│ 
╵

Terraform Configuration Files

I have these existing resources prior to trying to update to version 5.1.0:

resource "aws_dx_connection" "el_ireland" {
  provider  = aws.eu-west-1
  name      = "el-eu-west-1"
  bandwidth = "1Gbps"
  location  = "TCSH"
}

resource "aws_dx_connection" "wl_ireland" {
  provider  = aws.eu-west-1
  name      = "wl-eu-west-1"
  bandwidth = "1Gbps"
  location  = "EqLD5"
}

Steps to Reproduce

Run a plan using these existing resources using version 5.1.0 of the AWS provider.

Debug Output

No response

Panic Output

No response

Important Factoids

Version 5.0.1 is unaffected.

References

This looks to have been introduced by #31480

Would you like to implement a fix?

No

@bodgit bodgit added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jun 2, 2023
@github-actions github-actions bot added the service/directconnect Issues and PRs that pertain to the directconnect service. label Jun 2, 2023
@github-actions
Copy link

github-actions bot commented Jun 2, 2023

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.

@ewbankkit ewbankkit added regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 2, 2023
@Aussie007
Copy link

Hi
I got the same warning/error:

Warning: Failed to decode resource from state

Error decoding "aws_dx_connection.aws-rim" from prior state: a number is required

 Error: a number is required

   with aws_dx_connection.aws-rim,
   on Direct-connection.tf line 1, in resource "aws_dx_connection" "aws-rim":
    1: resource "aws_dx_connection" "aws-rim" {

Got the error after upgrading AWS Provider from v5.0.1 to v5.1.0

@thiagolsfortunato
Copy link

thiagolsfortunato commented Jun 2, 2023

Until version v5.2.0 is not released, I rolled back to v5.0.1, and works.

terraform {
  required_version = ">= 1.3"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0.0"
    }
  }
}

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

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 Jul 3, 2023
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/directconnect Issues and PRs that pertain to the directconnect service.
Projects
None yet
4 participants