"Amazon S3 publish" action reference - Amazon CodeCatalyst

"Amazon S3 publish" action reference

The following is the action definition YAML reference for the Amazon S3 publish action. To learn how to use this action, see Adding the "Amazon S3 publish" action.

Note

Most of the YAML properties that follow have corresponding UI elements in the visual editor. To look up a UI element, use Ctrl+F. The element will be listed with its associated YAML property.

# The workflow definition starts here. # See Top-level properties for details. Name: MyWorkflow SchemaVersion: 1.0 Actions: # The action definition starts here. S3Publish_nn: Identifier: aws/s3-publish@v1 DependsOn: - build-action Compute: Type: EC2 | Lambda Fleet: fleet-name Timeout: timeout-minutes Inputs: Sources: - source-name-1 Artifacts: - artifact-name Variables: - Name: variable-name-1 Value: variable-value-1 - Name: variable-name-2 Value: variable-value-2 Environment: Name: environment-name Connections: - Name: account-connection-name Role: iam-role-name Configuration: SourcePath: my/source DestinationBucketName: s3-bucket-name TargetPath: my/target

S3Publish

(Required)

Specify the name of the action. All action names must be unique within the workflow. Action names are limited to alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (_). Spaces are not allowed. You cannot use quotation marks to enable special characters and spaces in action names.

Default: S3Publish_nn.

Corresponding UI: Configuration tab/Action name

Identifier

(S3Publish/Identifier)

(Required)

Identifies the action. Do not change this property unless you want to change the version. For more information, see Working with action versions.

Default: aws/s3-publish@v1.

Corresponding UI: Workflow diagram/S3Publish_nn/aws/s3-publish@v1 label

DependsOn

(S3Publish/DependsOn)

(Optional)

Specify an action or action group that must run successfully in order for this action to run.

For more information about the 'depends on' functionality, see Configuring actions to depend on other actions.

Corresponding UI: Inputs tab/Depends on - optional

Compute

(S3Publish/Compute)

(Optional)

The computing engine used to run your workflow actions. You can specify compute either at the workflow level or at the action level, but not both. When specified at the workflow level, the compute configuration applies to all actions defined in the workflow. At the workflow level, you can also run multiple actions on the same instance. For more information, see Sharing compute across actions.

Corresponding UI: none

Type

(S3Publish/Compute/Type)

(Required if Compute is included)

The type of compute engine. You can use one of the following values:

  • EC2 (visual editor) or EC2 (YAML editor)

    Optimized for flexibility during action runs.

  • Lambda (visual editor) or Lambda (YAML editor)

    Optimized action start-up speeds.

For more information about compute types, see About compute types.

Corresponding UI: Configuration tab/Compute type

Fleet

(S3Publish/Compute/Fleet)

(Optional)

Specify the machine or fleet that will run your workflow or workflow actions. With on-demand fleets, when an action starts, the workflow provisions the resources it needs, and the machines are destroyed when the action finishes. Examples of on-demand fleets: Linux.x86-64.Large, Linux.x86-64.XLarge. For more information about on-demand fleets, see On-demand fleet properties.

With provisioned fleets, you configure a set of dedicated machines to run your workflow actions. These machines remain idle, ready to process actions immediately. For more information about provisioned fleets, see Provisioned fleet properties.

If Fleet is omitted, the default is Linux.x86-64.Large.

Corresponding UI: Configuration tab/Compute fleet

Timeout

(S3Publish/Timeout)

(Required)

Specify the amount of time in minutes (YAML editor), or hours and minutes (visual editor), that the action can run before CodeCatalyst ends the action. The minimum is 5 minutes and the maximum is described in Quotas for workflows in CodeCatalyst. The default timeout is the same as the maximum timeout.

Corresponding UI: Configuration tab/Timeout - optional

Inputs

(S3Publish/Inputs)

(Optional)

The Inputs section defines the data that the S3Publish needs during a workflow run.

Note

A maximum of four inputs (one source and three artifacts) are allowed for each AWS CDK deploy action. Variables do not count towards this total.

If you need to refer to files residing in different inputs (say a source and an artifact), the source input is the primary input, and the artifact is the secondary input. References to files in secondary inputs take a special prefix to distiguish them from the primary. For details, see Example: Referencing files in multiple artifacts.

Corresponding UI: Inputs tab

Sources

(S3Publish/Inputs/Sources)

(Required if the files you want to publish to Amazon S3 are stored in a source repository)

If the files that you want to publish to Amazon S3 are stored in a source repository, specify the label of that source repository. Currently, the only supported label is WorkflowSource.

If the files that you want to publish to Amazon S3 are not contained within a source repository, they must reside in an artifact generated by another action.

