class S3SourceAction
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodePipeline.Actions.S3SourceAction |
![]() | software.amazon.awscdk.services.codepipeline.actions.S3SourceAction |
![]() | aws_cdk.aws_codepipeline_actions.S3SourceAction |
![]() | @aws-cdk/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/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
S3
Source Action Props
Properties
Name | Type | Description |
---|---|---|
action | Action | The simple properties of the Action, like its Owner, name, etc. |
variables | S3 | The variables emitted by this action. |
actionProperties
Type:
Action
The simple properties of the Action, like its Owner, name, etc.
Note that this accessor will be called before the {@link bind} callback.
variables
Type:
S3
The variables emitted by this action.
Methods
Name | Description |
---|---|
bind(scope, stage, options) | The callback invoked when this Action is added to a Pipeline. |
on | 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 {@link IAction.bind} method. |
bind(scope, stage, options)
public bind(scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfig
Parameters
- scope
Construct
- stage
IStage
- options
Action
Bind Options
Returns
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
IRule
Target - options
Rule
Props
Returns
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
Action
Bind Options
Returns
This is a renamed version of the {@link IAction.bind} method.