This workflow demonstrates the use of the AWS STS assume role step. It assumes an IAM role, then outputs the instances, images, key pairs, and volumes in that account.
Before you run this workflow, you will need the following:
- An AWS account.
- An AWS IAM user with permissions to assume the privileged IAM role.
- An AWS IAM role with the user as a trusted entity and permissions to list EC2 instances.
- One or more running EC2 instances.
Follow these steps to run the workflow:
-
Add your AWS IAM user credentials as a Connection:
- Click Setup
- Find the Connection named
my-aws-account
and click Edit(✎). Use the following values:- KEY:
ACCESS KEY ID
- VALUE: Enter your AWS access key id associated with the account
- KEY:
SECRET ACCESS KEY
- VALUE: Enter your AWS secret access key associated with the account
- KEY:
- Click Save
-
Click Run workflow and wait for the workflow run page to appear.
-
Supply following parameters to the modal:
- KEY:
region
- VALUE: The AWS region to run in
- KEY:
roleARN
- VALUE: The ARN of the IAM role to assume (e.g. arn:aws:iam::180094860577:role/EC2)
- KEY:
Follow these steps to run this workflow on a schedule:
- Un-comment out the Trigger block in the workflow file:
TIP: If you're using the Relay code editor, highlight the
triggers
section and type⌘ + /
(Mac) orCtrl + /
(Windows) to uncomment.
# triggers:
# - name: schedule
# source:
# type: schedule
# schedule: '0 * * * *'
# binding:
# parameters:
# region: us-east-1
# roleARN: ""
- Configure the
schedule
trigger:- Supply the run interval in cron format.
- Configure the following parameter bindings:
- Specify the
region
to run in. - Specify the
roleARN
to assume
- Specify the
- Click Save changes