# SourceConfig

The type returned from `ISource#bind`.

- Source: [`aws-codebuild/lib/source.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-codebuild/lib/source.ts#L20)

## 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 sourceConfig: codebuild.SourceConfig = {
  sourceProperty: {
    type: 'type',

    // the properties below are optional
    auth: {
      type: 'type',

      // the properties below are optional
      resource: 'resource',
    },
    buildSpec: 'buildSpec',
    buildStatusConfig: {
      context: 'context',
      targetUrl: 'targetUrl',
    },
    gitCloneDepth: 123,
    gitSubmodulesConfig: {
      fetchSubmodules: false,
    },
    insecureSsl: false,
    location: 'location',
    reportBuildStatus: false,
    sourceIdentifier: 'sourceIdentifier',
  },

  // the properties below are optional
  buildTriggers: {
    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,
  },
  sourceVersion: 'sourceVersion',
};
```

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

source_config = codebuild.SourceConfig(
    source_property=codebuild.CfnProject.SourceProperty(
        type="type",

        # the properties below are optional
        auth=codebuild.CfnProject.SourceAuthProperty(
            type="type",

            # the properties below are optional
            resource="resource"
        ),
        build_spec="buildSpec",
        build_status_config=codebuild.CfnProject.BuildStatusConfigProperty(
            context="context",
            target_url="targetUrl"
        ),
        git_clone_depth=123,
        git_submodules_config=codebuild.CfnProject.GitSubmodulesConfigProperty(
            fetch_submodules=False
        ),
        insecure_ssl=False,
        location="location",
        report_build_status=False,
        source_identifier="sourceIdentifier"
    ),

    # the properties below are optional
    build_triggers=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
    ),
    source_version="sourceVersion"
)
```

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.*;

SourceConfig sourceConfig = SourceConfig.builder()
        .sourceProperty(SourceProperty.builder()
                .type("type")

                // the properties below are optional
                .auth(SourceAuthProperty.builder()
                        .type("type")

                        // the properties below are optional
                        .resource("resource")
                        .build())
                .buildSpec("buildSpec")
                .buildStatusConfig(BuildStatusConfigProperty.builder()
                        .context("context")
                        .targetUrl("targetUrl")
                        .build())
                .gitCloneDepth(123)
                .gitSubmodulesConfig(GitSubmodulesConfigProperty.builder()
                        .fetchSubmodules(false)
                        .build())
                .insecureSsl(false)
                .location("location")
                .reportBuildStatus(false)
                .sourceIdentifier("sourceIdentifier")
                .build())

        // the properties below are optional
        .buildTriggers(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())
        .sourceVersion("sourceVersion")
        .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 sourceConfig = new SourceConfig {
    SourceProperty = new SourceProperty {
        Type = "type",

        // the properties below are optional
        Auth = new SourceAuthProperty {
            Type = "type",

            // the properties below are optional
            Resource = "resource"
        },
        BuildSpec = "buildSpec",
        BuildStatusConfig = new BuildStatusConfigProperty {
            Context = "context",
            TargetUrl = "targetUrl"
        },
        GitCloneDepth = 123,
        GitSubmodulesConfig = new GitSubmodulesConfigProperty {
            FetchSubmodules = false
        },
        InsecureSsl = false,
        Location = "location",
        ReportBuildStatus = false,
        SourceIdentifier = "sourceIdentifier"
    },

    // the properties below are optional
    BuildTriggers = 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
    },
    SourceVersion = "sourceVersion"
};
```

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"

sourceConfig := &SourceConfig{
	SourceProperty: &SourceProperty{
		Type: jsii.String("type"),

		// the properties below are optional
		Auth: &SourceAuthProperty{
			Type: jsii.String("type"),

			// the properties below are optional
			Resource: jsii.String("resource"),
		},
		BuildSpec: jsii.String("buildSpec"),
		BuildStatusConfig: &BuildStatusConfigProperty{
			Context: jsii.String("context"),
			TargetUrl: jsii.String("targetUrl"),
		},
		GitCloneDepth: jsii.Number(123),
		GitSubmodulesConfig: &GitSubmodulesConfigProperty{
			FetchSubmodules: jsii.Boolean(false),
		},
		InsecureSsl: jsii.Boolean(false),
		Location: jsii.String("location"),
		ReportBuildStatus: jsii.Boolean(false),
		SourceIdentifier: jsii.String("sourceIdentifier"),
	},

	// the properties below are optional
	BuildTriggers: &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),
	},
	SourceVersion: jsii.String("sourceVersion"),
}
```

## Properties

- `buildTriggers`: [CfnProject.ProjectTriggersProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.CfnProject.ProjectTriggersProperty.html)

- `sourceProperty`: [CfnProject.SourceProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.CfnProject.SourceProperty.html) (required)

- `sourceVersion`: string — `AWS::CodeBuild::Project.SourceVersion`.

  **Default:** the latest version
