Add apiTlsPolicy trait and OpenAPI mapper#3083
Open
mee-aa wants to merge 8 commits intosmithy-lang:mainfrom
Open
Add apiTlsPolicy trait and OpenAPI mapper#3083mee-aa wants to merge 8 commits intosmithy-lang:mainfrom
mee-aa wants to merge 8 commits intosmithy-lang:mainfrom
Conversation
API Gateway REST APIs have a TLS security policy and an optional endpoint access mode that control the TLS version, cipher suite, and how the API endpoint can be accessed. These were previously only configurable via OpenAPI extensions. Add the `aws.apigateway#apiTlsPolicy` structure trait with a required `securityPolicy` field and an optional `endpointAccessMode` field. The OpenAPI mapper writes `securityPolicy` to `x-amazon-apigateway-security-policy` and `endpointAccessMode` to `x-amazon-apigateway-endpoint-access-mode` as separate top-level extensions, matching how API Gateway reads them at import time.
efad7a9 to
e55d19e
Compare
kstich
requested changes
May 4, 2026
kstich
reviewed
May 4, 2026
kstich
reviewed
May 4, 2026
kstich
previously approved these changes
May 7, 2026
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.
API Gateway REST APIs have a TLS security policy and an optional endpoint access mode that control the TLS version, cipher suite, and how the API endpoint can be accessed. These were previously only configurable via OpenAPI extensions.
Background
apiTlsPolicystructure trait tosmithy-aws-apigateway-traitswith a requiredsecurityPolicystring field and an optionalendpointAccessModeenum field (BASICorSTRICT).smithy-aws-apigateway-openapithat writessecurityPolicyto thex-amazon-apigateway-security-policyextension andendpointAccessModeto thex-amazon-apigateway-endpoint-access-modeextension as separate top-level entries, matching how API Gateway reads them at import time.amazon-apigateway.rstand the OpenAPI conversion guide inconverting-to-openapi.rst.jsonAddworkarounds insmithy-build.jsonto configure TLS policies and endpoint access modes.securityPolicyusesString(not an enum) because TLS policy values are actively expanding (e.g.,SecurityPolicy_TLS13_*variants).endpointAccessModeuses an enum since onlyBASICandSTRICTare supported and unlikely to change.Testing
TLS_1_0,TLS_1_2), enhanced policies (SecurityPolicy_TLS13_1_3_2025_09,SecurityPolicy_TLS13_1_2_2021_06), and both access modes (BASIC,STRICT)Links
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.