# CodeBuildProjectProps

Customize the CodeBuild Event Target.

Extends: CodeBuildProjectProps
Extends: TargetBaseProps
Used as props by: CodeBuildProject

- Source: [`aws-events-targets/lib/codebuild.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-events-targets/lib/codebuild.ts#L10)

## Example

```ts
import * as codebuild from 'aws-cdk-lib/aws-codebuild';
import * as codecommit from 'aws-cdk-lib/aws-codecommit';

const repo = new codecommit.Repository(this, 'MyRepo', {
  repositoryName: 'aws-cdk-codebuild-events',
});

const project = new codebuild.Project(this, 'MyProject', {
  source: codebuild.Source.codeCommit({ repository: repo }),
});

const deadLetterQueue = new sqs.Queue(this, 'DeadLetterQueue');

// trigger a build when a commit is pushed to the repo
const onCommitRule = repo.onCommit('OnCommit', {
  target: new targets.CodeBuildProject(project, {
    deadLetterQueue: deadLetterQueue,
  }),
  branches: ['master'],
});
```

## Properties

- `deadLetterQueue`: [IQueue](/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.IQueue.html) — The SQS queue to be used as deadLetterQueue. Check out the [considerations for using a dead-letter queue](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html#dlq-considerations).

  **Default:** no dead-letter queue

  The events not successfully delivered are automatically retried for a specified period of time,
  depending on the retry policy of the target.
  If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.

- `event`: [RuleTargetInput](/cdk/api/v2/docs/aws-cdk-lib.aws_events.RuleTargetInput.html) — The event to send to CodeBuild.

  **Default:** the entire EventBridge event

  This will be the payload for the StartBuild API.

- `eventRole`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The role to assume before invoking the target (i.e., the codebuild) when the given rule is triggered.

  **Default:** a new role will be created

- `maxEventAge`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.hours(24) — The maximum age of a request that Lambda sends to a function for processing.

  Minimum value of 60.
  Maximum value of 86400.

- `retryAttempts`: number = 185 — The maximum number of times to retry when the function returns an error.

  Minimum value of 0.
  Maximum value of 185.
