S3SourceActionProps

class aws_cdk.aws_codepipeline_actions.S3SourceActionProps(*, action_name, run_order=None, variables_namespace=None, role=None, bucket, bucket_key, output, trigger=None)

Bases: CommonAwsActionProps

Construction properties of the S3SourceAction S3 source Action.

Parameters:
  • action_name (str) – The physical, human-readable name of the Action. Note that Action names must be unique within a single Stage.

  • run_order (Union[int, float, None]) – The runOrder property for this Action. RunOrder determines the relative order in which multiple Actions in the same Stage execute. Default: 1

  • variables_namespace (Optional[str]) – The name of the namespace to use for variables emitted by this action. 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

  • role (Optional[IRole]) – 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. Default: a new Role will be generated

  • bucket (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.

  • bucket_key (str) – The key within the S3 bucket that stores the source code.

  • output (Artifact) –

  • trigger (Optional[S3Trigger]) – 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. Default: S3Trigger.POLL

ExampleMetadata:

infused

Example:

import aws_cdk.aws_cloudtrail as cloudtrail

# source_bucket: s3.Bucket

source_output = codepipeline.Artifact()
key = "some/key.zip"
trail = cloudtrail.Trail(self, "CloudTrail")
trail.add_s3_event_selector([cloudtrail.S3EventSelector(
    bucket=source_bucket,
    object_prefix=key
)],
    read_write_type=cloudtrail.ReadWriteType.WRITE_ONLY
)
source_action = codepipeline_actions.S3SourceAction(
    action_name="S3Source",
    bucket_key=key,
    bucket=source_bucket,
    output=source_output,
    trigger=codepipeline_actions.S3Trigger.EVENTS
)

Attributes

action_name

The physical, human-readable name of the Action.

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

bucket

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.

bucket_key

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

Example:

"path/to/file.zip"
output
role

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.

Default:

a new Role will be generated

run_order

The runOrder property for this Action.

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

Default:

1

See:

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

trigger

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.

Default:

S3Trigger.POLL

See:

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

variables_namespace

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

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