aws-cdk-lib.aws_codepipeline_actions.S3SourceActionProps

interface S3SourceActionProps

LanguageType name
.NETAmazon.CDK.AWS.CodePipeline.Actions.S3SourceActionProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodepipelineactions#S3SourceActionProps
Javasoftware.amazon.awscdk.services.codepipeline.actions.S3SourceActionProps
Pythonaws_cdk.aws_codepipeline_actions.S3SourceActionProps
TypeScript (source)aws-cdk-lib » aws_codepipeline_actions » S3SourceActionProps

Construction properties of the S3SourceAction S3 source Action.

Example

import * as cloudtrail from 'aws-cdk-lib/aws-cloudtrail';

declare const sourceBucket: s3.Bucket;
const sourceOutput = new codepipeline.Artifact();
const key = 'some/key.zip';
const trail = new cloudtrail.Trail(this, 'CloudTrail');
trail.addS3EventSelector([{
  bucket: sourceBucket,
  objectPrefix: key,
}], {
  readWriteType: cloudtrail.ReadWriteType.WRITE_ONLY,
});
const sourceAction = new codepipeline_actions.S3SourceAction({
  actionName: 'S3Source',
  bucketKey: key,
  bucket: sourceBucket,
  output: sourceOutput,
  trigger: codepipeline_actions.S3Trigger.EVENTS, // default: S3Trigger.POLL
});

Properties

NameTypeDescription
actionNamestringThe physical, human-readable name of the Action.
bucketIBucketThe Amazon S3 bucket that stores the source code.
bucketKeystringThe key within the S3 bucket that stores the source code.
outputArtifact
role?IRoleThe Role in which context's this Action will be executing in.
runOrder?numberThe runOrder property for this Action.
trigger?S3TriggerHow should CodePipeline detect source changes for this Action.
variablesNamespace?stringThe name of the namespace to use for variables emitted by this action.

actionName

Type: string

The physical, human-readable name of the Action.

Note that Action names must be unique within a single Stage.


bucket

Type: IBucket

The Amazon S3 bucket that stores the source code.

If you import an encrypted bucket in your stack, please specify the encryption key at import time by using Bucket.fromBucketAttributes() method.


bucketKey

Type: string

The key within the S3 bucket that stores the source code. Example

'path/to/file.zip'

output

Type: Artifact


role?

Type: IRole (optional, default: a new Role will be generated)

The Role in which context's this Action will be executing in.

The Pipeline's Role will assume this Role (the required permissions for that will be granted automatically) right before executing this Action. This Action will be passed into your IAction.bind method in the ActionBindOptions.role property.


runOrder?

Type: number (optional, default: 1)

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

See also: https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html


trigger?

Type: S3Trigger (optional, default: S3Trigger.POLL)

How should CodePipeline detect source changes for this Action.

Note that if this is S3Trigger.EVENTS, you need to make sure to include the source Bucket in a CloudTrail Trail, as otherwise the CloudWatch Events will not be emitted.

See also: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/log-s3-data-events.html


variablesNamespace?

Type: string (optional, default: a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set)

The name of the namespace to use for variables emitted by this action.