Skip to content
v2.277.0

CodePipelineTargetOptions Struct ​

Customization options when creating a CodePipeline event target.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_events_targets as events_targets } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_sqs as sqs } from 'aws-cdk-lib';

declare const queue: sqs.Queue;
declare const role: iam.Role;
const codePipelineTargetOptions: events_targets.CodePipelineTargetOptions = {
  deadLetterQueue: queue,
  eventRole: role,
  maxEventAge: cdk.Duration.minutes(30),
  retryAttempts: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_events_targets as events_targets
from aws_cdk import aws_iam as iam
from aws_cdk import aws_sqs as sqs

# queue: sqs.Queue
# role: iam.Role

code_pipeline_target_options = events_targets.CodePipelineTargetOptions(
    dead_letter_queue=queue,
    event_role=role,
    max_event_age=cdk.Duration.minutes(30),
    retry_attempts=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.events.targets.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.sqs.*;

Queue queue;
Role role;

CodePipelineTargetOptions codePipelineTargetOptions = CodePipelineTargetOptions.builder()
        .deadLetterQueue(queue)
        .eventRole(role)
        .maxEventAge(Duration.minutes(30))
        .retryAttempts(123)
        .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;
using Amazon.CDK.AWS.Events.Targets;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.SQS;

Queue queue;
Role role;

var codePipelineTargetOptions = new CodePipelineTargetOptions {
    DeadLetterQueue = queue,
    EventRole = role,
    MaxEventAge = Duration.Minutes(30),
    RetryAttempts = 123
};
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 cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var queue Queue
var role Role

codePipelineTargetOptions := &CodePipelineTargetOptions{
	DeadLetterQueue: queue,
	EventRole: role,
	MaxEventAge: cdk.Duration_Minutes(jsii.Number(30)),
	RetryAttempts: jsii.Number(123),
}

Properties ​

deadLetterQueueoptionalIQueuedead_letter_queueoptionalIQueuedeadLetterQueueoptionalIQueueDeadLetterQueueoptionalIQueueDeadLetterQueueoptionalIQueue #
The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.

Default: no dead-letter queue

notes

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.

eventRoleoptionalIRoleevent_roleoptionalIRoleeventRoleoptionalIRoleEventRoleoptionalIRoleEventRoleoptionalIRole #
The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.

Default: a new role will be created

maxEventAgeoptionalDurationmax_event_ageoptionalDurationmaxEventAgeoptionalDurationMaxEventAgeoptionalDurationMaxEventAgeoptionalDuration = 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.

retryAttemptsoptionalnumberretry_attemptsoptionalint | floatretryAttemptsoptionalNumberRetryAttemptsoptionaldoubleRetryAttemptsoptional*float64 = 185 #
The maximum number of times to retry when the function returns an error.

Minimum value of 0. Maximum value of 185.