aws-cdk-lib.aws_codepipeline_actions.S3SourceAction

class S3SourceAction

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

Implements IAction

Extends Action

Source that is provided by a specific Amazon S3 object.

Will trigger the pipeline as soon as the S3 object changes, but only if there is a CloudTrail Trail in the account that captures the S3 event.

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
});

Initializer

new S3SourceAction(props: S3SourceActionProps)

Parameters

  • props S3SourceActionProps

Properties

NameTypeDescription
actionPropertiesActionPropertiesThe simple properties of the Action, like its Owner, name, etc.
variablesS3SourceVariablesThe variables emitted by this action.

actionProperties

Type: ActionProperties

The simple properties of the Action, like its Owner, name, etc.

Note that this accessor will be called before the bind callback.


variables

Type: S3SourceVariables

The variables emitted by this action.

Methods

NameDescription
bind(scope, stage, options)The callback invoked when this Action is added to a Pipeline.
onStateChange(name, target?, options?)Creates an Event that will be triggered whenever the state of this Action changes.
protected bound(_scope, stage, options)This is a renamed version of the IAction.bind method.

bind(scope, stage, options)

public bind(scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfig

Parameters

  • scope Construct
  • stage IStage
  • options ActionBindOptions

Returns

  • ActionConfig

The callback invoked when this Action is added to a Pipeline.


onStateChange(name, target?, options?)

public onStateChange(name: string, target?: IRuleTarget, options?: RuleProps): Rule

Parameters

  • name string
  • target IRuleTarget
  • options RuleProps

Returns

  • Rule

Creates an Event that will be triggered whenever the state of this Action changes.


protected bound(_scope, stage, options)

protected bound(_scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfig

Parameters

  • _scope Construct
  • stage IStage
  • options ActionBindOptions

Returns

  • ActionConfig

This is a renamed version of the IAction.bind method.