provider "aws" {
region = "us-west-2"
profile = var.awsProfile
}
terraform {
backend "s3" {
bucket = "tXXXX"
dynamodb_table = "XXXX"
key = "XXXXX"
region = "us-west-2"
profile = "XXXXX"
}
}
module "config" {
source = "../modules/config"
}
module "notifications" {
source = "../modules/notifications"
codebuildPolicyARN = module.config.code-build-ploicy-arn
}
module "test-terraform-pipeline" {
source = "../modules/pipeline"
artifactId = var.artifactIdartifacts
S3BucketName = module.config.artifact_s3_bucket_name
codebuildPolicyARN = module.config.code-build-ploicy-arncache
S3BucketName = module.config.cache_s3_bucket_name
notificationSNSARN = module.notifications.cicd-notification-sns-arn
}
module "test-terraform-pipeline-1" {
source = "../modules/pipeline"
artifactId = var.artifactIdartifacts
S3BucketName = module.config.artifact_s3_bucket_name
codebuildPolicyARN = module.config.code-build-ploicy-arncache
S3BucketName = module.config.cache_s3_bucket_name
notificationSNSARN = module.notifications.cicd-notification-sns-arn
}
这是我的main.tf,首先创建带有test-terraform-pipeline模块的管道,然后将test-terraform-pipeline-1模块添加到main.tf中,以创建新管道,并在运行{{1 }},terraform表示它将使用test-terraform-pipeline-1覆盖test-terraform-pipeline配置,而不是我想要它们两者。为什么会发生这种情况以及如何解决?