# ProjectTriggersProperty

`ProjectTriggers` is a property of the [AWS CodeBuild Project](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html) resource that specifies webhooks that trigger an AWS CodeBuild build.

> The Webhook feature isn't available in AWS CloudFormation for GitHub Enterprise projects. Use the AWS CLI or AWS CodeBuild console to create the webhook.

- Source: Generated at build time
- Type last changed: v2.212.0 · 20 Aug 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
const projectTriggersProperty: codebuild.CfnProject.ProjectTriggersProperty = {
  buildType: 'buildType',
  filterGroups: [[{
    pattern: 'pattern',
    type: 'type',

    // the properties below are optional
    excludeMatchedPattern: false,
  }]],
  pullRequestBuildPolicy: {
    requiresCommentApproval: 'requiresCommentApproval',

    // the properties below are optional
    approverRoles: ['approverRoles'],
  },
  scopeConfiguration: {
    name: 'name',

    // the properties below are optional
    domain: 'domain',
    scope: 'scope',
  },
  webhook: false,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codebuild as codebuild

project_triggers_property = codebuild.CfnProject.ProjectTriggersProperty(
    build_type="buildType",
    filter_groups=[[codebuild.CfnProject.WebhookFilterProperty(
        pattern="pattern",
        type="type",

        # the properties below are optional
        exclude_matched_pattern=False
    )]],
    pull_request_build_policy=codebuild.CfnProject.PullRequestBuildPolicyProperty(
        requires_comment_approval="requiresCommentApproval",

        # the properties below are optional
        approver_roles=["approverRoles"]
    ),
    scope_configuration=codebuild.CfnProject.ScopeConfigurationProperty(
        name="name",

        # the properties below are optional
        domain="domain",
        scope="scope"
    ),
    webhook=False
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codebuild.*;

ProjectTriggersProperty projectTriggersProperty = ProjectTriggersProperty.builder()
        .buildType("buildType")
        .filterGroups(List.of(List.of(WebhookFilterProperty.builder()
                .pattern("pattern")
                .type("type")

                // the properties below are optional
                .excludeMatchedPattern(false)
                .build())))
        .pullRequestBuildPolicy(PullRequestBuildPolicyProperty.builder()
                .requiresCommentApproval("requiresCommentApproval")

                // the properties below are optional
                .approverRoles(List.of("approverRoles"))
                .build())
        .scopeConfiguration(ScopeConfigurationProperty.builder()
                .name("name")

                // the properties below are optional
                .domain("domain")
                .scope("scope")
                .build())
        .webhook(false)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodeBuild;

var projectTriggersProperty = new ProjectTriggersProperty {
    BuildType = "buildType",
    FilterGroups = new [] { new [] { new WebhookFilterProperty {
        Pattern = "pattern",
        Type = "type",

        // the properties below are optional
        ExcludeMatchedPattern = false
    } } },
    PullRequestBuildPolicy = new PullRequestBuildPolicyProperty {
        RequiresCommentApproval = "requiresCommentApproval",

        // the properties below are optional
        ApproverRoles = new [] { "approverRoles" }
    },
    ScopeConfiguration = new ScopeConfigurationProperty {
        Name = "name",

        // the properties below are optional
        Domain = "domain",
        Scope = "scope"
    },
    Webhook = false
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

projectTriggersProperty := &ProjectTriggersProperty{
	BuildType: jsii.String("buildType"),
	FilterGroups: []interface{}{
		[]interface{}{
			&WebhookFilterProperty{
				Pattern: jsii.String("pattern"),
				Type: jsii.String("type"),

				// the properties below are optional
				ExcludeMatchedPattern: jsii.Boolean(false),
			},
		},
	},
	PullRequestBuildPolicy: &PullRequestBuildPolicyProperty{
		RequiresCommentApproval: jsii.String("requiresCommentApproval"),

		// the properties below are optional
		ApproverRoles: []*string{
			jsii.String("approverRoles"),
		},
	},
	ScopeConfiguration: &ScopeConfigurationProperty{
		Name: jsii.String("name"),

		// the properties below are optional
		Domain: jsii.String("domain"),
		Scope: jsii.String("scope"),
	},
	Webhook: jsii.Boolean(false),
}
```

## Properties

- `buildType`: string — Specifies the type of build this webhook will trigger. Allowed values are:.

  - **BUILD** - A single build
  - **BUILD_BATCH** - A batch build

- `filterGroups`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnProject.WebhookFilterProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.CfnProject.WebhookFilterProperty.html)[][] — A list of lists of `WebhookFilter` objects used to determine which webhook events are triggered.

  At least one `WebhookFilter` in the array must specify `EVENT` as its type.

- `pullRequestBuildPolicy`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnProject.PullRequestBuildPolicyProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.CfnProject.PullRequestBuildPolicyProperty.html)

- `scopeConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnProject.ScopeConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.CfnProject.ScopeConfigurationProperty.html) — Contains configuration information about the scope for a webhook.

- `webhook`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Specifies whether or not to begin automatically rebuilding the source code every time a code change is pushed to the repository.
