Source
yaml
id: awscli-list-ecs-clusters
namespace: company.team
tasks:
- id: awscli
type: io.kestra.plugin.aws.cli.AwsCLI
accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
secretKeyId: "{{ secret('AWS_SECRET_ACCESS_KEY') }}"
region: us-east-1
outputFiles:
- output.json
commands:
- aws ecs list-clusters --query 'clusterArns[*]'
- aws ecs list-clusters > output.json
About this blueprint
AWS
This flow demonstrates how you can use the AWS CLI plugin to automate various tasks on AWS.
The task aws
below runs two commands. They both list ECS clusters in the region us-east-1
using the aws ecs list-clusters
command. The output is a JSON array of cluster ARNs.
- The first task uses the
--query
parameter to filter the output to only show the cluster ARNs. 2. The second task stores the output to a file calledoutput.json
, making it available for further processing or download. This flow assumes AWS credentials stored as secretsAWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
.
More Related Blueprints