1212 ResourceAttributes ,
1313 SamIntrinsicable ,
1414 get_prop ,
15+ passthrough_prop ,
1516)
1617
18+ PROPERTIES_STEM = "sam-resource-api"
19+ DOMAIN_STEM = "sam-property-api-domainconfiguration"
20+ ROUTE53_STEM = "sam-property-api-route53configuration"
21+ ENDPOINT_CONFIGURATION_STEM = "sam-property-api-endpointconfiguration"
22+ DEFINITION_URI_STEM = "sam-property-api-apidefinition"
23+
1724resourcepolicy = get_prop ("sam-property-api-resourcepolicystatement" )
1825cognitoauthorizeridentity = get_prop ("sam-property-api-cognitoauthorizationidentity" )
1926cognitoauthorizer = get_prop ("sam-property-api-cognitoauthorizer" )
2431usageplan = get_prop ("sam-property-api-apiusageplan" )
2532auth = get_prop ("sam-property-api-apiauth" )
2633cors = get_prop ("sam-property-api-corsconfiguration" )
27- route53 = get_prop ("sam-property-api-route53configuration" )
28- domain = get_prop ("sam-property-api-domainconfiguration" )
29- definitionuri = get_prop ("sam-property-api-apidefinition" )
30- endpointconfiguration = get_prop ("sam-property-api-endpointconfiguration" )
31- properties = get_prop ("sam-resource-api" )
34+ route53 = get_prop (ROUTE53_STEM )
35+ domain = get_prop (DOMAIN_STEM )
36+ definitionuri = get_prop (DEFINITION_URI_STEM )
37+ endpointconfiguration = get_prop (ENDPOINT_CONFIGURATION_STEM )
38+ properties = get_prop (PROPERTIES_STEM )
3239
3340
3441class ResourcePolicy (BaseModel ):
@@ -127,10 +134,26 @@ class Cors(BaseModel):
127134
128135
129136class Route53 (BaseModel ):
130- DistributionDomainName : Optional [PassThroughProp ] = route53 ("DistributionDomainName" )
131- EvaluateTargetHealth : Optional [PassThroughProp ] = route53 ("EvaluateTargetHealth" )
132- HostedZoneId : Optional [PassThroughProp ] = route53 ("HostedZoneId" )
133- HostedZoneName : Optional [PassThroughProp ] = route53 ("HostedZoneName" )
137+ DistributionDomainName : Optional [PassThroughProp ] = passthrough_prop (
138+ ROUTE53_STEM ,
139+ "DistributionDomainName" ,
140+ ["AWS::Route53::RecordSetGroup.AliasTarget" , "DNSName" ],
141+ )
142+ EvaluateTargetHealth : Optional [PassThroughProp ] = passthrough_prop (
143+ ROUTE53_STEM ,
144+ "EvaluateTargetHealth" ,
145+ ["AWS::Route53::RecordSetGroup.AliasTarget" , "EvaluateTargetHealth" ],
146+ )
147+ HostedZoneId : Optional [PassThroughProp ] = passthrough_prop (
148+ ROUTE53_STEM ,
149+ "HostedZoneId" ,
150+ ["AWS::Route53::RecordSetGroup.RecordSet" , "HostedZoneId" ],
151+ )
152+ HostedZoneName : Optional [PassThroughProp ] = passthrough_prop (
153+ ROUTE53_STEM ,
154+ "HostedZoneName" ,
155+ ["AWS::Route53::RecordSetGroup.RecordSet" , "HostedZoneName" ],
156+ )
134157 IpV6 : Optional [bool ] = route53 ("IpV6" )
135158 SetIdentifier : Optional [PassThroughProp ] # TODO: add docs
136159 Region : Optional [PassThroughProp ] # TODO: add docs
@@ -141,23 +164,59 @@ class Domain(BaseModel):
141164 BasePath : Optional [PassThroughProp ] = domain ("BasePath" )
142165 NormalizeBasePath : Optional [bool ] = domain ("NormalizeBasePath" )
143166 CertificateArn : PassThroughProp = domain ("CertificateArn" )
144- DomainName : PassThroughProp = domain ("DomainName" )
167+ DomainName : PassThroughProp = passthrough_prop (
168+ DOMAIN_STEM ,
169+ "DomainName" ,
170+ ["AWS::ApiGateway::DomainName" , "Properties" , "DomainName" ],
171+ )
145172 EndpointConfiguration : Optional [SamIntrinsicable [Literal ["REGIONAL" , "EDGE" ]]] = domain ("EndpointConfiguration" )
146- MutualTlsAuthentication : Optional [PassThroughProp ] = domain ("MutualTlsAuthentication" )
147- OwnershipVerificationCertificateArn : Optional [PassThroughProp ] = domain ("OwnershipVerificationCertificateArn" )
173+ MutualTlsAuthentication : Optional [PassThroughProp ] = passthrough_prop (
174+ DOMAIN_STEM ,
175+ "MutualTlsAuthentication" ,
176+ ["AWS::ApiGateway::DomainName" , "Properties" , "MutualTlsAuthentication" ],
177+ )
178+ OwnershipVerificationCertificateArn : Optional [PassThroughProp ] = passthrough_prop (
179+ DOMAIN_STEM ,
180+ "OwnershipVerificationCertificateArn" ,
181+ ["AWS::ApiGateway::DomainName" , "Properties" , "OwnershipVerificationCertificateArn" ],
182+ )
148183 Route53 : Optional [Route53 ] = domain ("Route53" )
149- SecurityPolicy : Optional [PassThroughProp ] = domain ("SecurityPolicy" )
184+ SecurityPolicy : Optional [PassThroughProp ] = passthrough_prop (
185+ DOMAIN_STEM ,
186+ "SecurityPolicy" ,
187+ ["AWS::ApiGateway::DomainName" , "Properties" , "SecurityPolicy" ],
188+ )
150189
151190
152191class DefinitionUri (BaseModel ):
153- Bucket : PassThroughProp = definitionuri ("Bucket" )
154- Key : PassThroughProp = definitionuri ("Key" )
155- Version : Optional [PassThroughProp ] = definitionuri ("Version" )
192+ Bucket : PassThroughProp = passthrough_prop (
193+ DEFINITION_URI_STEM ,
194+ "Bucket" ,
195+ ["AWS::ApiGateway::RestApi.S3Location" , "Bucket" ],
196+ )
197+ Key : PassThroughProp = passthrough_prop (
198+ DEFINITION_URI_STEM ,
199+ "Key" ,
200+ ["AWS::ApiGateway::RestApi.S3Location" , "Key" ],
201+ )
202+ Version : Optional [PassThroughProp ] = passthrough_prop (
203+ DEFINITION_URI_STEM ,
204+ "Version" ,
205+ ["AWS::ApiGateway::RestApi.S3Location" , "Version" ],
206+ )
156207
157208
158209class EndpointConfiguration (BaseModel ):
159- Type : Optional [PassThroughProp ] = endpointconfiguration ("Type" )
160- VPCEndpointIds : Optional [PassThroughProp ] = endpointconfiguration ("VPCEndpointIds" )
210+ Type : Optional [PassThroughProp ] = passthrough_prop (
211+ ENDPOINT_CONFIGURATION_STEM ,
212+ "Type" ,
213+ ["AWS::ApiGateway::RestApi.EndpointConfiguration" , "Types" ],
214+ )
215+ VPCEndpointIds : Optional [PassThroughProp ] = passthrough_prop (
216+ ENDPOINT_CONFIGURATION_STEM ,
217+ "VPCEndpointIds" ,
218+ ["AWS::ApiGateway::RestApi.EndpointConfiguration" , "VpcEndpointIds" ],
219+ )
161220
162221
163222Name = Optional [PassThroughProp ]
@@ -180,53 +239,137 @@ class EndpointConfiguration(BaseModel):
180239
181240
182241class Properties (BaseModel ):
183- AccessLogSetting : Optional [AccessLogSetting ] = properties ("AccessLogSetting" )
184- ApiKeySourceType : Optional [PassThroughProp ] = properties ("ApiKeySourceType" )
242+ AccessLogSetting : Optional [AccessLogSetting ] = passthrough_prop (
243+ PROPERTIES_STEM ,
244+ "AccessLogSetting" ,
245+ ["AWS::ApiGateway::Stage" , "Properties" , "AccessLogSetting" ],
246+ )
247+ ApiKeySourceType : Optional [PassThroughProp ] = passthrough_prop (
248+ PROPERTIES_STEM ,
249+ "ApiKeySourceType" ,
250+ ["AWS::ApiGateway::RestApi" , "Properties" , "ApiKeySourceType" ],
251+ )
185252 Auth : Optional [Auth ] = properties ("Auth" )
186253 BinaryMediaTypes : Optional [BinaryMediaTypes ] = properties ("BinaryMediaTypes" )
187- CacheClusterEnabled : Optional [CacheClusterEnabled ] = properties ("CacheClusterEnabled" )
188- CacheClusterSize : Optional [CacheClusterSize ] = properties ("CacheClusterSize" )
189- CanarySetting : Optional [CanarySetting ] = properties ("CanarySetting" )
254+ CacheClusterEnabled : Optional [CacheClusterEnabled ] = passthrough_prop (
255+ PROPERTIES_STEM ,
256+ "CacheClusterEnabled" ,
257+ ["AWS::ApiGateway::Stage" , "Properties" , "CacheClusterEnabled" ],
258+ )
259+ CacheClusterSize : Optional [CacheClusterSize ] = passthrough_prop (
260+ PROPERTIES_STEM ,
261+ "CacheClusterSize" ,
262+ ["AWS::ApiGateway::Stage" , "Properties" , "CacheClusterSize" ],
263+ )
264+ CanarySetting : Optional [CanarySetting ] = passthrough_prop (
265+ PROPERTIES_STEM ,
266+ "CanarySetting" ,
267+ ["AWS::ApiGateway::Stage" , "Properties" , "CanarySetting" ],
268+ )
190269 Cors : Optional [CorsType ] = properties ("Cors" )
191270 DefinitionBody : Optional [DictStrAny ] = properties ("DefinitionBody" )
192271 DefinitionUri : Optional [DefinitionUriType ] = properties ("DefinitionUri" )
193272 MergeDefinitions : Optional [MergeDefinitions ] = properties ("MergeDefinitions" )
194- Description : Optional [PassThroughProp ] = properties ("Description" )
273+ Description : Optional [PassThroughProp ] = passthrough_prop (
274+ PROPERTIES_STEM ,
275+ "Description" ,
276+ ["AWS::ApiGateway::Stage" , "Properties" , "Description" ],
277+ )
195278 DisableExecuteApiEndpoint : Optional [PassThroughProp ] = properties ("DisableExecuteApiEndpoint" )
196279 Domain : Optional [Domain ] = properties ("Domain" )
197280 EndpointConfiguration : Optional [EndpointConfigurationType ] = properties ("EndpointConfiguration" )
198- FailOnWarnings : Optional [PassThroughProp ] = properties ("FailOnWarnings" )
281+ FailOnWarnings : Optional [PassThroughProp ] = passthrough_prop (
282+ PROPERTIES_STEM ,
283+ "FailOnWarnings" ,
284+ ["AWS::ApiGateway::RestApi" , "Properties" , "FailOnWarnings" ],
285+ )
199286 GatewayResponses : Optional [GatewayResponses ] = properties ("GatewayResponses" )
200- MethodSettings : Optional [MethodSettings ] = properties ("MethodSettings" )
201- MinimumCompressionSize : Optional [MinimumCompressionSize ] = properties ("MinimumCompressionSize" )
202- Mode : Optional [PassThroughProp ] = properties ("Mode" )
287+ MethodSettings : Optional [MethodSettings ] = passthrough_prop (
288+ PROPERTIES_STEM ,
289+ "MethodSettings" ,
290+ ["AWS::ApiGateway::Stage" , "Properties" , "MethodSettings" ],
291+ )
292+ MinimumCompressionSize : Optional [MinimumCompressionSize ] = passthrough_prop (
293+ PROPERTIES_STEM ,
294+ "MinimumCompressionSize" ,
295+ ["AWS::ApiGateway::RestApi" , "Properties" , "MinimumCompressionSize" ],
296+ )
297+ Mode : Optional [PassThroughProp ] = passthrough_prop (
298+ PROPERTIES_STEM ,
299+ "Mode" ,
300+ ["AWS::ApiGateway::RestApi" , "Properties" , "Mode" ],
301+ )
203302 Models : Optional [DictStrAny ] = properties ("Models" )
204- Name : Optional [Name ] = properties ("Name" )
303+ Name : Optional [Name ] = passthrough_prop (
304+ PROPERTIES_STEM ,
305+ "Name" ,
306+ ["AWS::ApiGateway::RestApi" , "Properties" , "Name" ],
307+ )
205308 OpenApiVersion : Optional [OpenApiVersion ] = properties ("OpenApiVersion" )
206309 StageName : SamIntrinsicable [str ] = properties ("StageName" )
207310 Tags : Optional [DictStrAny ] = properties ("Tags" )
208- TracingEnabled : Optional [TracingEnabled ] = properties ("TracingEnabled" )
209- Variables : Optional [Variables ] = properties ("Variables" )
311+ TracingEnabled : Optional [TracingEnabled ] = passthrough_prop (
312+ PROPERTIES_STEM ,
313+ "TracingEnabled" ,
314+ ["AWS::ApiGateway::Stage" , "Properties" , "TracingEnabled" ],
315+ )
316+ Variables : Optional [Variables ] = passthrough_prop (
317+ PROPERTIES_STEM ,
318+ "Variables" ,
319+ ["AWS::ApiGateway::Stage" , "Properties" , "Variables" ],
320+ )
210321 AlwaysDeploy : Optional [AlwaysDeploy ] = properties ("AlwaysDeploy" )
211322
212323
213324class Globals (BaseModel ):
214325 Auth : Optional [Auth ] = properties ("Auth" )
215- Name : Optional [Name ] = properties ("Name" )
326+ Name : Optional [Name ] = passthrough_prop (
327+ PROPERTIES_STEM ,
328+ "Name" ,
329+ ["AWS::ApiGateway::RestApi" , "Properties" , "Name" ],
330+ )
216331 DefinitionUri : Optional [PassThroughProp ] = properties ("DefinitionUri" )
217- CacheClusterEnabled : Optional [CacheClusterEnabled ] = properties ("CacheClusterEnabled" )
218- CacheClusterSize : Optional [CacheClusterSize ] = properties ("CacheClusterSize" )
332+ CacheClusterEnabled : Optional [CacheClusterEnabled ] = passthrough_prop (
333+ PROPERTIES_STEM ,
334+ "CacheClusterEnabled" ,
335+ ["AWS::ApiGateway::Stage" , "Properties" , "CacheClusterEnabled" ],
336+ )
337+ CacheClusterSize : Optional [CacheClusterSize ] = passthrough_prop (
338+ PROPERTIES_STEM ,
339+ "CacheClusterSize" ,
340+ ["AWS::ApiGateway::Stage" , "Properties" , "CacheClusterSize" ],
341+ )
219342 MergeDefinitions : Optional [MergeDefinitions ] = properties ("MergeDefinitions" )
220- Variables : Optional [Variables ] = properties ("Variables" )
343+ Variables : Optional [Variables ] = passthrough_prop (
344+ PROPERTIES_STEM ,
345+ "Variables" ,
346+ ["AWS::ApiGateway::Stage" , "Properties" , "Variables" ],
347+ )
221348 EndpointConfiguration : Optional [PassThroughProp ] = properties ("EndpointConfiguration" )
222349 MethodSettings : Optional [MethodSettings ] = properties ("MethodSettings" )
223350 BinaryMediaTypes : Optional [BinaryMediaTypes ] = properties ("BinaryMediaTypes" )
224- MinimumCompressionSize : Optional [MinimumCompressionSize ] = properties ("MinimumCompressionSize" )
351+ MinimumCompressionSize : Optional [MinimumCompressionSize ] = passthrough_prop (
352+ PROPERTIES_STEM ,
353+ "MinimumCompressionSize" ,
354+ ["AWS::ApiGateway::RestApi" , "Properties" , "MinimumCompressionSize" ],
355+ )
225356 Cors : Optional [CorsType ] = properties ("Cors" )
226357 GatewayResponses : Optional [GatewayResponses ] = properties ("GatewayResponses" )
227- AccessLogSetting : Optional [AccessLogSetting ] = properties ("AccessLogSetting" )
228- CanarySetting : Optional [CanarySetting ] = properties ("CanarySetting" )
229- TracingEnabled : Optional [TracingEnabled ] = properties ("TracingEnabled" )
358+ AccessLogSetting : Optional [AccessLogSetting ] = passthrough_prop (
359+ PROPERTIES_STEM ,
360+ "AccessLogSetting" ,
361+ ["AWS::ApiGateway::Stage" , "Properties" , "AccessLogSetting" ],
362+ )
363+ CanarySetting : Optional [CanarySetting ] = passthrough_prop (
364+ PROPERTIES_STEM ,
365+ "CanarySetting" ,
366+ ["AWS::ApiGateway::Stage" , "Properties" , "CanarySetting" ],
367+ )
368+ TracingEnabled : Optional [TracingEnabled ] = passthrough_prop (
369+ PROPERTIES_STEM ,
370+ "TracingEnabled" ,
371+ ["AWS::ApiGateway::Stage" , "Properties" , "TracingEnabled" ],
372+ )
230373 OpenApiVersion : Optional [OpenApiVersion ] = properties ("OpenApiVersion" )
231374 Domain : Optional [Domain ] = properties ("Domain" )
232375 AlwaysDeploy : Optional [AlwaysDeploy ] = properties ("AlwaysDeploy" )
0 commit comments