Skip to content
v2.275.0

S3SourceActionProps Struct ​

Construction properties of the S3SourceAction S3 source Action.

Example ​

ts
const key = 'some/key.zip';
declare const sourceBucket: s3.Bucket;
const sourceOutput = new codepipeline.Artifact();
const sourceAction = new codepipeline_actions.S3SourceAction({
  actionName: 'S3Source',
  bucketKey: key,
  bucket: sourceBucket,
  output: sourceOutput,
  variablesNamespace: 'MyNamespace', // optional - by default, a name will be generated for you
});

// later:
declare const project: codebuild.PipelineProject;
new codepipeline_actions.CodeBuildAction({
  actionName: 'CodeBuild',
  project,
  input: sourceOutput,
  environmentVariables: {
    VERSION_ID: {
      value: sourceAction.variables.versionId,
    },
  },
});

Properties ​

actionNamestringaction_namestractionNameStringActionNamestringActionName*stringrequired#
The physical, human-readable name of the Action.

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

bucketIBucketbucketIBucketbucketIBucketBucketIBucketBucketIBucketrequired#
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.

bucketKeystringbucket_keystrbucketKeyStringBucketKeystringBucketKey*stringrequired#
The key within the S3 bucket that stores the source code.
example
ts
'path/to/file.zip'
outputArtifactoutputArtifactoutputArtifactOutputArtifactOutputArtifactrequired#
roleoptionalIRoleroleoptionalIRoleroleoptionalIRoleRoleoptionalIRoleRoleoptionalIRole#
The Role in which context's this Action will be executing in.

Default: a new Role will be generated

notes

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.

runOrderoptionalnumberrun_orderoptionalint | floatrunOrderoptionalNumberRunOrderoptionaldoubleRunOrderoptional*float64= 1#
The runOrder property for this Action.

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

triggeroptionalS3TriggertriggeroptionalS3TriggertriggeroptionalS3TriggerTriggeroptionalS3TriggerTriggeroptionalS3Trigger= 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.

variablesNamespaceoptionalstringvariables_namespaceoptionalstrvariablesNamespaceoptionalStringVariablesNamespaceoptionalstringVariablesNamespaceoptional*string#
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