Skip to content

Commit 1ca9db7

Browse files
authored
add missing doc reference (#3880)
1 parent 473373b commit 1ca9db7

13 files changed

+7111
-2557
lines changed

samtranslator/internal/schema_source/aws_serverless_api.py

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
ROUTE53_STEM = "sam-property-api-route53configuration"
1919
ENDPOINT_CONFIGURATION_STEM = "sam-property-api-endpointconfiguration"
2020
DEFINITION_URI_STEM = "sam-property-api-apidefinition"
21+
ACCESS_ASSOCIATION_STEM = "sam-property-api-domainaccessassociation"
2122

2223
resourcepolicy = get_prop("sam-property-api-resourcepolicystatement")
2324
cognitoauthorizeridentity = get_prop("sam-property-api-cognitoauthorizationidentity")
@@ -103,7 +104,7 @@ class UsagePlan(BaseModel):
103104

104105
class Auth(BaseModel):
105106
AddDefaultAuthorizerToCorsPreflight: Optional[bool] = auth("AddDefaultAuthorizerToCorsPreflight")
106-
AddApiKeyRequiredToCorsPreflight: Optional[bool] # TODO Add Docs
107+
AddApiKeyRequiredToCorsPreflight: Optional[bool] = auth("AddApiKeyRequiredToCorsPreflight")
107108
ApiKeyRequired: Optional[bool] = auth("ApiKeyRequired")
108109
Authorizers: Optional[
109110
Dict[
@@ -151,15 +152,35 @@ class Route53(BaseModel):
151152
["AWS::Route53::RecordSetGroup.RecordSet", "HostedZoneName"],
152153
)
153154
IpV6: Optional[bool] = route53("IpV6")
154-
SetIdentifier: Optional[PassThroughProp] # TODO: add docs
155-
Region: Optional[PassThroughProp] # TODO: add docs
156-
SeparateRecordSetGroup: Optional[bool] # TODO: add docs
157-
VpcEndpointDomainName: Optional[PassThroughProp] # TODO: add docs
158-
VpcEndpointHostedZoneId: Optional[PassThroughProp] # TODO: add docs
155+
SetIdentifier: Optional[PassThroughProp] = passthrough_prop(
156+
ROUTE53_STEM,
157+
"SetIdentifier",
158+
["AWS::Route53::RecordSetGroup.RecordSet", "SetIdentifier"],
159+
)
160+
Region: Optional[PassThroughProp] = passthrough_prop(
161+
ROUTE53_STEM,
162+
"Region",
163+
["AWS::Route53::RecordSetGroup.RecordSet", "Region"],
164+
)
165+
SeparateRecordSetGroup: Optional[bool] # SAM-specific property - not yet documented in sam-docs.json
166+
VpcEndpointDomainName: Optional[PassThroughProp] = passthrough_prop(
167+
ROUTE53_STEM,
168+
"VpcEndpointDomainName",
169+
["AWS::Route53::RecordSet.AliasTarget", "DNSName"],
170+
)
171+
VpcEndpointHostedZoneId: Optional[PassThroughProp] = passthrough_prop(
172+
ROUTE53_STEM,
173+
"VpcEndpointHostedZoneId",
174+
["AWS::Route53::RecordSet.AliasTarget", "HostedZoneId"],
175+
)
159176

160177

161178
class AccessAssociation(BaseModel):
162-
VpcEndpointId: PassThroughProp # TODO: add docs
179+
VpcEndpointId: PassThroughProp = passthrough_prop(
180+
ACCESS_ASSOCIATION_STEM,
181+
"VpcEndpointId",
182+
["AWS::ApiGateway::DomainNameAccessAssociation", "Properties", "AccessAssociationSource"],
183+
)
163184

164185

165186
class Domain(BaseModel):
@@ -175,11 +196,7 @@ class Domain(BaseModel):
175196
EndpointConfiguration: Optional[SamIntrinsicable[Literal["REGIONAL", "EDGE", "PRIVATE"]]] = domain(
176197
"EndpointConfiguration"
177198
)
178-
IpAddressType: Optional[PassThroughProp] = passthrough_prop(
179-
DOMAIN_STEM,
180-
"IpAddressType",
181-
["AWS::ApiGateway::DomainName.EndpointConfiguration", "IpAddressType"],
182-
)
199+
IpAddressType: Optional[PassThroughProp] # TODO: add documentation; currently unavailable
183200
MutualTlsAuthentication: Optional[PassThroughProp] = passthrough_prop(
184201
DOMAIN_STEM,
185202
"MutualTlsAuthentication",
@@ -228,11 +245,7 @@ class EndpointConfiguration(BaseModel):
228245
"VPCEndpointIds",
229246
["AWS::ApiGateway::RestApi.EndpointConfiguration", "VpcEndpointIds"],
230247
)
231-
IpAddressType: Optional[PassThroughProp] = passthrough_prop(
232-
ENDPOINT_CONFIGURATION_STEM,
233-
"IpAddressType",
234-
["AWS::ApiGateway::RestApi.EndpointConfiguration", "IpAddressType"],
235-
)
248+
IpAddressType: Optional[PassThroughProp] # TODO: add documentation; currently unavailable
236249

237250

238251
Name = Optional[PassThroughProp]
@@ -324,8 +337,12 @@ class Properties(BaseModel):
324337
OpenApiVersion: Optional[OpenApiVersion] = properties("OpenApiVersion")
325338
StageName: SamIntrinsicable[str] = properties("StageName")
326339
Tags: Optional[DictStrAny] = properties("Tags")
327-
Policy: Optional[PassThroughProp] # TODO: add docs
328-
PropagateTags: Optional[bool] # TODO: add docs
340+
Policy: Optional[PassThroughProp] = passthrough_prop(
341+
PROPERTIES_STEM,
342+
"Policy",
343+
["AWS::ApiGateway::RestApi", "Properties", "Policy"],
344+
)
345+
PropagateTags: Optional[bool] = properties("PropagateTags")
329346
SecurityPolicy: Optional[PassThroughProp] = passthrough_prop(
330347
PROPERTIES_STEM,
331348
"SecurityPolicy",
@@ -396,7 +413,7 @@ class Globals(BaseModel):
396413
OpenApiVersion: Optional[OpenApiVersion] = properties("OpenApiVersion")
397414
Domain: Optional[Domain] = properties("Domain")
398415
AlwaysDeploy: Optional[AlwaysDeploy] = properties("AlwaysDeploy")
399-
PropagateTags: Optional[bool] # TODO: add docs
416+
PropagateTags: Optional[bool] = properties("PropagateTags")
400417
SecurityPolicy: Optional[PassThroughProp] = passthrough_prop(
401418
PROPERTIES_STEM,
402419
"SecurityPolicy",

samtranslator/internal/schema_source/aws_serverless_capacity_provider.py

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ResourceAttributes,
1010
SamIntrinsicable,
1111
get_prop,
12+
passthrough_prop,
1213
)
1314

1415
PROPERTIES_STEM = "sam-resource-capacityprovider"
@@ -52,15 +53,11 @@ class ScalingConfig(BaseModel):
5253

5354

5455
class Properties(BaseModel):
55-
# TODO: Change back to passthrough_prop after CloudFormation schema is updated with AWS::Lambda::CapacityProvider
56-
# Optional capacity provider name - passes through directly to CFN AWS::Lambda::CapacityProvider
57-
# Uses PassThroughProp because it's a direct 1:1 mapping with no SAM transformation
58-
# CapacityProviderName: Optional[PassThroughProp] = passthrough_prop(
59-
# PROPERTIES_STEM,
60-
# "CapacityProviderName",
61-
# ["AWS::Lambda::CapacityProvider", "Properties", "CapacityProviderName"],
62-
# )
63-
CapacityProviderName: Optional[PassThroughProp] # TODO: add documentation
56+
CapacityProviderName: Optional[PassThroughProp] = passthrough_prop(
57+
PROPERTIES_STEM,
58+
"CapacityProviderName",
59+
["AWS::Lambda::CapacityProvider", "Properties", "CapacityProviderName"],
60+
)
6461

6562
# Required VPC configuration - preserves CFN structure, required for EC2 instance networking
6663
# Uses custom VpcConfig class to validate required SubnetIds while maintaining passthrough behavior
@@ -85,15 +82,11 @@ class Properties(BaseModel):
8582
# Uses custom ScalingConfig class because SAM renames construct (CapacityProviderScalingConfig→ScalingConfig)
8683
ScalingConfig: Optional[ScalingConfig] = properties("ScalingConfig")
8784

88-
# TODO: Change back to passthrough_prop after CloudFormation schema is updated with AWS::Lambda::CapacityProvider
89-
# Optional KMS key ARN - passes through directly to CFN for encryption configuration
90-
# Uses PassThroughProp because it's a direct 1:1 mapping with no SAM transformation
91-
# KmsKeyArn: Optional[PassThroughProp] = passthrough_prop(
92-
# PROPERTIES_STEM,
93-
# "KmsKeyArn",
94-
# ["AWS::Lambda::CapacityProvider", "Properties", "KmsKeyArn"],
95-
# )
96-
KmsKeyArn: Optional[PassThroughProp] # TODO: add documentation
85+
KmsKeyArn: Optional[PassThroughProp] = passthrough_prop(
86+
PROPERTIES_STEM,
87+
"KmsKeyArn",
88+
["AWS::Lambda::CapacityProvider", "Properties", "KmsKeyArn"],
89+
)
9790

9891

9992
class Globals(BaseModel):
@@ -120,7 +113,11 @@ class Globals(BaseModel):
120113
# Uses custom ScalingConfig class because SAM renames construct (CapacityProviderScalingConfig→ScalingConfig)
121114
ScalingConfig: Optional[ScalingConfig] = properties("ScalingConfig")
122115

123-
KmsKeyArn: Optional[PassThroughProp] # TODO: add documentation
116+
KmsKeyArn: Optional[PassThroughProp] = passthrough_prop(
117+
PROPERTIES_STEM,
118+
"KmsKeyArn",
119+
["AWS::Lambda::CapacityProvider", "Properties", "KmsKeyArn"],
120+
)
124121

125122

126123
class Resource(ResourceAttributes):

0 commit comments

Comments
 (0)