Skip to content

Commit ab5cb72

Browse files
AkarshDAkarsh Dang
and
Akarsh Dang
authored
Add support for snapshot resource to Redshift Serverless. (#75)
* Add support for snapshot resource to Redshift Serverless. Co-authored-by: Akarsh Dang <[email protected]>
1 parent 93651ea commit ab5cb72

29 files changed

+2584
-0
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# macOS
2+
.DS_Store
3+
._*
4+
*.jar
5+
.hypothesis
6+
example_inputs
7+
8+
# Maven outputs
9+
.classpath
10+
11+
# IntelliJ
12+
*.iml
13+
.idea
14+
../.idea/
15+
out.java
16+
out/
17+
.settings
18+
.project
19+
20+
# auto-generated files
21+
target/
22+
# our logs
23+
rpdk.log*
24+
# contains credentials
25+
sam-tests/
26+
.pytest_cache
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"artifact_type": "RESOURCE",
3+
"typeName": "AWS::RedshiftServerless::Snapshot",
4+
"language": "java",
5+
"runtime": "java17",
6+
"entrypoint": "software.amazon.redshiftserverless.snapshot.HandlerWrapper::handleRequest",
7+
"testEntrypoint": "software.amazon.redshiftserverless.snapshot.HandlerWrapper::testEntrypoint",
8+
"settings": {
9+
"version": false,
10+
"subparser_name": null,
11+
"verbose": 0,
12+
"force": false,
13+
"type_name": null,
14+
"artifact_type": null,
15+
"endpoint_url": null,
16+
"region": null,
17+
"target_schemas": [],
18+
"namespace": [
19+
"software",
20+
"amazon",
21+
"redshiftserverless",
22+
"snapshot"
23+
],
24+
"codegen_template_path": "guided_aws",
25+
"protocolVersion": "2.0.0"
26+
},
27+
"logProcessorEnabled": "true",
28+
"executableEntrypoint": "software.amazon.redshiftserverless.snapshot.HandlerWrapperExecutable",
29+
"contractSettings": {},
30+
"canarySettings": {}
31+
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# AWS::RedshiftServerless::Snapshot
2+
3+
Congratulations on starting development! Next steps:
4+
5+
1. Write the JSON schema describing your resource, `aws-redshiftserverless-snapshot.json`
6+
1. Implement your resource handlers.
7+
8+
The RPDK will automatically generate the correct resource model from the schema whenever the project is built via Maven. You can also do this manually with the following command: `cfn generate`.
9+
10+
> Please don't modify files under `target/generated-sources/rpdk`, as they will be automatically overwritten.
11+
12+
The code uses [Lombok](https://projectlombok.org/), and [you may have to install IDE integrations](https://projectlombok.org/setup/overview) to enable auto-complete for Lombok-annotated classes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
{
2+
"typeName": "AWS::RedshiftServerless::Snapshot",
3+
"description": "Resource Type definition for AWS::RedshiftServerless::Snapshot Resource Type.",
4+
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-redshift-serverless",
5+
"definitions": {
6+
"SnapshotStatus": {
7+
"type": "string",
8+
"enum": [
9+
"AVAILABLE",
10+
"CREATING",
11+
"DELETED",
12+
"CANCELLED",
13+
"FAILED",
14+
"COPYING"
15+
]
16+
},
17+
"Snapshot": {
18+
"type": "object",
19+
"properties": {
20+
"NamespaceArn": {
21+
"type": "string"
22+
},
23+
"NamespaceName": {
24+
"type": "string",
25+
"maxLength": 64,
26+
"minLength": 3,
27+
"pattern": "^[a-z0-9-]+$"
28+
},
29+
"SnapshotName": {
30+
"type": "string",
31+
"maxLength": 64,
32+
"minLength": 3,
33+
"pattern": "^[a-z0-9-]+$"
34+
},
35+
"SnapshotCreateTime": {
36+
"type": "string"
37+
},
38+
"Status": {
39+
"$ref": "#/definitions/SnapshotStatus"
40+
},
41+
"AdminUsername": {
42+
"type": "string"
43+
},
44+
"KmsKeyId": {
45+
"type": "string"
46+
},
47+
"OwnerAccount": {
48+
"type": "string"
49+
},
50+
"RetentionPeriod": {
51+
"type": "integer"
52+
},
53+
"SnapshotArn": {
54+
"type": "string"
55+
}
56+
},
57+
"additionalProperties": false
58+
},
59+
"Tag": {
60+
"type": "object",
61+
"properties": {
62+
"Key": {
63+
"type": "string",
64+
"maxLength": 128,
65+
"minLength": 1
66+
},
67+
"Value": {
68+
"type": "string",
69+
"maxLength": 256,
70+
"minLength": 0
71+
}
72+
},
73+
"required": [
74+
"Key",
75+
"Value"
76+
],
77+
"additionalProperties": false
78+
}
79+
},
80+
"properties": {
81+
"SnapshotName": {
82+
"description": "The name of the snapshot.",
83+
"type": "string",
84+
"pattern": "^(?=^[a-z0-9-]+$).{3,64}$",
85+
"maxLength": 64,
86+
"minLength": 3
87+
},
88+
"NamespaceName": {
89+
"description": "The namespace the snapshot is associated with.",
90+
"type": "string",
91+
"pattern": "^(?=^[a-z0-9-]+$).{3,64}$",
92+
"maxLength": 64,
93+
"minLength": 3
94+
},
95+
"OwnerAccount": {
96+
"description": "The owner account of the snapshot.",
97+
"type": "string"
98+
},
99+
"RetentionPeriod": {
100+
"description": "The retention period of the snapshot.",
101+
"type": "integer"
102+
},
103+
"Tags": {
104+
"description": "An array of key-value pairs to apply to this resource.",
105+
"type": "array",
106+
"insertionOrder": false,
107+
"items": {
108+
"$ref": "#/definitions/Tag"
109+
},
110+
"maxItems": 200,
111+
"minItems": 0
112+
},
113+
"Snapshot": {
114+
"description": "Definition for snapshot resource",
115+
"$ref": "#/definitions/Snapshot"
116+
}
117+
},
118+
"tagging": {
119+
"taggable": true,
120+
"tagOnCreate": true,
121+
"tagUpdatable": false,
122+
"cloudFormationSystemTags": false,
123+
"tagProperty": "/properties/Tags",
124+
"permissions": [
125+
"redshift-serverless:ListTagsForResource",
126+
"redshift-serverless:TagResource",
127+
"redshift-serverless:UntagResource"
128+
]
129+
},
130+
"required": [
131+
"SnapshotName"
132+
],
133+
"createOnlyProperties": [
134+
"/properties/NamespaceName",
135+
"/properties/SnapshotName",
136+
"/properties/Tags",
137+
"/properties/Tags/*/Key",
138+
"/properties/Tags/*/Value"
139+
],
140+
"readOnlyProperties": [
141+
"/properties/Snapshot",
142+
"/properties/OwnerAccount",
143+
"/properties/Snapshot/SnapshotName",
144+
"/properties/Snapshot/NamespaceName",
145+
"/properties/Snapshot/NamespaceArn",
146+
"/properties/Snapshot/SnapshotArn",
147+
"/properties/Snapshot/SnapshotCreateTime",
148+
"/properties/Snapshot/Status",
149+
"/properties/Snapshot/AdminUsername",
150+
"/properties/Snapshot/KmsKeyId",
151+
"/properties/Snapshot/OwnerAccount",
152+
"/properties/Snapshot/RetentionPeriod"
153+
],
154+
"primaryIdentifier": [
155+
"/properties/SnapshotName"
156+
],
157+
"handlers": {
158+
"create": {
159+
"permissions": [
160+
"redshift-serverless:CreateSnapshot",
161+
"redshift-serverless:GetSnapshot",
162+
"redshift-serverless:ListTagsForResource",
163+
"redshift-serverless:TagResource",
164+
"redshift-serverless:GetNamespace"
165+
]
166+
},
167+
"read": {
168+
"permissions": [
169+
"redshift-serverless:GetSnapshot",
170+
"redshift-serverless:ListTagsForResource",
171+
"redshift-serverless:GetNamespace"
172+
]
173+
},
174+
"update": {
175+
"permissions": [
176+
"redshift-serverless:UpdateSnapshot",
177+
"redshift-serverless:GetSnapshot",
178+
"redshift-serverless:ListTagsForResource",
179+
"redshift-serverless:TagResource",
180+
"redshift-serverless:UntagResource",
181+
"redshift-serverless:GetNamespace"
182+
]
183+
},
184+
"delete": {
185+
"permissions": [
186+
"redshift-serverless:DeleteSnapshot",
187+
"redshift-serverless:GetSnapshot",
188+
"redshift-serverless:ListTagsForResource",
189+
"redshift-serverless:UntagResource",
190+
"redshift-serverless:GetNamespace"
191+
]
192+
},
193+
"list": {
194+
"permissions": [
195+
"redshift-serverless:ListSnapshots",
196+
"redshift-serverless:GetSnapshot",
197+
"redshift-serverless:ListTagsForResource",
198+
"redshift-serverless:GetNamespace"
199+
]
200+
}
201+
},
202+
"additionalProperties": false
203+
}

0 commit comments

Comments
 (0)