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]: Error changing aws_codebuild_fleet resource after importing #39362

Open
albertored11 opened this issue Sep 17, 2024 · 1 comment · May be fixed by #39385
Open

[Bug]: Error changing aws_codebuild_fleet resource after importing #39362

albertored11 opened this issue Sep 17, 2024 · 1 comment · May be fixed by #39385
Labels
bug Addresses a defect in current functionality. service/codebuild Issues and PRs that pertain to the codebuild service.

Comments

@albertored11
Copy link

Terraform Core Version

1.9.5

AWS Provider Version

5.67.0

Affected Resource(s)

  • aws_codebuild_fleet

Expected Behavior

When trying to modify the configuration of this resource, the changes should be applied without any issues.

Actual Behavior

If the resource has been imported, the modify fails when trying to perform the UpdateFleet operation, stating the ARN of the resource is invalid.

Relevant Error/Panic Output Snippet

aws_codebuild_fleet.this: Modifying... [id=MyFleet]
╷
│ Error: updating AWS CodeBuild Fleet (MyFleet): operation error CodeBuild: UpdateFleet, https response error StatusCode: 400, RequestID: xxxx, InvalidInputException: Invalid fleet ARN
│ 
│   with aws_codebuild_fleet.this,
│   on codebuild.tf line 1, in resource "aws_codebuild_fleet" "this":
│    1: resource "aws_codebuild_fleet" "this" {
│ 
╵

Terraform Configuration Files

aws_codebuild_fleet.zip

Steps to Reproduce

  1. Create manually a compute fleet named ToBeDeleted1 using the AWS console. Set Overflow behavior to Queue.
  2. Import resource: terraform import aws_codebuild_fleet.this ToBeDeleted1.
  3. Run terraform apply -auto-approve.

Debug Output

No response

Panic Output

No response

Important Factoids

Comparing the resource objects in the Terraform state file between an imported resource and a resource created with Terraform, the only difference is in instances.attributes.id: the first one contains the name of the fleet, while the second one contains its ARN.

The error says that the ARN of the fleet is invalid, which makes me think that the ARN is being read from id, which in one case it contains the ARN, but in the other one, it contains the name.

References

No response

Would you like to implement a fix?

No

@albertored11 albertored11 added the bug Addresses a defect in current functionality. label Sep 17, 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/codebuild Issues and PRs that pertain to the codebuild service. needs-triage Waiting for first response or review from a maintainer. labels Sep 17, 2024
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 17, 2024
@aleksandarknezevic aleksandarknezevic linked a pull request Sep 18, 2024 that will close this issue
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. service/codebuild Issues and PRs that pertain to the codebuild service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants