-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default validator being created #29
Comments
@chippyash thanks for opening the issue. Can you specify where |
@RafPe That is a reference to an externally created request validator created in another stack. As per your documentation. That works fine btw. |
I have a workaround for this at the moment which involves using the custom:
scripts:
hooks:
'after:package:finalize': bash ./scripts/remove-request-validator.sh the script #!/usr/bin/env bash
echo "Removing service default request validator"
cat .serverless/serverless-state.json \
| jq 'del(.service.provider.compiledCloudFormationTemplate.Resources.ApiGatewayMystackRequestValidator)' \
> ./state.json
rm .serverless/serverless-state.json
mv ./state.json .serverless/serverless-state.json
cat .serverless/cloudformation-template-update-stack.json \
| jq 'del(.Resources.ApiGatewayMystackRequestValidator)' \
> ./stack.json
rm .serverless/cloudformation-template-update-stack.json
mv ./stack.json .serverless/cloudformation-template-update-stack.json Not particularly elegant, but it works! If we could get the same functionality into your plugin with perhaps a flag in the custom settings to switch it on/off, that would be marvellous. It would only need to remove the default request validator IF there was nothing referencing it. |
Although I have specified a request validator (using FN::ImportValue), serverless deploy is still creating a default request validator for the stack. Checking the
.serverless/cloudformation-template-update-stack.json
I can see it declared as a resource, but it is never referenced anywhere else in stack spec.Is this predicted behaviour or am I missing something?
serverless V3.0.0
The text was updated successfully, but these errors were encountered: