amplify-education / serverless-domain-manager

Serverless plugin for managing custom domains with API Gateways.
MIT License
936 stars 235 forks source link

Not compatible with serverless-plugin-split-stacks #120

Closed Rapol closed 5 years ago

Rapol commented 6 years ago

Plugin fails during deployment:

Serverless: Packaging service...
Serverless: [serverless-plugin-split-stacks]: Summary: 103 resources migrated in to 5 nested stacks
Serverless: [serverless-plugin-split-stacks]:    Resources per stack:
Serverless: [serverless-plugin-split-stacks]:    - (root): 37
Serverless: [serverless-plugin-split-stacks]:    - APINestedStack: 27
Serverless: [serverless-plugin-split-stacks]:    - AccountsMethodsNestedStack: 8
Serverless: [serverless-plugin-split-stacks]:    - GeneralMethodsNestedStack: 21
Serverless: [serverless-plugin-split-stacks]:    - ModelsNestedStack: 33
Serverless: [serverless-plugin-split-stacks]:    - ThingsMethodsNestedStack: 14
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Validating template...

  Error --------------------------------------------------

  The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block of the template

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

serverless 1.26.1v serverless-domain-manager 2.3.6v

Plugins used:

Plugin is not compatible with serverless-plugin-split-stacks. The serverless-domain-manager is adding resources to the cloudformation after the packaging phase (before:deploy:deploy) which breaks the deployment since the split stack modifies the cloudformation before the packaging (after:aws:package:finalize:mergeCustomProviderResources).

I made a quick test and changed the following hook 'before:deploy:deploy': this.setUpBasePathMapping.bind(this) to 'before:package:finalize': this.setUpBasePathMapping.bind(this) and was able to deploy the stack successfully.

Created a PR with the changes https://github.com/amplify-education/serverless-domain-manager/pull/121

ptraeg commented 6 years ago

I'm seeing the same issue. Had to drop back to 2.3.5 for now.

ozbillwang commented 6 years ago

I got the same issue with serverless-plugin-split-stacks

@ptraeg

Do you mean the version 2.3.5 can fix this issue?

Updated

Yes, with version 2.3.5, I can deploy successfully.

ozbillwang commented 6 years ago

@Rapol

What I am interesting is, how you troubleshooting this type of issue in serverless framework. Enable "SLS_DEBUG=* doesn't give me useful information.

Any details can share with me?

Rapol commented 6 years ago

No updates on the issue? Im still using my PR to deploy a project with both split stack and domain manager.

@ozbillwang If I dont find any useful information with debug on, my next step is to take a look at the .serverless and inspect the cloudformations that is generating. I knew about this error because other plugins have the same problem with the split stack plugin (https://github.com/dougmoscrop/serverless-plugin-split-stacks/issues/9)

simlu commented 6 years ago

Anyone got any debug information on this? Starting point for investigation?

stgogm commented 6 years ago

In our case is:

If we downgrade to serverless-domain-manager@2.3.5 it works.

webhacking commented 5 years ago

In my case below env is works fine on me.