I want to delete S3 files from the bucket by creating a bamboo plan/script which when run will delete the file.
I tried creating a plan and then creating a task. But in the task i can see no option for Amazon S3 Object in the list. I have refered to the below url and followed the steps:https://utoolity.atlassian.net/wiki/spaces/TAWS/pages/19464196/Using+the+Amazon+S3+Object+task+in+Bamboo
Is there any other way i can create a bamboo plan and delete files from S3???
Hi @BeingDarsh,
Welcome to the Atlassian Community!
If I understand you correctly, you are unable to see the Amazon S3 Object task in the dialog when you try to Create a task for a job in Bamboo?
This task is part of the (commercial) Tasks for AWS (Bamboo) app, which you can install from the Atlassian Marketplace. As with all apps, you can always evaluate it first by clicking the yellow Try it free button in the top right of the Marketplace listing.
Alternative
If you would rather not use a dedicated task for S3, you could also use the AWS CLI's high level S3 commands via the built-in Bamboo Script task, for example aws.s3.rm covers your use case.
Please note that this usually requires an AWS Access Key, which violates the AWS security best practice to not store and expose long-term credentials in insecure environments. You could address this by using our Identity Federation for AWS (Bamboo) app to provide temporary AWS credentials at runtime, as outlined in How to provide temporary AWS credentials to the AWS Command Line Interface (AWS CLI) via Bamboo variables.
Cheers,
Steffen
Hi Steffen,
Thank you so much for your help :-)
I managed to run the plan successfully.
There were some minor mistakes which i had made after correcting it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There seem to be two different issues eventually:
1. Missing AWS CLI
But when i run the plan i get error as below:
(line 2: $: command not found).
The missing command here is 'aws', which is the AWS Command Line Interface (AWS CLI) and may need to be installed on your agent first.
I think all Bamboo stock images for Elastic Bamboo have it installed by default meanwhile, but if you are using a custom image, or a remote or local agent, you may need to install it yourself - please refer to Installing the AWS CLI for instructions.
2. Missing job requirements
The "No agents meet this job's requirements" error usually needs to be taken literally. What do you mean exact when you say that you have "added a local agent under requirement tab", and can you show me the "Required capability" list from the requirements tab so that we can analyze which requirement is not met?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steffen,
Thanks for your revert.
I have tried the steps which you had provided.
I have created a plan, then i created a task wherein i have added task by selecting type as Script. And then followed the steps given in https://confluence.atlassian.com/bamboo/script-289277046.html?_ga=2.206651157.703612990.1564645603-979275457.1562814553
In the script i have written command as attached in screenshot "Bamboo_Task.PNG".
But when i run the plan i get error as below:
(line 2: $: command not found).
Also i have set the variables under the variables tab and also i have added a local agent under requirement tab but it gives an error when clicked on the Defalut Job as "No agents meet this job's requirements."
Can you please check and correct me where i am wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.