Skip to content

Commit 5c61dee

Browse files
authored
Support intrinsic functions capacity provider vpc config nstance requirements list properties (#3869)
1 parent 70e61e0 commit 5c61dee

File tree

8 files changed

+526
-144
lines changed

8 files changed

+526
-144
lines changed

samtranslator/internal/schema_source/aws_serverless_capacity_provider.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424

2525
class VpcConfig(BaseModel):
2626
# Optional list of security group IDs - supports intrinsic functions for dynamic references
27-
SecurityGroupIds: Optional[List[SamIntrinsicable[str]]] = vpcconfig("SecurityGroupIds")
27+
SecurityGroupIds: Optional[SamIntrinsicable[List[SamIntrinsicable[str]]]] = vpcconfig("SecurityGroupIds")
2828
# Required list of subnet IDs - supports intrinsic functions for dynamic VPC configuration
29-
SubnetIds: List[SamIntrinsicable[str]] = vpcconfig("SubnetIds")
29+
SubnetIds: SamIntrinsicable[List[SamIntrinsicable[str]]] = vpcconfig("SubnetIds")
3030

3131

3232
class InstanceRequirements(BaseModel):
3333
# Optional list of CPU architectures - maps to CFN InstanceRequirements.Architecture
34-
# Uses List[SamIntrinsicable[str]] to support intrinsic functions like !Ref for dynamic architecture values
35-
Architectures: Optional[List[SamIntrinsicable[str]]] = instancerequirements("Architectures")
34+
# Uses SamIntrinsicable[List[SamIntrinsicable[str]]] to support intrinsic functions like !Ref for both list and list item
35+
Architectures: Optional[SamIntrinsicable[List[SamIntrinsicable[str]]]] = instancerequirements("Architectures")
3636
# Optional list of allowed EC2 instance types - maps to CFN InstanceRequirements.AllowedInstanceTypes
37-
# Uses List[SamIntrinsicable[str]] to support intrinsic functions like !Ref for dynamic instance types
38-
AllowedTypes: Optional[List[SamIntrinsicable[str]]] = instancerequirements("AllowedTypes")
37+
# Uses SamIntrinsicable[List[SamIntrinsicable[str]]] to support intrinsic functions like !Ref for both list and list item
38+
AllowedTypes: Optional[SamIntrinsicable[List[SamIntrinsicable[str]]]] = instancerequirements("AllowedTypes")
3939
# Optional list of excluded EC2 instance types - maps to CFN InstanceRequirements.ExcludedInstanceTypes
40-
# Uses List[SamIntrinsicable[str]] to support intrinsic functions like !Ref for dynamic instance types
41-
ExcludedTypes: Optional[List[SamIntrinsicable[str]]] = instancerequirements("ExcludedTypes")
40+
# Uses SamIntrinsicable[List[SamIntrinsicable[str]]] to support intrinsic functions like !Ref for both list and list item
41+
ExcludedTypes: Optional[SamIntrinsicable[List[SamIntrinsicable[str]]]] = instancerequirements("ExcludedTypes")
4242

4343

4444
class ScalingConfig(BaseModel):

samtranslator/schema/schema.json

Lines changed: 90 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -275088,49 +275088,70 @@
275088275088
"additionalProperties": false,
275089275089
"properties": {
275090275090
"AllowedTypes": {
275091-
"items": {
275092-
"anyOf": [
275093-
{
275094-
"type": "string"
275091+
"anyOf": [
275092+
{
275093+
"type": "object"
275094+
},
275095+
{
275096+
"items": {
275097+
"anyOf": [
275098+
{
275099+
"type": "string"
275100+
},
275101+
{
275102+
"type": "object"
275103+
}
275104+
]
275095275105
},
275096-
{
275097-
"type": "object"
275098-
}
275099-
]
275100-
},
275106+
"type": "array"
275107+
}
275108+
],
275101275109
"markdownDescription": "The allowed instance types.\n*Type*: List of String\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`AllowedInstanceTypes`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-instancerequirements.html#cfn-lambda-capacityprovider-instancerequirements-allowedinstancetypes) property of the `AWS::Lambda::CapacityProvider` `InstanceRequirements` data type.",
275102-
"title": "AllowedTypes",
275103-
"type": "array"
275110+
"title": "AllowedTypes"
275104275111
},
275105275112
"Architectures": {
275106-
"items": {
275107-
"anyOf": [
275108-
{
275109-
"type": "string"
275113+
"anyOf": [
275114+
{
275115+
"type": "object"
275116+
},
275117+
{
275118+
"items": {
275119+
"anyOf": [
275120+
{
275121+
"type": "string"
275122+
},
275123+
{
275124+
"type": "object"
275125+
}
275126+
]
275110275127
},
275111-
{
275112-
"type": "object"
275113-
}
275114-
]
275115-
},
275128+
"type": "array"
275129+
}
275130+
],
275116275131
"markdownDescription": "The CPU architecture for the instances.\n*Type*: List of String\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`Architecture`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-instancerequirements.html#cfn-lambda-capacityprovider-instancerequirements-architecture) property of the `AWS::Lambda::CapacityProvider` `InstanceRequirements` data type.",
275117-
"title": "Architectures",
275118-
"type": "array"
275132+
"title": "Architectures"
275119275133
},
275120275134
"ExcludedTypes": {
275121-
"items": {
275122-
"anyOf": [
275123-
{
275124-
"type": "string"
275135+
"anyOf": [
275136+
{
275137+
"type": "object"
275138+
},
275139+
{
275140+
"items": {
275141+
"anyOf": [
275142+
{
275143+
"type": "string"
275144+
},
275145+
{
275146+
"type": "object"
275147+
}
275148+
]
275125275149
},
275126-
{
275127-
"type": "object"
275128-
}
275129-
]
275130-
},
275150+
"type": "array"
275151+
}
275152+
],
275131275153
"markdownDescription": "The excluded instance types.\n*Type*: List of String\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`ExcludedInstanceTypes`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-instancerequirements.html#cfn-lambda-capacityprovider-instancerequirements-excludedinstancetypes) property of the `AWS::Lambda::CapacityProvider` `InstanceRequirements` data type.",
275132-
"title": "ExcludedTypes",
275133-
"type": "array"
275154+
"title": "ExcludedTypes"
275134275155
}
275135275156
},
275136275157
"title": "InstanceRequirements",
@@ -277136,34 +277157,48 @@
277136277157
"additionalProperties": false,
277137277158
"properties": {
277138277159
"SecurityGroupIds": {
277139-
"items": {
277140-
"anyOf": [
277141-
{
277142-
"type": "string"
277160+
"anyOf": [
277161+
{
277162+
"type": "object"
277163+
},
277164+
{
277165+
"items": {
277166+
"anyOf": [
277167+
{
277168+
"type": "string"
277169+
},
277170+
{
277171+
"type": "object"
277172+
}
277173+
]
277143277174
},
277144-
{
277145-
"type": "object"
277146-
}
277147-
]
277148-
},
277175+
"type": "array"
277176+
}
277177+
],
277149277178
"markdownDescription": "A list of VPC security group IDs.\n*Type*: List of String\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`SecurityGroupIds`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-vpcconfig.html#cfn-lambda-capacityprovider-vpcconfig-securitygroupids) property of the `AWS::Lambda::CapacityProvider` `VpcConfig` data type.",
277150-
"title": "SecurityGroupIds",
277151-
"type": "array"
277179+
"title": "SecurityGroupIds"
277152277180
},
277153277181
"SubnetIds": {
277154-
"items": {
277155-
"anyOf": [
277156-
{
277157-
"type": "string"
277182+
"anyOf": [
277183+
{
277184+
"type": "object"
277185+
},
277186+
{
277187+
"items": {
277188+
"anyOf": [
277189+
{
277190+
"type": "string"
277191+
},
277192+
{
277193+
"type": "object"
277194+
}
277195+
]
277158277196
},
277159-
{
277160-
"type": "object"
277161-
}
277162-
]
277163-
},
277197+
"type": "array"
277198+
}
277199+
],
277164277200
"markdownDescription": "A list of VPC subnet IDs.\n*Type*: List of String\n*Required*: Yes\n*AWS CloudFormation compatibility*: This property is passed directly to the [`SubnetIds`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-vpcconfig.html#cfn-lambda-capacityprovider-vpcconfig-subnetids) property of the `AWS::Lambda::CapacityProvider` `VpcConfig` data type.",
277165-
"title": "SubnetIds",
277166-
"type": "array"
277201+
"title": "SubnetIds"
277167277202
}
277168277203
},
277169277204
"required": [

schema_source/sam.schema.json

Lines changed: 90 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,49 +1686,70 @@
16861686
"additionalProperties": false,
16871687
"properties": {
16881688
"AllowedTypes": {
1689-
"items": {
1690-
"anyOf": [
1691-
{
1692-
"type": "string"
1689+
"anyOf": [
1690+
{
1691+
"type": "object"
1692+
},
1693+
{
1694+
"items": {
1695+
"anyOf": [
1696+
{
1697+
"type": "string"
1698+
},
1699+
{
1700+
"type": "object"
1701+
}
1702+
]
16931703
},
1694-
{
1695-
"type": "object"
1696-
}
1697-
]
1698-
},
1704+
"type": "array"
1705+
}
1706+
],
16991707
"markdownDescription": "The allowed instance types.\n*Type*: List of String\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`AllowedInstanceTypes`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-instancerequirements.html#cfn-lambda-capacityprovider-instancerequirements-allowedinstancetypes) property of the `AWS::Lambda::CapacityProvider` `InstanceRequirements` data type.",
1700-
"title": "AllowedTypes",
1701-
"type": "array"
1708+
"title": "AllowedTypes"
17021709
},
17031710
"Architectures": {
1704-
"items": {
1705-
"anyOf": [
1706-
{
1707-
"type": "string"
1711+
"anyOf": [
1712+
{
1713+
"type": "object"
1714+
},
1715+
{
1716+
"items": {
1717+
"anyOf": [
1718+
{
1719+
"type": "string"
1720+
},
1721+
{
1722+
"type": "object"
1723+
}
1724+
]
17081725
},
1709-
{
1710-
"type": "object"
1711-
}
1712-
]
1713-
},
1726+
"type": "array"
1727+
}
1728+
],
17141729
"markdownDescription": "The CPU architecture for the instances.\n*Type*: List of String\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`Architecture`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-instancerequirements.html#cfn-lambda-capacityprovider-instancerequirements-architecture) property of the `AWS::Lambda::CapacityProvider` `InstanceRequirements` data type.",
1715-
"title": "Architectures",
1716-
"type": "array"
1730+
"title": "Architectures"
17171731
},
17181732
"ExcludedTypes": {
1719-
"items": {
1720-
"anyOf": [
1721-
{
1722-
"type": "string"
1733+
"anyOf": [
1734+
{
1735+
"type": "object"
1736+
},
1737+
{
1738+
"items": {
1739+
"anyOf": [
1740+
{
1741+
"type": "string"
1742+
},
1743+
{
1744+
"type": "object"
1745+
}
1746+
]
17231747
},
1724-
{
1725-
"type": "object"
1726-
}
1727-
]
1728-
},
1748+
"type": "array"
1749+
}
1750+
],
17291751
"markdownDescription": "The excluded instance types.\n*Type*: List of String\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`ExcludedInstanceTypes`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-instancerequirements.html#cfn-lambda-capacityprovider-instancerequirements-excludedinstancetypes) property of the `AWS::Lambda::CapacityProvider` `InstanceRequirements` data type.",
1730-
"title": "ExcludedTypes",
1731-
"type": "array"
1752+
"title": "ExcludedTypes"
17321753
}
17331754
},
17341755
"title": "InstanceRequirements",
@@ -3649,34 +3670,48 @@
36493670
"additionalProperties": false,
36503671
"properties": {
36513672
"SecurityGroupIds": {
3652-
"items": {
3653-
"anyOf": [
3654-
{
3655-
"type": "string"
3673+
"anyOf": [
3674+
{
3675+
"type": "object"
3676+
},
3677+
{
3678+
"items": {
3679+
"anyOf": [
3680+
{
3681+
"type": "string"
3682+
},
3683+
{
3684+
"type": "object"
3685+
}
3686+
]
36563687
},
3657-
{
3658-
"type": "object"
3659-
}
3660-
]
3661-
},
3688+
"type": "array"
3689+
}
3690+
],
36623691
"markdownDescription": "A list of VPC security group IDs.\n*Type*: List of String\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`SecurityGroupIds`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-vpcconfig.html#cfn-lambda-capacityprovider-vpcconfig-securitygroupids) property of the `AWS::Lambda::CapacityProvider` `VpcConfig` data type.",
3663-
"title": "SecurityGroupIds",
3664-
"type": "array"
3692+
"title": "SecurityGroupIds"
36653693
},
36663694
"SubnetIds": {
3667-
"items": {
3668-
"anyOf": [
3669-
{
3670-
"type": "string"
3695+
"anyOf": [
3696+
{
3697+
"type": "object"
3698+
},
3699+
{
3700+
"items": {
3701+
"anyOf": [
3702+
{
3703+
"type": "string"
3704+
},
3705+
{
3706+
"type": "object"
3707+
}
3708+
]
36713709
},
3672-
{
3673-
"type": "object"
3674-
}
3675-
]
3676-
},
3710+
"type": "array"
3711+
}
3712+
],
36773713
"markdownDescription": "A list of VPC subnet IDs.\n*Type*: List of String\n*Required*: Yes\n*AWS CloudFormation compatibility*: This property is passed directly to the [`SubnetIds`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-capacityprovider-vpcconfig.html#cfn-lambda-capacityprovider-vpcconfig-subnetids) property of the `AWS::Lambda::CapacityProvider` `VpcConfig` data type.",
3678-
"title": "SubnetIds",
3679-
"type": "array"
3714+
"title": "SubnetIds"
36803715
}
36813716
},
36823717
"required": [

0 commit comments

Comments
 (0)