作者:宝宝田小丫 | 来源:互联网 | 2023-08-01 16:42
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.
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 = ""
}
1 2 3
| s3_logs {
status = "DISABLED"
} |
}
source {
type = "S3"
location = join("/",["${var.ami_repo_bucket_name}","${var.ami_repo_name}", "master.zip"])
}
1 2 3 4
| 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
1 2 3 4 5 6 7 8
| 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"
}
}
该提问来源于开源项目:hashicorp/terraform-provider-aws
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!