Skip to content

AWS CLI option `source-url-type` causes error when starting Amplify deployment

0

I'm trying to use the AWS CLI command shown at the bottom of this documentation page:

aws amplify start-deployment --app-id <app_id> --branch-name <branch_name> --source-url s3://amzn-s3-demo-website-bucket/prefix source-url-type BUCKET_PREFIX

I tried it and got the below error. I only corrected source-url-type to include the two dashes in front, but even if I don't, I still get the same error.

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help

Unknown options: --source-url-type, BUCKET_PREFIX

The CLI documentation online says this option exists, but reading the docs by running aws amplify start-deployment, I see no mention of this option. I even tried searching inside the git repo and found nothing.

How do I actually start a deployment from a “bucket prefix” using the CLI?

2 Answers
1
Accepted Answer

Hello.

Looking at the AWS CLI change history below, it appears that "source-url-type" is an option added in version 2.18.7.
Make sure the AWS CLI version you are using is 2.18.7 or higher.
https://github.com/aws/aws-cli/blob/v2/CHANGELOG.rst

api-change:amplify: Added sourceUrlType field to StartDeployment request

a

If you are using an older version, please update by following the steps in the document below.
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Ah, interesting. I had checked the changelog, but it was for v1 only. Why is master v1 on the repo? 😅 Anyway, I did indeed have an older version installed! Now it works. ❤️

-1

The issue you're encountering is due to a formatting error in the command you're trying to use. The --source-url-type option is indeed a valid parameter for the aws amplify start-deployment command, but it needs to be specified correctly.

Here's the correct format for the command:

aws amplify start-deployment --app-id <app_id> --branch-name <branch_name> --source-url s3://amzn-s3-demo-website-bucket/prefix --source-url-type BUCKET_PREFIX

The key differences are:

  1. The --source-url-type should be a separate option, not part of the --source-url value.
  2. BUCKET_PREFIX should be the value of the --source-url-type option, not a separate parameter.

Make sure you're using the latest version of the AWS CLI, as older versions might not support this option. You can check your AWS CLI version with aws --version and update if necessary.

If you're still encountering issues after correcting the command format, it's possible that your AWS CLI installation might need to be updated or there could be a discrepancy between the online documentation and your local CLI version. In such cases, you may want to consider updating your AWS CLI to the latest version or reaching out to AWS support for further assistance.

Remember to replace <app_id> and <branch_name> with your actual Amplify app ID and branch name respectively when running the command.
Sources
(Optional) Installing the AWS CLI - AWS Elemental MediaPackage
AWS Amplify | Extensible Web & Mobile Apps | Amazon Web Services

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.