For more information about sources, see Working with sources.

Corresponding UI: Inputs tab/Sources - optional

Artifacts - input

(S3Publish/Inputs/Artifacts)

(Required if the files you want to publish to Amazon S3 are stored in an output artifact from a previous action)

If the files that you want to publish to Amazon S3 are contained in an artifact generated by a previous action, specify that artifact here. If your files are not contained within an artifact, they must reside in your source repository.

For more information about artifacts, including examples, see Working with artifacts.

Corresponding UI: Configuration tab/Artifacts - optional

Variables - input

(S3Publish/Inputs/Variables)

(Optional)

Specify a sequence of name/value pairs that define the input variables that you want to make available to the action. Variable names are limited to alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (_). Spaces are not allowed. You cannot use quotation marks to enable special characters and spaces in variable names.

For more information about variables, including examples, see Working with variables.

Corresponding UI: Inputs tab/Variables - optional

Environment

(S3Publish/Environment)

(Required)

Specify the CodeCatalyst environment to use with the action.

For more information about environments, see Working with environments and Creating an environment.

Corresponding UI: Configuration tab/'Environment/connection/role'/Environment

Name

(S3Publish/Environment/Name)

(Required if Environment is included)

Specify the name of an existing environment that you want to associate with the action.

Corresponding UI: Configuration tab/'Environment/connection/role'/Environment

Connections

(S3Publish/Environment/Connections)

(Required if Environment is included)

Specify the account connection to associate with the action. You can specify a maximum of one account connection under Environment.

For more information about account connections, see Administering AWS accounts for a space. For information about how to associate an account connection with your environment, see Creating an environment.

Corresponding UI: Configuration tab/'Environment/connection/role'/Connection

Name

(S3Publish/Environment/Connections/Name)

(Required)

Specify the name of the account connection.

Corresponding UI: Configuration tab/'Environment/connection/role'/Connection

Role

(S3Publish/Environment/Connections/Role)

(Required)

Specify the name of the IAM role that the Amazon S3 publish action uses to access AWS and to copy files to Amazon S3. Make sure that this role includes:

  • The following permissions policy:

    Warning

    Limit the permissions to those shown in the following policy. Using a role with broader permissions might pose a security risk.

    { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:ListBucket", "s3:DeleteObject" ], "Resource": [ "arn:aws:s3:::bucket-name", "arn:aws:s3:::bucket-name/*" ] } ] }
  • The following custom trust policy:

    { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": [ "codecatalyst-runner.amazonaws.com", "codecatalyst.amazonaws.com" ] }, "Action": "sts:AssumeRole" } ] }

Make sure that this role is associated with your account connection. To learn more about associating an IAM role with an account connection, see Adding IAM roles to account connections.

Note

You can specify the name of the CodeCatalystWorkflowDevelopmentRole-spaceName role here, if you'd like. For more information about this role, see Creating the CodeCatalystWorkflowDevelopmentRole-spaceName role for your account and space. Understand that the CodeCatalystWorkflowDevelopmentRole-spaceName role has very broad permissions which may pose a security risk. We recommend that you only use this role in tutorials and scenarios where security is less of a concern.

Corresponding UI: Configuration tab/'Environment/connection/role'/Role

Configuration

(S3Publish/Configuration)

(Required)

A section where you can define the configuration properties of the action.

Corresponding UI: Configuration tab

SourcePath

(S3Publish/Configuration/SourcePath)

(Required)

Specify the name and path of a directory or file that you want to publish to Amazon S3. The directory or file can reside in a source repository or an artifact from a previous action, and is relative to the source repository or artifact root.

Examples:

Specifying ./myFolder/ copies the contents of /myFolder to Amazon S3, and preserves the underlying directory structure.

Specifying ./myFolder/myfile.txt copies just myfile.txt to Amazon S3. (The directory structure is removed.)

You cannot use wildcards.

Note

You may need to add a prefix to the directory or file path to indicate which artifact or source to find it in. For more information, see Referencing files in a source repository and Referencing files in an artifact.

Corresponding UI: Configuration tab/Source path

DestinationBucketName

(S3Publish/Configuration/DestinationBucketName)

(Required)

Specify the name of the Amazon S3 bucket where you want to publish files.

Corresponding UI: Configuration tab/Destination bucket - optional

TargetPath

(S3Publish/Configuration/TargetPath)

(Optional)

Specify the name and path of the directory in Amazon S3 where you want to publish your files. If the directory does not exist, it will be created. The directory path must not include the bucket name.

Examples:

myS3Folder

./myS3Folder/myS3Subfolder

Corresponding UI: Configuration tab/Destination directory - optional