Class CodeBuildProjectProps
Customize the CodeBuild Event Target.
Inheritance
Namespace: Amazon.CDK.AWS.Events.Targets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CodeBuildProjectProps : Object, ICodeBuildProjectProps, ITargetBaseProps
Syntax (vb)
Public Class CodeBuildProjectProps
Inherits Object
Implements ICodeBuildProjectProps, ITargetBaseProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CodeBuild;
using Amazon.CDK.AWS.CodeCommit;
var repo = new Repository(this, "MyRepo", new RepositoryProps {
RepositoryName = "aws-cdk-codebuild-events"
});
var project = new Project(this, "MyProject", new ProjectProps {
Source = Source.CodeCommit(new CodeCommitSourceProps { Repository = repo })
});
var deadLetterQueue = new Queue(this, "DeadLetterQueue");
// trigger a build when a commit is pushed to the repo
var onCommitRule = repo.OnCommit("OnCommit", new OnCommitOptions {
Target = new CodeBuildProject(project, new CodeBuildProjectProps {
DeadLetterQueue = deadLetterQueue
}),
Branches = new [] { "master" }
});
Synopsis
Constructors
CodeBuildProjectProps() |
Properties
DeadLetterQueue | The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue. |
Event | The event to send to CodeBuild. |
EventRole | The role to assume before invoking the target (i.e., the codebuild) when the given rule is triggered. |
MaxEventAge | The maximum age of a request that Lambda sends to a function for processing. |
RetryAttempts | The maximum number of times to retry when the function returns an error. |
Constructors
CodeBuildProjectProps()
public CodeBuildProjectProps()
Properties
DeadLetterQueue
The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.
public IQueue DeadLetterQueue { get; set; }
Property Value
Remarks
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.
Default: - no dead-letter queue
Event
The event to send to CodeBuild.
public RuleTargetInput Event { get; set; }
Property Value
Remarks
This will be the payload for the StartBuild API.
Default: - the entire EventBridge event
EventRole
The role to assume before invoking the target (i.e., the codebuild) when the given rule is triggered.
public IRole EventRole { get; set; }
Property Value
Remarks
Default: - a new role will be created
MaxEventAge
The maximum age of a request that Lambda sends to a function for processing.
public Duration MaxEventAge { get; set; }
Property Value
Remarks
Minimum value of 60. Maximum value of 86400.
Default: Duration.hours(24)
RetryAttempts
The maximum number of times to retry when the function returns an error.
public Nullable<double> RetryAttempts { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Minimum value of 0. Maximum value of 185.
Default: 185