Add API Gateway endpoint security#167
Merged
GrahamCampbell merged 2 commits intomainfrom Apr 26, 2026
Merged
Conversation
Co-authored-by: Arthur Frade de Araujo <arthur4raujo@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds support for configuring API Gateway v1 (REST API) endpoint security settings via provider.apiGateway.endpoint, aligning config shape with upstream while preserving AWS’s “unset via empty string” behavior for access mode.
Changes:
- Add
provider.apiGateway.endpoint.securityPolicyandprovider.apiGateway.endpoint.accessModeconfiguration schema and TypeScript typings. - Compile REST API CloudFormation with
SecurityPolicyandEndpointAccessModewhen configured (including preservingaccessMode: ''). - Add unit + integration test coverage and update documentation for the new configuration.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| types/index.d.ts | Adds typings for provider.apiGateway.endpoint.{securityPolicy,accessMode}. |
| lib/plugins/aws/provider.js | Extends config schema to validate apiGateway.endpoint and restrict allowed accessMode values. |
| lib/plugins/aws/package/compile/events/api-gateway/lib/rest-api.js | Maps endpoint.securityPolicy / endpoint.accessMode into AWS::ApiGateway::RestApi properties. |
| test/unit/lib/plugins/aws/package/compile/events/api-gateway/lib/rest-api.test.js | Adds unit + integration tests for security policy/access mode mapping and schema validation failures. |
| docs/guides/serverless.yml.md | Documents provider.apiGateway.endpoint settings in the main serverless.yml guide. |
| docs/events/apigateway.md | Documents REST API SecurityPolicy/EndpointAccessMode behavior and limitations (http vs httpApi, restApiId import). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
provider.apiGateway.endpointconfig while preserving AWS's empty access mode unset behavior.