Ashish Sharma
Ashish Sharma

Reputation: 672

How to run aws code-build through cli with S3 artifact detail?

I am trying to trigger aws code-build using cli using below cmd but I am getting error.

Does anyone else know about the fix for this issue?

aws codebuild start-build  --project-name my-db-deploy --artifacts-override="{\"type\": \"S3\", \"location\": \"arn:aws:s3:::codepipeline-us-east-1-4444442770/my-db-dev-deploy/BuildArtif/ZepddNIiV\",\"encryptionDisabled\": false}" --environment-variables-override name='environment',value='prod'--environment-variables-override name='delete_on_termination_db_ebs_volume',value='true'

Error:

An error occurred (InvalidInputException) when calling the StartBuild operation: Invalid artifacts: location should not have a forward-slash

Upvotes: 0

Views: 855

Answers (1)

maafk
maafk

Reputation: 6876

Try updating your --artifacts-override to separate the location and the path

--artifacts-override="{\"type\": \"S3\", \"location\": \"arn:aws:s3:::codepipeline-us-east-1-4444442770\", \"path\": \"my-db-dev-deploy/BuildArtif/ZepddNIiV\", \"encryptionDisabled\": false}"

Based on docs:

--location

If type is set to S3 , this is the name of the output bucket.

--path

If type is set to S3 , this is the path to the output artifact. If path is not specified, path is not used.

Upvotes: 1

Related Questions