interface CodeBuildProjectProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Events.Targets.CodeBuildProjectProps |
![]() | software.amazon.awscdk.services.events.targets.CodeBuildProjectProps |
![]() | aws_cdk.aws_events_targets.CodeBuildProjectProps |
![]() | @aws-cdk/aws-events-targets » CodeBuildProjectProps |
Customize the CodeBuild Event Target.
Example
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codecommit from '@aws-cdk/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
Name | Type | Description |
---|---|---|
dead | IQueue | The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue. |
event? | Rule | The event to send to CodeBuild. |
event | IRole | The role to assume before invoking the target (i.e., the codebuild) when the given rule is triggered. |
max | Duration | The maximum age of a request that Lambda sends to a function for processing. |
retry | number | The maximum number of times to retry when the function returns an error. |
deadLetterQueue?
Type:
IQueue
(optional, default: no dead-letter queue)
The SQS queue to be used as deadLetterQueue. Check out the considerations for using a 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?
Type:
Rule
(optional, default: the entire EventBridge event)
The event to send to CodeBuild.
This will be the payload for the StartBuild API.
eventRole?
Type:
IRole
(optional, default: a new role will be created)
The role to assume before invoking the target (i.e., the codebuild) when the given rule is triggered.
maxEventAge?
Type:
Duration
(optional, default: 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?
Type:
number
(optional, default: 185)
The maximum number of times to retry when the function returns an error.
Minimum value of 0. Maximum value of 185.