使用 AWS Codecommit 的 AWS Codebuild 项目
需要社区的一些帮助。我想我几乎已经有了它,但我找不到向我展示如何使用 AWS Codecommit 配置 Codebuild 项目的文档。寻找有人给我一些可以帮助我的链接或对我的代码有一些帮助。
resource "aws_codebuild_project" "cb_test_project" {
name = var.cb_name
description = var.description
build_timeout = var.build_timeout
service_role = var.cb_service_role
source_version = var.branch_name //set to main by default
artifacts {
type = "NO_ARTIFACTS"
}
environment {
compute_type = var.compute_type
image = var.image
type = var.environment_type
image_pull_credentials_type = "CODEBUILD"
privileged_mode = var.privileged_mode
}
source {
type = "CODECOMMIT"
location = "my_codecommit_repo"
buildspec = var.buildspec
}
}
我的问题是每次运行构建时都会失败。 Terraform Plan 通过了所有检查,但应用只是出错。我不知道语法可能有什么问题,但我希望我只是错过了一些可以通过构建的简单内容。
Need some help from the community. I think I almost have it but I can't find documentation showing me how to configure Codebuild project with AWS Codecommit. Looking for someone to give me a few links that can help or some assistance with my code.
resource "aws_codebuild_project" "cb_test_project" {
name = var.cb_name
description = var.description
build_timeout = var.build_timeout
service_role = var.cb_service_role
source_version = var.branch_name //set to main by default
artifacts {
type = "NO_ARTIFACTS"
}
environment {
compute_type = var.compute_type
image = var.image
type = var.environment_type
image_pull_credentials_type = "CODEBUILD"
privileged_mode = var.privileged_mode
}
source {
type = "CODECOMMIT"
location = "my_codecommit_repo"
buildspec = var.buildspec
}
}
My issue is it fails every time I run the build. Terraform Plan passes all the checks but the apply just errors out. I have no insight into what may be wrong with the syntax but I am hoping i am just missing something simple that will pass the build.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我提供了用于解决此问题的当前更新配置。
正如您所看到的,我错误配置了资源并滥用了其他变量。请访问 GitHub请参阅此的填写样本。
I am providing the current updated configurations that were used to address this issue.
As you can see, I had misconfigured the resource and misused other variables. Please visit GitHub to see a filled-out sample of this.