CodePipeline: 操作 ‘2ndSource’ 的配置包含未知配置 ‘PollForSourceChanges’

huangapple go评论56阅读模式
英文:

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  = &quot;hashicorp/aws&quot;
      version = &quot;~&gt; 4.57.1&quot;
    }
  }
}

resource &quot;aws_codepipeline&quot; &quot;service&quot; {
  name     = &quot;${var.environment}-${var.name}&quot;
  role_arn = var.codepipeline_role_arn

  artifact_store {
    location = &quot;${var.aws_s3_bucket_id}&quot;
    type     = &quot;S3&quot;
  }

  stage {
    name = &quot;Source&quot;
    action {
      name             = &quot;Source&quot;
      category         = &quot;Source&quot;
      owner            = &quot;AWS&quot;
      provider         = &quot;CodeStarSourceConnection&quot;
      version          = &quot;1&quot;
      output_artifacts = [&quot;source&quot;]

      configuration = {
        ConnectionArn    = var.codestarconn_role_arn
        FullRepositoryId = var.source_location
        BranchName       = var.source_version
      }
      run_order = &quot;1&quot;
    }

    action {
      name             = &quot;2ndSource&quot;
      category         = &quot;Source&quot;
      owner            = &quot;AWS&quot;
      provider         = &quot;CodeStarSourceConnection&quot;
      version         = &quot;1&quot;
      output_artifacts = [&quot;source2&quot;]

      configuration = {
        ConnectionArn    = var.codestarconn_role_arn
        FullRepositoryId = var.deploy_repo
        BranchName       = var.deploy_branch
        PollForSourceChanges = &quot;false&quot; // ----&gt;&gt; Throwing error
      }
      run_order = &quot;2&quot;
    }
  }
}


</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 = &quot;false&quot;`. It suffice my requirement.

</details>



huangapple
  • 本文由 发表于 2023年3月9日 19:49:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/75684204.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定