5a3e5f630f
- Initially all tags were mapped to categories in Hub, for e.g. config.yaml: https://github.com/tektoncd/hub/blob/master/config.yaml, so whenever a new tag was added in a task it was mapped to a category called `others`. Hence before every release we had to manually map these new tags to some category, hence after the discussion in Catalog and Hub WG, a proposal was created for adding a category as an annotation. - PR to update the TEP-0003-Tekton Catalog Organization: https://github.com/tektoncd/community/pull/352 Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com> |
||
---|---|---|
.. | ||
samples | ||
aws-cli.yaml | ||
README.md |
aws
This task performs operations on Amazon Web Services resources using aws
.
All aws cli commands can be found here.
Install the Task
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/aws-cli/0.2/aws-cli.yaml
Parameters
- SCRIPT: The script of aws commands to execute e.g.
aws $1 $2
This will take the first value and second value of ARGS ass3
andls
(default:aws $@
) - ARGS: The arguments to pass to
aws
CLI, which are appended toaws
e.g.s3 ls
( default:["help"]
).
Workspaces
- source: To mount file which is to be uploaded to the aws resources, this should be mounted using any volume supported in workspace.
- secrets: A workspace that consists of credentials required by
aws
which will be mounted to $HOME/.aws. This workspace can be omitted when using instance-profile credentials.
Secret
AWS credentials
and config
both should be provided in the form of secret
.
This example can be referred to create aws-credentials
.
Refer this guide for setting up AWS Credentials and Region.
Usage
After creating the task, you should now be able to execute aws
commands by
specifying the command you would like to run as the ARGS
or SCRIPT
param.
The ARGS
param takes an array of aws subcommands that will be executed as
part of this task and the SCRIPT
param takes the multiple commands that you would like to run on aws CLI.
This samples, can be referred to create secret file for aws credentials.
In the samples, ConfigMap as the volume is used. In place of ConfigMap, any volume supported in workspace can be used.
Following command
can be used to create ConfigMap
from the file
.
kubectl create configmap upload-file --from-file=demo.zip
Here upload-file
is the name of the ConfigMap
, this can be changed based on the requirements.
See here for example of aws s3
command.
Note
-
Either
SCRIPT
orARGS
must be provided in theparams
of the task. -
To support multiple
aws
commands to run on a single task, SCRIPT can be used as follows:- name: SCRIPT value: | aws s3 mb s3://test-bucket aws s3api put-object --bucket test-bucket --key test/ aws s3 cp $(workspaces.source.path)/demo.zip s3://test-bucket/test/demo.zip