hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.8k stars 9.15k forks source link

[Bug]: CodeBuild Project Prompts for Location When Using CodeCommit as Source #35171

Closed network-charles closed 9 months ago

network-charles commented 9 months ago

Terraform Core Version

Terraform v1.6.6

AWS Provider Version

5.31.0

Affected Resource(s)

aws_codebuild_project

Expected Behavior

Build a Codebuild project for Codecommit source without requiring a location.

Actual Behavior

Fails to create the resource.

Relevant Error/Panic Output Snippet

Error: creating CodeBuild project: InvalidInputException: Project source location is required

Terraform Configuration Files

https://github.com/network-charles/AWS-Dev-Associate/blob/main/Lab%202/compute.tf

Steps to Reproduce

source { type = "CODECOMMIT" location = aws_codecommit_repository.test.clone_url_http }

For the source argument in the codebuild project resource, comment the "location."

The last instruction is specified as a comment in the null resource.

Lastly, do a terraform apply -auto-approve for the Lab 2 folder.

Debug Output

No response

Panic Output

No response

Important Factoids

I use Ubuntu 20.04.6 LTS

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 9 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

acwwat commented 9 months ago

According to the CodeBuild API reference, location is required for source code in a CodeCommit repository and it should be the HTTPS clone URL of the repository. Even in the UI, you would select the CodeCommit repo, which likely just gets resolved to the HTTPS clone URL under the cover.

Is there a reason why you believe the source location is not required?

network-charles commented 9 months ago

@acwwat, thank you for helping me identify this. I had gotten confused at the part that said “Required: No” When I reread it now, I saw that it was specified that “For all of the other types, you must specify Location.”

github-actions[bot] commented 8 months ago

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.