Cloud formation Stacks creating and deploying fail S3 access error.


With the help of template I am trying create and deploy the NodeJs API. I packaged the code with cloud formation package command into S3 bucket dev-srv and trying to deploy with cloud formation deploy command but the stacks are failing with error message failed to create nested Stack and s3 bucket not accessible.

The template file I am creating is working fine with my previous stacks. Old stacks are updating but not able to create new one.

Following are the cloud formation event message:

  1. 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
  2. The following resource(s) failed to create: [UserStack, AdminStack]. Rollback requested by user.

When I am clicking the template URL (from s3 bucket) used in yaml file it's downloading. Means file is accessible and present still facing this issue.

Following is the command I am using to package and deploy.

aws cloudformation deploy --template-file out.yaml --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND --stack-name lambda --s3-bucket dev-srv --profile dev

aws cloudformation package --template-file tpmain.yaml --output-template-file out.yaml --s3-bucket dev-srv --profile dev

Kindly do the needful as soon as possible.

Solved with cross deployment like s3 bucket from another region(let's say A) used to deploy nested stacks in region B.

UPDATE: I am able to create the stacks and API gateway. Deployment successful but not able to access the REST API from front end /postman. In route 53 custom domain registered with CNAME and mentioned API Gateway domain name. Error in console: net::ERR_NAME_NOT_RESOLVED

1 Answer
Accepted Answer


What CloudFormation template are you using?
Also, will it work by deploying CloudFormation in the same region as S3?
I think the GitHub issue below is related to your problem.

I think you can avoid the error by creating an S3 bucket in the same region or deploying CloudFormation in the same region as the S3 bucket.

profile picture
answered 5 months ago
profile picture
reviewed 9 days ago
profile picture
reviewed 2 months 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.

Guidelines for Answering Questions