Skip to content
v2.277.0

ProjectTriggersProperty Struct ​

ProjectTriggers is a property of the AWS CodeBuild Project 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.

Example ​

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
# 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
// 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();
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
};
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 ​

buildTypeoptionalstringbuild_typeoptionalstrbuildTypeoptionalStringBuildTypeoptionalstringBuildTypeoptional*string #
Specifies the type of build this webhook will trigger. Allowed values are:.
  • BUILD - A single build
  • BUILD_BATCH - A batch build
filterGroupsoptionalIResolvable | IResolvable | IResolvable | CfnProject.WebhookFilterProperty[][]filter_groupsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, typing.List[typing.Union[IResolvable, WebhookFilterProperty]]]]]filterGroupsoptionalIResolvableFilterGroupsoptionalIResolvableFilterGroupsoptionalinterface{} #
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.

pullRequestBuildPolicyoptionalIResolvable | CfnProject.PullRequestBuildPolicyPropertypull_request_build_policyoptionaltyping.Union[IResolvable, PullRequestBuildPolicyProperty]pullRequestBuildPolicyoptionalIResolvablePullRequestBuildPolicyoptionalIResolvablePullRequestBuildPolicyoptionalinterface{} #
scopeConfigurationoptionalIResolvable | CfnProject.ScopeConfigurationPropertyscope_configurationoptionaltyping.Union[IResolvable, ScopeConfigurationProperty]scopeConfigurationoptionalIResolvableScopeConfigurationoptionalIResolvableScopeConfigurationoptionalinterface{} #
Contains configuration information about the scope for a webhook.
webhookoptionalboolean | IResolvablewebhookoptionaltyping.Union[bool, IResolvable]webhookoptionalBooleanWebhookoptionalboolWebhookoptionalinterface{} #
Specifies whether or not to begin automatically rebuilding the source code every time a code change is pushed to the repository.