Vasili Syrakis
Vasili Syrakis

Reputation: 9641

Specifying an S3 bucket when deploying a cloudformation template

I'm trying to deploy a cloudformation template using a command that looks as follows:

aws cloudformation deploy \
        --stack-name stackname \
        --template-file folder/file.yaml \
        --s3-bucket bucketname \
        --s3-prefix prefix

The error that I receive is:

An error occurred (ValidationError) when calling the CreateChangeSet operation:
S3 error: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
For more information check http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html

I have checked the link to try and understand what is being asked of me, but it seems to relate to directly using S3, and not using S3 via CloudFormation.

I can't determine a way to do what it is asking using the available parameters of aws cloudformation

Upvotes: 0

Views: 12660

Answers (2)

Govind Kumar
Govind Kumar

Reputation: 139

aws cloudformation deploy --stack-name myteststack --template-file folder/file.yaml --s3-bucket bucketname --s3-prefix prefix --region us-east-1

You may replace the parameter and try this. You need not to pass the region for s3 bucket nor endpoint is required. Yes, if the Bucket and Cloudformation are in a different region in such cases you may face an issue. But I'm sure it will be access denied issue, not something that you have mentioned here.

Upvotes: 2

John Rotenstein
John Rotenstein

Reputation: 270294

The template file that defines a stack must be in an Amazon S3 bucket that is in the same region as the AWS CloudFormation stack being created.

Upvotes: 3

Related Questions