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

Error creating CodeBuild project: InvalidInputException #11742

Closed
LennyCastaneda opened this issue Jan 23, 2020 · 8 comments
Closed

Error creating CodeBuild project: InvalidInputException #11742

LennyCastaneda opened this issue Jan 23, 2020 · 8 comments
Labels
regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/codebuild Issues and PRs that pertain to the codebuild service.
Milestone

Comments

@LennyCastaneda
Copy link

The issue is when I run the Terraform configuration module below, whichis used for an AMI pipeline, it get this error. (see screen shot below).

When the variable inputs are all within the acceptable restrictions, no spaces, small character count and only underscores.

the only way to remiedate this issue is to simply rerun "terraform apply" and the error is gone and the configuration is fully deployed.

Thinking this maybe a bug because it makes no sense why it would error out the first time but the second time it successfully competes.

Error_Creating_Codebuild_Project

resource "aws_codebuild_project" "container" {
name = join("", ["${var.ami_repo_name}", "-build"])
description = join("", ["Build for ", "${var.ami_repo_name}", " repository"])
build_timeout = "180"
service_role = aws_iam_role.codebuild_service_role.arn
badge_enabled = false

artifacts {
type = "NO_ARTIFACTS"
}

cache {
type = "NO_CACHE"
}

environment {
compute_type = "BUILD_GENERAL1_SMALL"
image = "aws/codebuild/amazonlinux2-x86_64-standard:2.0"
type = "LINUX_CONTAINER"
image_pull_credentials_type = "CODEBUILD"
}

logs_config {
cloudwatch_logs {
status = "ENABLED"
group_name = ""
stream_name = ""
}

s3_logs {
  status = "DISABLED"
}

}

source {
type = "S3"
location = join("/",["${var.ami_repo_bucket_name}","${var.ami_repo_name}", "master.zip"])
}

secondary_sources {
type            	= "S3"
	source_identifier = "ami_scripts"
location        	= join("/",["${var.ami_scripts_repo_bucket_name}","${var.ami_scripts_repo_name}", "master.zip"])

}

vpc_config {
vpc_id = var.vpc_id

subnets = [
  "${var.private_subnet_ids[0]}",
  "${var.private_subnet_ids[1]}",
]

security_group_ids = [
  aws_security_group.codebuild_packer.id
]

}

tags = {
Environment = "Prod"
Terraform = "True"
}
}

@ghost ghost added the service/codebuild Issues and PRs that pertain to the codebuild service. label Jan 23, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 23, 2020
@AzySir
Copy link

AzySir commented Jan 24, 2020

Also having the same issue!

@bflad bflad 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 Jan 24, 2020
@bflad bflad added this to the v2.46.0 milestone Jan 24, 2020
@bflad
Copy link
Contributor

bflad commented Jan 24, 2020

Hi @LennyCastaneda 👋 Thank you for reporting this issue and sorry you are running into trouble. This is due to a regression in version 2.45.0 of the Terraform AWS Provider (#11682) and was resolved in Terraform AWS Provider version 2.46.0, which was released January 23rd. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. 👍

@bflad bflad closed this as completed Jan 24, 2020
@LennyCastaneda
Copy link
Author

LennyCastaneda commented Jan 24, 2020

Wow that was fast! Thanks @bflad ... I'll get that provider upgraded.

@AzySir
Copy link

AzySir commented Jan 27, 2020

Hey @LennyCastaneda how did you go? Did it work when you updated the provider?

@LennyCastaneda
Copy link
Author

Hi @AzySir it worked well. The “InvalidInputException” error did not occur. I just updated all my root modules with 2.46 and all good to go now. Thanks again for putting that patch.

@LennyCastaneda
Copy link
Author

Hey @AzySir I did notice something strange after the update though....I'll create a new issue ticket but it was when I did a plan Terraform attempted to recreate resources that already exists despite no changes to my TF code.

@LennyCastaneda
Copy link
Author

#11807

@ghost
Copy link

ghost commented Mar 27, 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 Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/codebuild Issues and PRs that pertain to the codebuild service.
Projects
None yet
Development

No branches or pull requests

3 participants