Associating an environment,
account connection, and IAM role with a workflow action
When you associate an environment, account connection, and IAM role with a supported workflow action, the IAM
role becomes available for use by the action. If the action is a deploy
action, in addition to gaining access to an IAM role, the action also has its deployment
information imported into the environment's dashboard page.
Use the following instructions to associate an environment, account connection, and IAM
role with an action.
Prerequisites
Before you begin, you need the following:
Step 1: Associate the
environment, account connection, and role to a workflow action
Use the following procedure to associate an environment, account connection, and role
with a workflow action.
- Visual
-
To associate an
environment, account connection, and role with a workflow 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.
-
In the workflow diagram, choose an action that is supported with environments.
For more information, see Supported actions.
-
Choose the Configuration tab, and specify information
into the fields, as follows.
Environment
Specify the CodeCatalyst environment to use with the action.
For more information about
environments, see Working with environments and Creating an environment.
Account connection or Connection -
optional (whichever is available)
Specify the account connection to associate with
the action.
For more information about account connections, see Managing AWS accounts. For information about how to associate an account connection with your environment, see
Creating an environment.
Role
Specify the name of the IAM role that this action uses in order to access and operate in
AWS services such as Amazon S3 and Amazon ECR. Make sure this role is added to your account
connection. To add an IAM role to an account connection, see Adding IAM roles to account
connections.
You can specify the name of the codecatalyst-dev-admin-spaceName
role here, if you'd like. For
more information about this role, see Creating the codecatalyst-dev-admin-spaceName role for your account
and space. Understand that the
codecatalyst-dev-admin-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.
If you don't see the role in the list, it's because you have not associated it
to the account connection. For more information, see Adding IAM roles to account
connections.
-
(Optional) Choose Validate to validate the workflow's
YAML code before committing.
-
Choose Commit, enter a commit message, and choose
Commit again.
- YAML
-
To associate an environment, account connection, and role with a workflow
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.
-
In the workflow action that you want to associate with an environment, add
code similar to the following:
action-name
Environment:
Name: environment-name
Connections:
- Name: account-connection-name
Role: iam-role-name
For more information, see the Workflow definition reference for your action.
-
(Optional) Choose Validate to validate the workflow's
YAML code before committing.
-
Choose Commit, enter a commit message, and choose
Commit again.
Step 2:
Populate the environment
After associating an environment, account connection, and role to workflow action, you
can populate the environment's dashboard page with deployment information. Use the following
instructions to populate the environment dashboard page.
The environment dashboard page is supported by only a subset of workflow actions. For
more information, see Supported actions.
To populate the environment
-
If a workflow run did not start automatically when you committed your changes in
Step 1: Associate the
environment, account connection, and role to a workflow action, manually start a
run as follows:
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of the workflow where you want to start a run. You can filter by
the source repository or branch name where the workflow is defined, or filter by
workflow name.
-
Choose Run.
The workflow run starts a new deployment, which causes CodeCatalyst to add your
application resource information under Environments.
-
Verify that your application resources appear under your environment:
-
In the navigation pane, choose CI/CD, and then choose
Environments.
-
Choose your environment (for example, Production
).
-
Choose the Deployment activity tab, and verify that a
deployment appears with a Status of
SUCCEEDED. This indicates that a workflow run successfully
deployed your application resources.
-
Choose the Deployment targets tab, and verify that your
application resources appear.