terraform-aws-codebuild icon indicating copy to clipboard operation
terraform-aws-codebuild copied to clipboard

NO_ARTIFACTS = InvalidInputException

Open twigs67 opened this issue 4 years ago • 6 comments

Hello,

I'm getting the error:

Invalid artifacts: artifact type NO_ARTIFACTS should have null output name

Maybe I'm missing something?

module "build" {
  source              = "git::https://github.com/cloudposse/terraform-aws-codebuild.git?ref=master"
  namespace           = var.environment
  stage               = var.project
  name                = var.name

  # https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
  build_image         = "aws/codebuild/standard:4.0"
  build_compute_type  = "BUILD_GENERAL1_SMALL"
  build_timeout       = 60
  artifact_type       = "NO_ARTIFACTS"

  # These attributes are optional, used as ENV variables when building Docker images and pushing them to ECR
  # For more info:
  # http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html
  # https://www.terraform.io/docs/providers/aws/r/codebuild_project.html

  privileged_mode     = true
  aws_region          = "us-east-1"
  aws_account_id      = var.aws_account_numbers[0]
  image_repo_name     = var.image_repo_name
  image_tag           = var.image_tag
  private_repository  = true

  source_credential_auth_type   = "PERSONAL_ACCESS_TOKEN"
  source_credential_server_type = "GITHUB"
  source_credential_token       = var.github_access_token

  buildspec = "buildspec.yml"

  # Optional extra environment variables
  environment_variables = [
    {
      name = "AWS_DEFAULT_REGION"
      value = var.aws_region
    }
  ]
}

twigs67 avatar Aug 19 '20 20:08 twigs67

I have the same issue

dominic-byrne-worldpay avatar Sep 14 '20 13:09 dominic-byrne-worldpay

Same here. Also I switch to S3 to try and workaround I get "Invalid artifacts: location is required" but cannot see the property listed

andrewrutter avatar Dec 09 '20 16:12 andrewrutter

destroying and recreating it solved the issue for me

python3k avatar Mar 09 '21 13:03 python3k

Manually changing the Codebuild project artifacts configuration, then returning with the Terraform modification sufficiently worked around the issue for me.

twmartin avatar May 24 '22 18:05 twmartin

@twmartin @python3k @andrewrutter @dominic-byrne-worldpay @twigs67

Is this problem still affecting you folks ? Do you folks know of a way to resolve this in terraform ? What version of the aws provider are you folks using ?

https://stackoverflow.com/questions/63477000/terraform-aws-codebuild-project-error-invalidinputexception

It's possible this is a provider bug.

nitrocode avatar Jun 21 '22 20:06 nitrocode

This is also an issue for me. Fixed it by destroying the codebuild project then re-creating it (commenting out in terraform). I'm using provider version 5.19.0 and terraform >= 1.5.5

mmigliari avatar Jan 11 '24 14:01 mmigliari