The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Interact by Passing Commands to Pipelines Service Container

Deleted user
March 3, 2022

Hi there, 

 

I've spent ages googling and looking at all of the documentation I can find and I need some help so I'm calling in the big guns and posting on the forums :). 

I am using a terraform image for 99% of my pipeline but there is one command I need the aws cliv2 for. I was hoping to use that image as a service container butevery configuration I try ends with the same error 

 

"aws: error: the following arguments are required: command"

 

in all of the documentation I've seen this seems like it should work in theory and I am just making a silly syntax mistake somewhere... any guidance would be much appreciated here 

 

I've pasted the relevant bitbucket-pipelines.yml snippets below. 

image: hashicorp/terraform

pipelines:
default:
- step:
name: New Code Detected
services:
- aws-cli
script:
- echo "New code pushed to ${BITBUCKET_BRANCH}"
- aws-cli aws help
definitions:
services:
aws-cli:
image: amazon/aws-cli



any advice on how I can get this working? 

 

EDIT: I tried the same with the atlassian/pipelines-awscli  image and got the same error.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2022

Hi @[deleted] 

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you.

Unfortunately it seems, that the aws-cli images are not working as services and it's not able to run the aws commands. When I had the following configuration in bitbucket-pipelines.yml file, I was able to run the "aws help" command:

image: amazon/aws-cli

pipelines:

default:

- step:

name: New Code Detected

script:

- echo "New code pushed to ${BITBUCKET_BRANCH}"

- aws help

As a workaround, can I ask you to use the following image? This image contains both terraform and aws-cli, so I believe with this image, you can achieve what you would like to: https://hub.docker.com/r/zenika/terraform-aws-cli

Please let me know how it goes.

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

TAGS
AUG Leaders

Atlassian Community Events