Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set FilterGroups for Build Triggers in CodeBuild Project #1842

Closed
skorfmann opened this issue Feb 22, 2019 · 1 comment · Fixed by #2319 · May be fixed by MechanicalRock/account-reaper#6
Closed

Allow to set FilterGroups for Build Triggers in CodeBuild Project #1842

skorfmann opened this issue Feb 22, 2019 · 1 comment · Fixed by #2319 · May be fixed by MechanicalRock/account-reaper#6
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/medium Medium work item – several days of effort

Comments

@skorfmann
Copy link
Contributor

Looks like there's the Webhook property defined in the Layer 1 resource. According to the documentation, it should be possible to set FilterGroups as well - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projecttriggers.html#cfn-codebuild-project-projecttriggers-filtergroups

I was trying to fall back to L1 but it's missing there.

const projectResource = project.node.findChild(
      "Resource"
    ) as codebuild.CfnProject;

 projectResource.propertyOverrides.triggers = { // doesn't take `FilterGroups'
    webhook: true
}

Would appreciate hints on how to make it work.

@skorfmann
Copy link
Contributor Author

Got it working with this workaround:

    const projectResource = project.node.findChild(
      "Resource"
    ) as codebuild.CfnProject;

    projectResource.addPropertyOverride("Triggers", {
      Webhook: true,
      FilterGroups: [
        [
          {
            Pattern: "PULL_REQUEST_CREATED,PULL_REQUEST_UPDATED",
            Type: "EVENT"
          }
        ]
      ]
    });

@eladb eladb added the @aws-cdk/aws-codebuild Related to AWS CodeBuild label Feb 24, 2019
@skinny85 skinny85 added the effort/medium Medium work item – several days of effort label Mar 18, 2019
@skinny85 skinny85 removed their assignment Mar 18, 2019
Kaixiang-AWS added a commit to Kaixiang-AWS/aws-cdk that referenced this issue Apr 18, 2019
skinny85 pushed a commit to Kaixiang-AWS/aws-cdk that referenced this issue May 1, 2019
skinny85 pushed a commit to Kaixiang-AWS/aws-cdk that referenced this issue May 2, 2019
skinny85 pushed a commit to Kaixiang-AWS/aws-cdk that referenced this issue May 2, 2019
SanderKnape pushed a commit to SanderKnape/aws-cdk that referenced this issue May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/medium Medium work item – several days of effort
Projects
None yet
5 participants