英文:
CodePipeline: Action configuration for action '2ndSource' contains unknown configuration 'PollForSourceChanges'
问题
根据您提供的内容,以下是代码部分的翻译:
There is AWS CodePipeline based on two Github source. Requirement is to restrict the pipeline auto trigger for primary source only. Found <a href="https://github.com/aws-samples/aws-codepipeline-terraform-cicd-samples/blob/7d58aa2a669b3147f05d4992e90847271d8b0f9d/modules/codepipeline/main.tf#L38">this</a> snippet from terraform aws samples to disable auto trigger.
I tried the same but getting error (Tested with latest hashicorp/aws "4.57.1" version too) - 
Error: updating CodePipeline (xxxx): InvalidActionDeclarationException: Action configuration for action '2ndSource' contains unknown configuration 'PollForSourceChanges'
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws";
      version = "~> 4.57.1";
    }
  }
}
resource "aws_codepipeline" "service" {
  name     = "${var.environment}-${var.name}";
  role_arn = var.codepipeline_role_arn
  artifact_store {
    location = "${var.aws_s3_bucket_id}";
    type     = "S3";
  }
  stage {
    name = "Source";
    action {
      name             = "Source";
      category         = "Source";
      owner            = "AWS";
      provider         = "CodeStarSourceConnection";
      version          = "1";
      output_artifacts = ["source"];
      configuration = {
        ConnectionArn    = var.codestarconn_role_arn;
        FullRepositoryId = var.source_location;
        BranchName       = var.source_version;
      }
      run_order = "1";
    }
    action {
      name             = "2ndSource";
      category         = "Source";
      owner            = "AWS";
      provider         = "CodeStarSourceConnection";
      version          = "1";
      output_artifacts = ["source2"];
      configuration = {
        ConnectionArn    = var.codestarconn_role_arn;
        FullRepositoryId = var.deploy_repo;
        BranchName       = var.deploy_branch;
        PollForSourceChanges = "false"; // ---->> Throwing error
      }
      run_order = "2";
    }
  }
}
希望这可以帮助您理解代码的内容。如果您有其他问题或需要进一步的翻译,请告诉我。
英文:
There is AWS CodePipeline based on two Github source. Requirement is to restrict the pipeline auto trigger for primary source only. Found <a href="https://github.com/aws-samples/aws-codepipeline-terraform-cicd-samples/blob/7d58aa2a669b3147f05d4992e90847271d8b0f9d/modules/codepipeline/main.tf#L38"> this</a> snippet from terraform aws samples to disable auto trigger.
I tried the same but getting error (Tested with latest hashicorp/aws "4.57.1" version too) -
Error: updating CodePipeline (xxxx): InvalidActionDeclarationException: Action configuration for action '2ndSource' contains unknown configuration 'PollForSourceChanges'
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.57.1"
    }
  }
}
resource "aws_codepipeline" "service" {
  name     = "${var.environment}-${var.name}"
  role_arn = var.codepipeline_role_arn
  artifact_store {
    location = "${var.aws_s3_bucket_id}"
    type     = "S3"
  }
  stage {
    name = "Source"
    action {
      name             = "Source"
      category         = "Source"
      owner            = "AWS"
      provider         = "CodeStarSourceConnection"
      version          = "1"
      output_artifacts = ["source"]
      configuration = {
        ConnectionArn    = var.codestarconn_role_arn
        FullRepositoryId = var.source_location
        BranchName       = var.source_version
      }
      run_order = "1"
    }
    action {
      name             = "2ndSource"
      category         = "Source"
      owner            = "AWS"
      provider         = "CodeStarSourceConnection"
      version         = "1"
      output_artifacts = ["source2"]
      configuration = {
        ConnectionArn    = var.codestarconn_role_arn
        FullRepositoryId = var.deploy_repo
        BranchName       = var.deploy_branch
        PollForSourceChanges = "false" // ---->> Throwing error
      }
      run_order = "2"
    }
  }
}
</details>
# 答案1
**得分**: 2
`PollForSourceChanges` 用于 AWS 源操作,如 S3、CodeCommit。对于 Github、Bitbucket、Github Enterprise,我们使用 CodeStar 连接,并可以通过将参数 `DetectChanges` 配置为 `false` 来禁用自动触发。[此处](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html#action-reference-CodestarConnectionSource-config)提供了 CodeStar 连接源操作的完整配置参数列表。
<details>
<summary>英文:</summary>
`PollForSourceChanges` is used for AWS Source actions such as S3, CodeCommit. For Github, Bitbucket, Github Enterprise we use CodeStar Connection and you can disable the auto trigger by configuring the parameter `DetectChanges` as `false`. [Here][1] are the full list of Configuration parameters for CodeStar Connection source action.
  [1]: https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html#action-reference-CodestarConnectionSource-config
</details>
# 答案2
**得分**: 0
After a lot of googling... found `DetectChanges = "false"`. It suffices my requirement.
<details>
<summary>英文:</summary>
After a lots of googling...found `DetectChanges = "false"`. It suffice my requirement.
</details>
				通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论