Skip to content

Commit a43321f

Browse files
Merge branch 'develop' into dependabot/npm_and_yarn/develop/aws-cdk-2.1026.0
2 parents 926f750 + fac37b6 commit a43321f

File tree

5 files changed

+175
-55
lines changed

5 files changed

+175
-55
lines changed

CHANGELOG.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
## Code Refactoring
88

9+
* **parser:** Improve VPC Lattice with examples and descriptions ([#7234](https://github.com/aws-powertools/powertools-lambda-python/issues/7234))
910
* **parser:** Improve DynamoDB models with examples and descriptions ([#7146](https://github.com/aws-powertools/powertools-lambda-python/issues/7146))
1011

1112
## Documentation
@@ -22,45 +23,46 @@
2223
## Maintenance
2324

2425
* **automation:** update PR template to include closes command ([#7173](https://github.com/aws-powertools/powertools-lambda-python/issues/7173))
25-
* **ci:** new pre-release 3.19.1a1 ([#7172](https://github.com/aws-powertools/powertools-lambda-python/issues/7172))
26-
* **ci:** new pre-release 3.19.1a5 ([#7226](https://github.com/aws-powertools/powertools-lambda-python/issues/7226))
27-
* **ci:** new pre-release 3.19.1a2 ([#7192](https://github.com/aws-powertools/powertools-lambda-python/issues/7192))
26+
* **ci:** new pre-release 3.19.1a3 ([#7207](https://github.com/aws-powertools/powertools-lambda-python/issues/7207))
2827
* **ci:** new pre-release 3.19.1a6 ([#7232](https://github.com/aws-powertools/powertools-lambda-python/issues/7232))
28+
* **ci:** new pre-release 3.19.1a5 ([#7226](https://github.com/aws-powertools/powertools-lambda-python/issues/7226))
2929
* **ci:** new pre-release 3.19.1a0 ([#7161](https://github.com/aws-powertools/powertools-lambda-python/issues/7161))
30+
* **ci:** new pre-release 3.19.1a2 ([#7192](https://github.com/aws-powertools/powertools-lambda-python/issues/7192))
3031
* **ci:** new pre-release 3.19.1a4 ([#7217](https://github.com/aws-powertools/powertools-lambda-python/issues/7217))
31-
* **ci:** new pre-release 3.19.1a3 ([#7207](https://github.com/aws-powertools/powertools-lambda-python/issues/7207))
32-
* **deps:** bump squidfunk/mkdocs-material from `bb7b015` to `405aeb6` in /docs ([#7185](https://github.com/aws-powertools/powertools-lambda-python/issues/7185))
32+
* **ci:** new pre-release 3.19.1a1 ([#7172](https://github.com/aws-powertools/powertools-lambda-python/issues/7172))
3333
* **deps:** bump mkdocs-material from 9.6.16 to 9.6.17 ([#7188](https://github.com/aws-powertools/powertools-lambda-python/issues/7188))
34-
* **deps:** bump actions/dependency-review-action from 4.7.1 to 4.7.2 ([#7203](https://github.com/aws-powertools/powertools-lambda-python/issues/7203))
35-
* **deps:** bump mkdocstrings-python from 1.16.12 to 1.17.0 ([#7206](https://github.com/aws-powertools/powertools-lambda-python/issues/7206))
36-
* **deps:** bump protobuf from 6.31.1 to 6.32.0 ([#7208](https://github.com/aws-powertools/powertools-lambda-python/issues/7208))
37-
* **deps:** bump aws-actions/configure-aws-credentials from 209f2a4450bb4b277e1dedaff40ad2fd8d4d0a4c to 3821430d177f66b128b701e38ba67c5319b1b0bd ([#7202](https://github.com/aws-powertools/powertools-lambda-python/issues/7202))
3834
* **deps:** bump aws-actions/configure-aws-credentials from 3821430d177f66b128b701e38ba67c5319b1b0bd to 09a74e37ceda446282c61f1496cdca8d8dca0e57 ([#7213](https://github.com/aws-powertools/powertools-lambda-python/issues/7213))
3935
* **deps:** bump mkdocs-material from 9.6.16 to 9.6.17 ([#7216](https://github.com/aws-powertools/powertools-lambda-python/issues/7216))
36+
* **deps:** bump actions/dependency-review-action from 4.7.1 to 4.7.2 ([#7203](https://github.com/aws-powertools/powertools-lambda-python/issues/7203))
37+
* **deps:** bump mkdocstrings-python from 1.16.12 to 1.17.0 ([#7206](https://github.com/aws-powertools/powertools-lambda-python/issues/7206))
4038
* **deps:** bump aws-actions/configure-aws-credentials from 09a74e37ceda446282c61f1496cdca8d8dca0e57 to 0eb446ecb2e3f0e1a19f106e12e76c6a98b6bdb2 ([#7222](https://github.com/aws-powertools/powertools-lambda-python/issues/7222))
39+
* **deps:** bump aws-actions/configure-aws-credentials from 209f2a4450bb4b277e1dedaff40ad2fd8d4d0a4c to 3821430d177f66b128b701e38ba67c5319b1b0bd ([#7202](https://github.com/aws-powertools/powertools-lambda-python/issues/7202))
4140
* **deps:** bump aws-actions/configure-aws-credentials from aa1f74b81b53cb3adb28afcdb21d7b9f3fceea98 to 209f2a4450bb4b277e1dedaff40ad2fd8d4d0a4c ([#7160](https://github.com/aws-powertools/powertools-lambda-python/issues/7160))
41+
* **deps:** bump aws-powertools/actions from 1.4.0 to 1.5.0 ([#7180](https://github.com/aws-powertools/powertools-lambda-python/issues/7180))
42+
* **deps:** bump squidfunk/mkdocs-material from `bb7b015` to `405aeb6` in /docs ([#7185](https://github.com/aws-powertools/powertools-lambda-python/issues/7185))
43+
* **deps:** bump codecov/codecov-action from 5.4.3 to 5.5.0 ([#7221](https://github.com/aws-powertools/powertools-lambda-python/issues/7221))
4244
* **deps:** bump fastjsonschema from 2.21.1 to 2.21.2 ([#7179](https://github.com/aws-powertools/powertools-lambda-python/issues/7179))
4345
* **deps:** bump mkdocstrings-python from 1.16.12 to 1.17.0 in /docs ([#7187](https://github.com/aws-powertools/powertools-lambda-python/issues/7187))
44-
* **deps:** bump codecov/codecov-action from 5.4.3 to 5.5.0 ([#7221](https://github.com/aws-powertools/powertools-lambda-python/issues/7221))
45-
* **deps:** bump aws-powertools/actions from 1.4.0 to 1.5.0 ([#7180](https://github.com/aws-powertools/powertools-lambda-python/issues/7180))
46-
* **deps-dev:** bump coverage from 7.10.3 to 7.10.4 ([#7205](https://github.com/aws-powertools/powertools-lambda-python/issues/7205))
46+
* **deps:** bump protobuf from 6.31.1 to 6.32.0 ([#7208](https://github.com/aws-powertools/powertools-lambda-python/issues/7208))
47+
* **deps:** bump mkdocs-material from 9.6.17 to 9.6.18 in /docs ([#7235](https://github.com/aws-powertools/powertools-lambda-python/issues/7235))
48+
* **deps-dev:** bump cfn-lint from 1.38.3 to 1.39.0 ([#7212](https://github.com/aws-powertools/powertools-lambda-python/issues/7212))
4749
* **deps-dev:** bump filelock from 3.18.0 to 3.19.1 ([#7177](https://github.com/aws-powertools/powertools-lambda-python/issues/7177))
48-
* **deps-dev:** bump sentry-sdk from 2.34.1 to 2.35.0 ([#7181](https://github.com/aws-powertools/powertools-lambda-python/issues/7181))
50+
* **deps-dev:** bump boto3-stubs from 1.40.11 to 1.40.12 ([#7204](https://github.com/aws-powertools/powertools-lambda-python/issues/7204))
4951
* **deps-dev:** bump ruff from 0.12.8 to 0.12.9 ([#7182](https://github.com/aws-powertools/powertools-lambda-python/issues/7182))
50-
* **deps-dev:** bump boto3-stubs from 1.40.9 to 1.40.11 ([#7189](https://github.com/aws-powertools/powertools-lambda-python/issues/7189))
52+
* **deps-dev:** bump coverage from 7.10.3 to 7.10.4 ([#7205](https://github.com/aws-powertools/powertools-lambda-python/issues/7205))
5153
* **deps-dev:** bump aws-cdk-aws-lambda-python-alpha from 2.210.0a0 to 2.211.0a0 ([#7168](https://github.com/aws-powertools/powertools-lambda-python/issues/7168))
5254
* **deps-dev:** bump cfn-lint from 1.38.2 to 1.38.3 ([#7169](https://github.com/aws-powertools/powertools-lambda-python/issues/7169))
5355
* **deps-dev:** bump aws-cdk from 2.1024.0 to 2.1025.0 ([#7167](https://github.com/aws-powertools/powertools-lambda-python/issues/7167))
54-
* **deps-dev:** bump boto3-stubs from 1.40.11 to 1.40.12 ([#7204](https://github.com/aws-powertools/powertools-lambda-python/issues/7204))
55-
* **deps-dev:** bump cfn-lint from 1.38.3 to 1.39.0 ([#7212](https://github.com/aws-powertools/powertools-lambda-python/issues/7212))
56-
* **deps-dev:** bump boto3-stubs from 1.40.8 to 1.40.9 ([#7170](https://github.com/aws-powertools/powertools-lambda-python/issues/7170))
56+
* **deps-dev:** bump boto3-stubs from 1.40.9 to 1.40.11 ([#7189](https://github.com/aws-powertools/powertools-lambda-python/issues/7189))
5757
* **deps-dev:** bump requests from 2.32.4 to 2.32.5 ([#7215](https://github.com/aws-powertools/powertools-lambda-python/issues/7215))
58+
* **deps-dev:** bump boto3-stubs from 1.40.8 to 1.40.9 ([#7170](https://github.com/aws-powertools/powertools-lambda-python/issues/7170))
5859
* **deps-dev:** bump boto3-stubs from 1.40.12 to 1.40.13 ([#7214](https://github.com/aws-powertools/powertools-lambda-python/issues/7214))
59-
* **deps-dev:** bump boto3-stubs from 1.40.7 to 1.40.8 ([#7159](https://github.com/aws-powertools/powertools-lambda-python/issues/7159))
6060
* **deps-dev:** bump aws-cdk-aws-lambda-python-alpha from 2.211.0a0 to 2.212.0a0 ([#7223](https://github.com/aws-powertools/powertools-lambda-python/issues/7223))
61+
* **deps-dev:** bump boto3-stubs from 1.40.7 to 1.40.8 ([#7159](https://github.com/aws-powertools/powertools-lambda-python/issues/7159))
62+
* **deps-dev:** bump boto3-stubs from 1.40.13 to 1.40.14 ([#7224](https://github.com/aws-powertools/powertools-lambda-python/issues/7224))
6163
* **deps-dev:** bump boto3-stubs from 1.40.14 to 1.40.15 ([#7230](https://github.com/aws-powertools/powertools-lambda-python/issues/7230))
6264
* **deps-dev:** bump ruff from 0.12.9 to 0.12.10 ([#7231](https://github.com/aws-powertools/powertools-lambda-python/issues/7231))
63-
* **deps-dev:** bump boto3-stubs from 1.40.13 to 1.40.14 ([#7224](https://github.com/aws-powertools/powertools-lambda-python/issues/7224))
65+
* **deps-dev:** bump sentry-sdk from 2.34.1 to 2.35.0 ([#7181](https://github.com/aws-powertools/powertools-lambda-python/issues/7181))
6466

6567

6668
<a name="v3.19.0"></a>
Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
from typing import Dict, Type, Union
22

3-
from pydantic import BaseModel
3+
from pydantic import BaseModel, Field
44

55

66
class VpcLatticeModel(BaseModel):
7-
method: str
8-
raw_path: str
9-
body: Union[str, Type[BaseModel]]
10-
is_base64_encoded: bool
11-
headers: Dict[str, str]
12-
query_string_parameters: Dict[str, str]
7+
method: str = Field(
8+
description="The HTTP method used for the request.",
9+
examples=["GET", "POST", "PUT", "DELETE", "PATCH"],
10+
)
11+
raw_path: str = Field(
12+
description="The raw path portion of the request URL.",
13+
examples=["/testpath", "/api/v1/users", "/health"],
14+
)
15+
body: Union[str, Type[BaseModel]] = Field(
16+
description="The request body. Can be a string or a parsed model if content-type allows parsing.",
17+
)
18+
is_base64_encoded: bool = Field(description="Indicates whether the body is base64-encoded.", examples=[True, False])
19+
headers: Dict[str, str] = Field(
20+
description="The request headers as key-value pairs.",
21+
examples=[
22+
{"host": "test-lambda-service.vpc-lattice-svcs.us-east-2.on.aws", "user-agent": "curl/7.64.1"},
23+
{"content-type": "application/json"},
24+
],
25+
)
26+
query_string_parameters: Dict[str, str] = Field(
27+
description="The query string parameters as key-value pairs.",
28+
examples=[{"order-id": "1"}, {"page": "2", "limit": "10"}],
29+
)

aws_lambda_powertools/utilities/parser/models/vpc_latticev2.py

Lines changed: 126 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,139 @@
55

66

77
class VpcLatticeV2RequestContextIdentity(BaseModel):
8-
source_vpc_arn: Optional[str] = Field(None, alias="sourceVpcArn")
9-
get_type: Optional[str] = Field(None, alias="type")
10-
principal: Optional[str] = Field(None, alias="principal")
11-
principal_org_id: Optional[str] = Field(None, alias="principalOrgID")
12-
session_name: Optional[str] = Field(None, alias="sessionName")
13-
x509_subject_cn: Optional[str] = Field(None, alias="X509SubjectCn")
14-
x509_issuer_ou: Optional[str] = Field(None, alias="X509IssuerOu")
15-
x509_san_dns: Optional[str] = Field(None, alias="x509SanDns")
16-
x509_san_uri: Optional[str] = Field(None, alias="X509SanUri")
17-
x509_san_name_cn: Optional[str] = Field(None, alias="X509SanNameCn")
8+
source_vpc_arn: Optional[str] = Field(
9+
None,
10+
alias="sourceVpcArn",
11+
description="The ARN of the VPC from which the request originated.",
12+
examples=["arn:aws:ec2:us-east-2:123456789012:vpc/vpc-0b8276c84697e7339"],
13+
)
14+
get_type: Optional[str] = Field(
15+
None,
16+
alias="type",
17+
description="The type of identity making the request.",
18+
examples=["AWS_IAM", "NONE"],
19+
)
20+
principal: Optional[str] = Field(
21+
None,
22+
alias="principal",
23+
description="The principal ARN of the identity making the request.",
24+
examples=["arn:aws:sts::123456789012:assumed-role/example-role/057d00f8b51257ba3c853a0f248943cf"],
25+
)
26+
principal_org_id: Optional[str] = Field(
27+
None,
28+
alias="principalOrgID",
29+
description="The AWS organization ID of the principal.",
30+
examples=["o-1234567890"],
31+
)
32+
session_name: Optional[str] = Field(
33+
None,
34+
alias="sessionName",
35+
description="The session name for assumed role sessions.",
36+
examples=["057d00f8b51257ba3c853a0f248943cf"],
37+
)
38+
x509_subject_cn: Optional[str] = Field(
39+
None,
40+
alias="X509SubjectCn",
41+
description="The X.509 certificate subject common name.",
42+
examples=["example.com"],
43+
)
44+
x509_issuer_ou: Optional[str] = Field(
45+
None,
46+
alias="X509IssuerOu",
47+
description="The X.509 certificate issuer organizational unit.",
48+
examples=["IT Department"],
49+
)
50+
x509_san_dns: Optional[str] = Field(
51+
None,
52+
alias="x509SanDns",
53+
description="The X.509 certificate Subject Alternative Name DNS entry.",
54+
examples=["example.com"],
55+
)
56+
x509_san_uri: Optional[str] = Field(
57+
None,
58+
alias="X509SanUri",
59+
description="The X.509 certificate Subject Alternative Name URI entry.",
60+
examples=["https://example.com"],
61+
)
62+
x509_san_name_cn: Optional[str] = Field(
63+
None,
64+
alias="X509SanNameCn",
65+
description="The X.509 certificate Subject Alternative Name common name.",
66+
examples=["example.com"],
67+
)
1868

1969

2070
class VpcLatticeV2RequestContext(BaseModel):
21-
service_network_arn: str = Field(alias="serviceNetworkArn")
22-
service_arn: str = Field(alias="serviceArn")
23-
target_group_arn: str = Field(alias="targetGroupArn")
24-
identity: VpcLatticeV2RequestContextIdentity
25-
region: str
26-
time_epoch: float = Field(alias="timeEpoch")
27-
time_epoch_as_datetime: datetime = Field(alias="timeEpoch")
71+
service_network_arn: str = Field(
72+
alias="serviceNetworkArn",
73+
description="The ARN of the VPC Lattice service network.",
74+
examples=["arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-0bf3f2882e9cc805a"],
75+
)
76+
service_arn: str = Field(
77+
alias="serviceArn",
78+
description="The ARN of the VPC Lattice service that processed the request.",
79+
examples=["arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0a40eebed65f8d69c"],
80+
)
81+
target_group_arn: str = Field(
82+
alias="targetGroupArn",
83+
description="The ARN of the target group that received the request.",
84+
examples=["arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-6d0ecf831eec9f09"],
85+
)
86+
identity: VpcLatticeV2RequestContextIdentity = Field(description="Identity information about the requester.")
87+
region: str = Field(
88+
description="The AWS region where the request was processed.",
89+
examples=["us-east-2", "us-west-1", "eu-west-1"],
90+
)
91+
time_epoch: float = Field(
92+
alias="timeEpoch",
93+
description="The request timestamp in epoch microseconds.",
94+
examples=[1696331543569073],
95+
)
96+
time_epoch_as_datetime: datetime = Field(
97+
alias="timeEpoch",
98+
description="The request timestamp converted to datetime.",
99+
)
28100

29101
@field_validator("time_epoch_as_datetime", mode="before")
30102
def time_epoch_convert_to_miliseconds(cls, value: int):
31103
return round(int(value) / 1000)
32104

33105

34106
class VpcLatticeV2Model(BaseModel):
35-
version: str
36-
path: str
37-
method: str
38-
headers: Dict[str, str]
39-
query_string_parameters: Optional[Dict[str, str]] = Field(None, alias="queryStringParameters")
40-
body: Optional[Union[str, Type[BaseModel]]] = None
41-
is_base64_encoded: Optional[bool] = Field(None, alias="isBase64Encoded")
42-
request_context: VpcLatticeV2RequestContext = Field(..., alias="requestContext")
107+
version: str = Field(description="The version of the VPC Lattice event format.", examples=["2.0"])
108+
path: str = Field(
109+
description="The path portion of the request URL.",
110+
examples=["/newpath", "/api/v1/users", "/health"],
111+
)
112+
method: str = Field(
113+
description="The HTTP method used for the request.",
114+
examples=["GET", "POST", "PUT", "DELETE", "PATCH"],
115+
)
116+
headers: Dict[str, str] = Field(
117+
description="The request headers as key-value pairs.",
118+
examples=[
119+
{"host": "test-lambda-service.vpc-lattice-svcs.us-east-2.on.aws", "user-agent": "curl/7.64.1"},
120+
{"content-type": "application/json"},
121+
],
122+
)
123+
query_string_parameters: Optional[Dict[str, str]] = Field(
124+
None,
125+
alias="queryStringParameters",
126+
description="The query string parameters as key-value pairs.",
127+
examples=[{"order-id": "1"}, {"page": "2", "limit": "10"}],
128+
)
129+
body: Optional[Union[str, Type[BaseModel]]] = Field(
130+
None,
131+
description="The request body. Can be a string or a parsed model if content-type allows parsing.",
132+
)
133+
is_base64_encoded: Optional[bool] = Field(
134+
None,
135+
alias="isBase64Encoded",
136+
description="Indicates whether the body is base64-encoded.",
137+
examples=[False, True],
138+
)
139+
request_context: VpcLatticeV2RequestContext = Field(
140+
...,
141+
alias="requestContext",
142+
description="Contains information about the request context, including VPC Lattice service details.",
143+
)

docs/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
mkdocs-git-revision-date-plugin==0.3.2
22
mkdocstrings-python==1.17.0
33
mkdocs-llmstxt==0.3.1
4-
mkdocs-material==9.6.17
4+
mkdocs-material==9.6.18

docs/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ mkdocs-llmstxt==0.3.1 \
290290
--hash=sha256:123119d9b984c1d1224ed5af250bfbc49879ad83decdaff59d8b0ebb459ddc54 \
291291
--hash=sha256:31f5b6aaae6123c09a2b1c32912c3eb21ccb356b5db7abb867f105e8cc392653
292292
# via -r requirements.in
293-
mkdocs-material==9.6.17 \
294-
--hash=sha256:221dd8b37a63f52e580bcab4a7e0290e4a6f59bd66190be9c3d40767e05f9417 \
295-
--hash=sha256:48ae7aec72a3f9f501a70be3fbd329c96ff5f5a385b67a1563e5ed5ce064affe
293+
mkdocs-material==9.6.18 \
294+
--hash=sha256:a2eb253bcc8b66f8c6eaf8379c10ed6e9644090c2e2e9d0971c7722dc7211c05 \
295+
--hash=sha256:dbc1e146a0ecce951a4d84f97b816a54936cdc9e1edd1667fc6868878ac06701
296296
# via -r requirements.in
297297
mkdocs-material-extensions==1.3.1 \
298298
--hash=sha256:10c9511cea88f568257f960358a467d12b970e1f7b2c0e5fb2bb48cab1928443 \

0 commit comments

Comments
 (0)