-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Copy pathaws_serverless_layerversion.py
72 lines (60 loc) · 2.18 KB
/
aws_serverless_layerversion.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from __future__ import annotations
from typing import Literal, Optional, Union
from samtranslator.internal.schema_source.common import (
BaseModel,
PassThroughProp,
ResourceAttributes,
SamIntrinsicable,
get_prop,
passthrough_prop,
)
PROPERTIES_STEM = "sam-resource-layerversion"
CONTENT_URI_STEM = "sam-property-layerversion-layercontent"
contenturi = get_prop(CONTENT_URI_STEM)
properties = get_prop(PROPERTIES_STEM)
class ContentUri(BaseModel):
Bucket: PassThroughProp = passthrough_prop(
CONTENT_URI_STEM,
"Bucket",
["AWS::Lambda::LayerVersion.Content", "S3Bucket"],
)
Key: PassThroughProp = passthrough_prop(
CONTENT_URI_STEM,
"Key",
["AWS::Lambda::LayerVersion.Content", "S3Key"],
)
Version: PassThroughProp | None = passthrough_prop(
CONTENT_URI_STEM,
"Version",
["AWS::Lambda::LayerVersion.Content", "S3ObjectVersion"],
)
class Properties(BaseModel):
CompatibleArchitectures: PassThroughProp | None = passthrough_prop(
PROPERTIES_STEM,
"CompatibleArchitectures",
["AWS::Lambda::LayerVersion", "Properties", "CompatibleArchitectures"],
)
CompatibleRuntimes: PassThroughProp | None = passthrough_prop(
PROPERTIES_STEM,
"CompatibleRuntimes",
["AWS::Lambda::LayerVersion", "Properties", "CompatibleRuntimes"],
)
PublishLambdaVersion: bool | None # TODO: add docs
ContentUri: str | ContentUri = properties("ContentUri")
Description: PassThroughProp | None = passthrough_prop(
PROPERTIES_STEM,
"Description",
["AWS::Lambda::LayerVersion", "Properties", "Description"],
)
LayerName: PassThroughProp | None = properties("LayerName")
LicenseInfo: PassThroughProp | None = passthrough_prop(
PROPERTIES_STEM,
"LicenseInfo",
["AWS::Lambda::LayerVersion", "Properties", "LicenseInfo"],
)
RetentionPolicy: SamIntrinsicable[str] | None = properties("RetentionPolicy")
class Resource(ResourceAttributes):
Type: Literal["AWS::Serverless::LayerVersion"]
Properties: Properties
class Globals(BaseModel):
PublishLambdaVersion: bool | None # TODO: add docs