dougmoscrop / serverless-plugin-split-stacks

A plugin to generate nested stacks to get around CloudFormation resource/parameter/output limits
297 stars 68 forks source link

AWS China - s3 bucket does not exist #93

Open kevinblackbrazil opened 4 years ago

kevinblackbrazil commented 4 years ago

When I enable the serverless-plugin-split-stacks plugin in china region (with an identical config I run in non-China regions), I get an error that the s3 bucket does not exist. Commenting out the serverless-plugin-split-stacks plugin and getting <200 limit deploys just fine.

The cloudformation logs show:

The following resource(s) failed to create: [APINestedStack, PoliciesNestedStack].

With both showing a created failed with the reason being "S3 error: The specified bucket does not exist For more information check http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html"

I assume this is due to the different ARN used in china per their docs: https://docs.amazonaws.cn/en_us/general/latest/gr/aws-arns-and-namespaces.html The following example shows ARNs for an Amazon S3 bucket in which the resource name includes a path: arn:aws-cn:s3:::my_corporate_bucket/*

I'm just not sure where I'd have to change/override it so that it used "aws-cn", or if I'm completely off and something else might be happening here.

kevinblackbrazil commented 4 years ago

@dougmoscrop - If you have any pointers or initial thoughts on where it might make sense for me to look to get this one figured out, it'd be very much appreciated!

dougmoscrop commented 4 years ago

Sorry super busy moving cities

That error suggests to me it's the resource in the root stack that is problematic, there is code that sets the "deploymentBucketEndpoint" I would check.

kevinblackbrazil commented 4 years ago

Oh, yeah, moving is always a hectic time. Hopefully it's going smoothly. Thanks for the pointer, I'll look towards the deploymentBucketEndpoint to see what might need to be tweaked here.