Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

AWS SAM Deploy Missing option '--image-repository' or '--image-repositories'

Han I'm New Here Jun 22, 2021

Hi all,

I am trying to deploy to Lambda using `aws-sam-deploy` pipe and got an "Missing option '--image-repository' or '--image-repositories'" error when packaging. However, I have included "image_repositories" inside my `samconfig.toml` file and set SAM_CONFIG to `samconfig.toml` file.

I can build and deploy to AWS Lambda using Docker images from local without any problems with the command `sam build` and then `sam deploy`. So I do not think there's anything wrong with my `template.yaml` or `samconfig.toml`

What steps am I missing? Any help would be greatly appreciated.

Thank you!!

HCL

 

bitbucket-pipeline error message:

INFO: Using default authentication with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

INFO: Start package...

SAM CLI now collects telemetry to better understand customer needs.

You can OPT OUT and disable telemetry collection by setting the environment variable SAM_CLI_TELEMETRY=0 in your shell. Thanks for your help! Learn More: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-telemetry.html

Usage: sam package [OPTIONS]

Try 'sam package -h' for help.

Error: Missing option '--image-repository' or '--image-repositories'

✖ Failed SAM package.

 

Relevant part of my pipeline (monorepo, so I have to cd into the specific directory where `samconfg.toml` and `template.yaml` resides:

          script:
            - apt-get update
            - cd project/function
-
 pipeatlassian/aws-sam-deploy:1.2.0
              variables:
                AWS_ACCESS_KEY_ID$AWS_ACCESS_KEY_ID
                AWS_SECRET_ACCESS_KEY$AWS_SECRET_ACCESS_KEY
                AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
                S3_BUCKET'lambda-function-bucket'
                STACK_NAME'MyLambdaFunction'
                CAPABILITIES: ['CAPABILITY_IAM']
                SAM_TEMPLATE'template.yaml'
                SAM_CONFIG"samconfig.toml"
                WAIT'true'
                WAIT_INTERVAL60

And here's my samconfig.toml:

```

version = 0.1
[default]
[default.deploy]
[default.deploy.parameters]
stack_name = "MyLambdaFunction"
s3_bucket = "lambda-function-bucket"
s3_prefix = "s3-prefix/"
region = "us-east-1"
capabilities = "CAPABILITY_IAM"
image_repositories = ["MyLambdaFunction=12345678910.dkr.ecr.us-east-1.amazonaws.com/my-lambda-function"]
confirm_changeset = false

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

3,793 views 64 20
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you