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 Backup vault 200 response treated as error for import #39650

Closed
tanadeau opened this issue Oct 9, 2024 · 5 comments · Fixed by #39670
Closed

[Bug]: AWS Backup vault 200 response treated as error for import #39650

tanadeau opened this issue Oct 9, 2024 · 5 comments · Fixed by #39670
Assignees
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/backup Issues and PRs that pertain to the backup service.
Milestone

Comments

@tanadeau
Copy link

tanadeau commented Oct 9, 2024

Terraform Core Version

1.9.7

AWS Provider Version

5.70.0

Affected Resource(s)

  • aws_backup_vault

Expected Behavior

Can import an existing AWS Backup vault into Terraform state

Actual Behavior

Error: Cannot import non-existent remote object

Debug logging below shows that this vault exists and was found with the response returning good JSON and a 200 status code. The equivalent aws backup describe-backup-vault CLI call gives the same output.

Relevant Error/Panic Output Snippet

2024-10-09T15:52:51.138-0400 [DEBUG] provider.terraform-provider-aws_v5.70.0_x5: HTTP Response Received: tf_aws.sdk=aws-sdk-go-v2 tf_resource_type=aws_backup_vault
  http.response.body=
  | {"BackupVaultArn":"MY_VAULT_ARN","BackupVaultName":"my-backup-vault","CreationDate":1.67632785968E9,"CreatorRequestId":null,"EncryptionKeyArn":"MY_KEY_ARN","LockDate":null,"Locked":false,"MaxRetentionDays":null,"MinRetentionDays":null,"MountedVaultArn":null,"NumberOfRecoveryPoints":300,"VaultState":null,"VaultType":null}
   http.response.header.x_amzn_requestid=d0999084-2dc6-4877-9a42-529f44f3dafb rpc.service=Backup aws.region=us-gov-west-1 @module=aws http.duration=418 http.response.header.content_type=application/json http.status_code=200 tf_aws.signing_region="" tf_mux_provider="*schema.GRPCProviderServer" @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.58/logging/tf_logger.go:45 tf_provider_addr=registry.terraform.io/hashicorp/aws http.response_content_length=479 rpc.method=DescribeBackupVault rpc.system=aws-api tf_req_id=4e11d370-8dc7-d748-c679-8d4a23ba38a7 tf_rpc=ReadResource http.response.header.date="Wed, 09 Oct 2024 19:52:51 GMT" timestamp=2024-10-09T15:52:51.137-0400
2024-10-09T15:52:51.138-0400 [WARN]  provider.terraform-provider-aws_v5.70.0_x5: [WARN] Backup Vault (my-backup-vault) not found, removing from state
2024-10-09T15:52:51.139-0400 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an unexpected new value for module.aws.module.backup.aws_backup_vault.default[0] during refresh.
      - Root object was present, but now absent
2024-10-09T15:52:51.140-0400 [ERROR] vertex "import module.aws.module.backup.aws_backup_vault.default[0] result" error: Cannot import non-existent remote object

Terraform Configuration Files

resource "aws_backup_vault" "this" {
    name = "my-test-vault"
}

Steps to Reproduce

  1. Create backup vault in AWS with name my-test-vault
  2. Run terraform import aws_backup_vault.this my-test-vault

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@tanadeau tanadeau added the bug Addresses a defect in current functionality. label Oct 9, 2024
Copy link

github-actions bot commented Oct 9, 2024

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/backup Issues and PRs that pertain to the backup service. needs-triage Waiting for first response or review from a maintainer. labels Oct 9, 2024
@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 Oct 10, 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 Oct 10, 2024
@ewbankkit ewbankkit self-assigned this Oct 10, 2024
@ewbankkit
Copy link
Contributor

Relates #39098.

@tanadeau
Copy link
Author

I noticed this when doing an import after a terraform apply operation that then removed the state (see logs); however, I think this is why the original apply failed too since it thought it didn't exist and then tried to create it anyway failing with a conflict.

Copy link

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.71.0 milestone Oct 10, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 15, 2024
Copy link

This functionality has been released in v5.72.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/backup Issues and PRs that pertain to the backup service.
Projects
None yet
2 participants