Rafiq
Rafiq

Reputation: 1642

Is there a way to point cloudformation template in S3 Bucket while deploying using aws cloudformatiohn deploy

I know that I can use aws cloudformation create-stack or aws cloudformation update-stack with --template-url switch to point to an existing template placed in S3 Bucket.

I would like to use aws cloudformation deploy, the same command for both creating and updating a CloudFormation stack for which I placed the template already in my S3 Bucket. Is it possible with any combination of the options?

The following syntax works, but it first uploads the template to the S3 Bucket:

aws cloudformation deploy \
    --stack-name my-stack \
    --template-file my-stack-template.yaml \
    --s3-bucket my-bucket \
    --s3-prefix templates \
    --profile my-profile \
    --region us-east-1

It first uploads the template my-stack-template.yaml as something like 1a381d4c65d9a3233450e92588a708b38.template in my-bucket/templates which I do not want. I would like to be able to deploy the stack through this method using the template already placed in the S3 Bucket and not needing it to be on my local computer.

Upvotes: 1

Views: 2186

Answers (1)

Marcin
Marcin

Reputation: 238179

Sadly there is no such way. The only way for the template to be not re-upload is when there are no changes to deploy. You have to use create-stack if you want to use pre-existing templates in S3.

Upvotes: 2

Related Questions