我正在尝试自动化项目和资源创建,以及使用 terraform 自动化云构建的触发器。要使用云构建触发器,我必须将位桶存储库镜像到 GCP 的源存储库中。
我使用下面的内容创建源项目 https://www.terraform.io/docs/providers/google/r/cloudbuild_trigger.html,但没有设置镜像的选项。
在挖掘GCP的API(https://cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/create)后,我可以看到一个mirrorConfig选项,但文档说它处于读取状态-仅模式。当我为 API 设置mirrorConfig 时,出现以下错误。
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "repo.mirror_config",
"description": "mirror_config is a read-only field and must not be set"
}
]
}
Run Code Online (Sandbox Code Playgroud)
有没有办法使用 terraform 自动将存储库镜像从位桶到 GCP 中的源存储库?如果没有,是否有其他方法/工具可以实现这一目标?
bitbucket google-cloud-platform terraform terraform-provider-gcp