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

AWS CodeBuild Project ARN #5962

Closed
ghost opened this issue Sep 24, 2018 · 6 comments · Fixed by #5973
Closed

AWS CodeBuild Project ARN #5962

ghost opened this issue Sep 24, 2018 · 6 comments · Fixed by #5973
Labels
service/codebuild Issues and PRs that pertain to the codebuild service.
Milestone

Comments

@ghost
Copy link

ghost commented Sep 24, 2018

This issue was originally opened by @GuidoNebiolo as hashicorp/terraform#18928. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.11.8

Terraform Configuration Files

resource "aws_codebuild_project" "codebuild_project" {
  name          = "${var.codebuild_name}"
  description   = "${var.codebuild_description}"
  badge_enabled = true
  build_timeout = "10"
  service_role  = "${aws_iam_role.codebuild_role.arn}"

  artifacts {
    type = "S3"
  }

  environment {
    compute_type = "BUILD_GENERAL1_SMALL"
    image        = "${var.codebuild_image}"
    type         = "LINUX_CONTAINER"
  }

  source {
    type                = "CODECOMMIT"
    location            = "${aws_codecommit_repository.repository.clone_url_http}"
    git_clone_depth     = 1
    report_build_status = false
  }
}

output "codebuild_arn" {
  value = "${aws_codebuild_project.codebuild_project.id}"
}

Expected Behavior

output for codebuild_arn equals to arn:aws:codebuild:region:account_id:project/codebuild_project_id

Actual Behavior

output for codebuild_arn is equal to codebuild_project_id

@bflad bflad added the service/codebuild Issues and PRs that pertain to the codebuild service. label Sep 24, 2018
@bflad
Copy link
Contributor

bflad commented Sep 24, 2018

Hi @GuidoNebiolo 👋

Was this particular resource imported into Terraform via terraform import aws_codebuild_project. codebuild_project NAME? It looks like if the resource is imported that way, the id attribute will actually remain just the name (unlike during resource creation where it will be the ARN). In this case we'll likely need to add a separate arn attribute that is always the ARN and document the current behavior. I can submit something real quick.

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Sep 24, 2018
@bflad
Copy link
Contributor

bflad commented Sep 24, 2018

Pull request submitted to add stable arn attribute and improve documentation of id attribute: #5973

@GuidoNebiolo
Copy link

yes, I can confirm that the first time I create the resource I imported the resource via terraform import

@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 25, 2018
@bflad bflad added this to the v1.38.0 milestone Sep 26, 2018
@bflad
Copy link
Contributor

bflad commented Sep 26, 2018

Support for a consistent arn attribute has been merged and will release with version 1.38.0 of the AWS provider, likely later today.

@bflad
Copy link
Contributor

bflad commented Sep 26, 2018

This has been released in version 1.38.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link
Author

ghost commented Apr 3, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/codebuild Issues and PRs that pertain to the codebuild service.
Projects
None yet
2 participants