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:
- 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
- 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