Adding the "Deploy to Amazon ECS" action
For a working example of the Deploy to Amazon ECS action, create a project
with either the Node.js API with AWS Fargate or
Java API with AWS Fargate blueprint. For more information, see Creating a project with a
blueprint.
This section describes how to add the Deploy to Amazon ECS action to your
workflow. This action registers a task
definition file that you provide. Upon registration, the task definition is then
instantiated by your Amazon ECS service running in your
Amazon ECS cluster.
"Instantiating a task definition" is equivalent to deploying an application into Amazon ECS.
To use this action, you must have an existing Amazon ECS cluster, service, and task definition
file ready.
For more information about Amazon ECS, see the Amazon Elastic Container Service Developer Guide.
- Visual
-
To add the "Deploy to Amazon ECS" action using the visual editor
Open the CodeCatalyst console at https://codecatalyst.aws/.
-
Choose your project.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of your workflow. You can filter by the source repository or
branch name where the workflow is defined, or filter by workflow name.
-
Choose Edit.
-
Choose Visual.
-
At the top-left, choose + Actions to open the action
catalog.
-
From the drop-down list, choose Amazon CodeCatalyst.
-
Search for the Deploy to Amazon ECS action, and do one of the
following:
-
In the Inputs and Configuration tabs,
complete the fields according to your needs. For a description of each field, see the
"Deploy to Amazon ECS" action reference. This
reference provides detailed information about each field (and corresponding YAML
property value) as it appears in both the YAML and visual editors.
-
(Optional) Choose Validate to validate the workflow's YAML
code before committing.
-
Choose Commit, enter a commit message, and choose
Commit again.
- YAML
-
To add the "Deploy to Amazon ECS" action using the YAML editor
Open the CodeCatalyst console at https://codecatalyst.aws/.
-
Choose your project.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of your workflow. You can filter by the source repository or
branch name where the workflow is defined, or filter by workflow name.
-
Choose Edit.
-
Choose YAML.
-
At the top-left, choose + Actions to open the action
catalog.
-
From the drop-down list, choose Amazon CodeCatalyst.
-
Search for the Deploy to Amazon ECS action, and do one of the
following:
-
Modify the properties in the YAML code according to your needs. An explanation of
each available property is provided in the "Deploy to Amazon ECS" action reference.
-
(Optional) Choose Validate to validate the workflow's YAML
code before committing.
-
Choose Commit, enter a commit message, and choose
Commit again.
Variables produced by the "Deploy to Amazon ECS"
action
When the Deploy to Amazon ECS action runs, it produces variables which you
can use in subsequent workflow actions. For details, see "Deploy to Amazon ECS" action
variables in the List of predefined variables.
"Deploy to Amazon ECS" action definition
The Deploy to Amazon ECS action is defined as a set of YAML properties
inside your workflow definition file. For information about these properties, see "Deploy to Amazon ECS" action reference in the Workflow definition reference.