interface S3SourceActionProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CodePipeline.Actions.S3SourceActionProps |
Java | software.amazon.awscdk.services.codepipeline.actions.S3SourceActionProps |
Python | aws_cdk.aws_codepipeline_actions.S3SourceActionProps |
TypeScript (source) | @aws-cdk/aws-codepipeline-actions » S3SourceActionProps |
Construction properties of the {@link S3SourceAction S3 source Action}.
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
});
Properties
Name | Type | Description |
---|---|---|
action | string | The physical, human-readable name of the Action. |
bucket | IBucket | The Amazon S3 bucket that stores the source code. |
bucket | string | The key within the S3 bucket that stores the source code. |
output | Artifact | |
role? | IRole | The Role in which context's this Action will be executing in. |
run | number | The runOrder property for this Action. |
trigger? | S3 | How should CodePipeline detect source changes for this Action. |
variables | string | The 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 {@link IAction.bind} method in the {@link 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:
S3
(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.