-
Notifications
You must be signed in to change notification settings - Fork 11
Add support for snapshot resource to Redshift Serverless. #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# macOS | ||
.DS_Store | ||
._* | ||
*.jar | ||
.hypothesis | ||
example_inputs | ||
|
||
# Maven outputs | ||
.classpath | ||
|
||
# IntelliJ | ||
*.iml | ||
.idea | ||
../.idea/ | ||
out.java | ||
out/ | ||
.settings | ||
.project | ||
|
||
# auto-generated files | ||
target/ | ||
# our logs | ||
rpdk.log* | ||
# contains credentials | ||
sam-tests/ | ||
.pytest_cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"artifact_type": "RESOURCE", | ||
"typeName": "AWS::RedshiftServerless::Snapshot", | ||
"language": "java", | ||
"runtime": "java17", | ||
"entrypoint": "software.amazon.redshiftserverless.snapshot.HandlerWrapper::handleRequest", | ||
"testEntrypoint": "software.amazon.redshiftserverless.snapshot.HandlerWrapper::testEntrypoint", | ||
"settings": { | ||
"version": false, | ||
"subparser_name": null, | ||
"verbose": 0, | ||
"force": false, | ||
"type_name": null, | ||
"artifact_type": null, | ||
"endpoint_url": null, | ||
"region": null, | ||
"target_schemas": [], | ||
"namespace": [ | ||
"software", | ||
"amazon", | ||
"redshiftserverless", | ||
"snapshot" | ||
], | ||
"codegen_template_path": "guided_aws", | ||
"protocolVersion": "2.0.0" | ||
}, | ||
"logProcessorEnabled": "true", | ||
"executableEntrypoint": "software.amazon.redshiftserverless.snapshot.HandlerWrapperExecutable", | ||
"contractSettings": {}, | ||
"canarySettings": {} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# AWS::RedshiftServerless::Snapshot | ||
|
||
Congratulations on starting development! Next steps: | ||
|
||
1. Write the JSON schema describing your resource, `aws-redshiftserverless-snapshot.json` | ||
1. Implement your resource handlers. | ||
|
||
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`. | ||
|
||
> Please don't modify files under `target/generated-sources/rpdk`, as they will be automatically overwritten. | ||
|
||
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. |
203 changes: 203 additions & 0 deletions
203
aws-redshiftserverless-snapshot/aws-redshiftserverless-snapshot.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
{ | ||
"typeName": "AWS::RedshiftServerless::Snapshot", | ||
"description": "Resource Type definition for AWS::RedshiftServerless::Snapshot Resource Type.", | ||
"sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-redshift-serverless", | ||
"definitions": { | ||
"SnapshotStatus": { | ||
"type": "string", | ||
"enum": [ | ||
"AVAILABLE", | ||
"CREATING", | ||
"DELETED", | ||
"CANCELLED", | ||
"FAILED", | ||
"COPYING" | ||
] | ||
}, | ||
"Snapshot": { | ||
"type": "object", | ||
"properties": { | ||
"NamespaceArn": { | ||
"type": "string" | ||
}, | ||
"NamespaceName": { | ||
"type": "string", | ||
"maxLength": 64, | ||
"minLength": 3, | ||
"pattern": "^[a-z0-9-]+$" | ||
}, | ||
"SnapshotName": { | ||
"type": "string", | ||
"maxLength": 64, | ||
"minLength": 3, | ||
"pattern": "^[a-z0-9-]+$" | ||
}, | ||
"SnapshotCreateTime": { | ||
"type": "string" | ||
}, | ||
"Status": { | ||
"$ref": "#/definitions/SnapshotStatus" | ||
}, | ||
"AdminUsername": { | ||
"type": "string" | ||
}, | ||
"KmsKeyId": { | ||
"type": "string" | ||
}, | ||
"OwnerAccount": { | ||
"type": "string" | ||
}, | ||
"RetentionPeriod": { | ||
"type": "integer" | ||
}, | ||
"SnapshotArn": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"Tag": { | ||
"type": "object", | ||
"properties": { | ||
"Key": { | ||
"type": "string", | ||
"maxLength": 128, | ||
"minLength": 1 | ||
}, | ||
"Value": { | ||
"type": "string", | ||
"maxLength": 256, | ||
"minLength": 0 | ||
} | ||
}, | ||
"required": [ | ||
"Key", | ||
"Value" | ||
], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"properties": { | ||
"SnapshotName": { | ||
"description": "The name of the snapshot.", | ||
"type": "string", | ||
"pattern": "^(?=^[a-z0-9-]+$).{3,64}$", | ||
"maxLength": 64, | ||
"minLength": 3 | ||
}, | ||
"NamespaceName": { | ||
"description": "The namespace the snapshot is associated with.", | ||
"type": "string", | ||
"pattern": "^(?=^[a-z0-9-]+$).{3,64}$", | ||
"maxLength": 64, | ||
"minLength": 3 | ||
}, | ||
"OwnerAccount": { | ||
"description": "The owner account of the snapshot.", | ||
"type": "string" | ||
}, | ||
"RetentionPeriod": { | ||
"description": "The retention period of the snapshot.", | ||
"type": "integer" | ||
}, | ||
"Tags": { | ||
"description": "An array of key-value pairs to apply to this resource.", | ||
"type": "array", | ||
"insertionOrder": false, | ||
"items": { | ||
"$ref": "#/definitions/Tag" | ||
}, | ||
"maxItems": 200, | ||
"minItems": 0 | ||
}, | ||
"Snapshot": { | ||
"description": "Definition for snapshot resource", | ||
"$ref": "#/definitions/Snapshot" | ||
} | ||
}, | ||
"tagging": { | ||
"taggable": true, | ||
"tagOnCreate": true, | ||
"tagUpdatable": false, | ||
"cloudFormationSystemTags": false, | ||
"tagProperty": "/properties/Tags", | ||
"permissions": [ | ||
"redshift-serverless:ListTagsForResource", | ||
"redshift-serverless:TagResource", | ||
"redshift-serverless:UntagResource" | ||
] | ||
}, | ||
"required": [ | ||
"SnapshotName" | ||
], | ||
"createOnlyProperties": [ | ||
"/properties/NamespaceName", | ||
"/properties/SnapshotName", | ||
"/properties/Tags", | ||
"/properties/Tags/*/Key", | ||
"/properties/Tags/*/Value" | ||
], | ||
"readOnlyProperties": [ | ||
"/properties/Snapshot", | ||
"/properties/OwnerAccount", | ||
"/properties/Snapshot/SnapshotName", | ||
"/properties/Snapshot/NamespaceName", | ||
"/properties/Snapshot/NamespaceArn", | ||
"/properties/Snapshot/SnapshotArn", | ||
"/properties/Snapshot/SnapshotCreateTime", | ||
"/properties/Snapshot/Status", | ||
"/properties/Snapshot/AdminUsername", | ||
"/properties/Snapshot/KmsKeyId", | ||
"/properties/Snapshot/OwnerAccount", | ||
"/properties/Snapshot/RetentionPeriod" | ||
], | ||
"primaryIdentifier": [ | ||
"/properties/SnapshotName" | ||
], | ||
"handlers": { | ||
"create": { | ||
"permissions": [ | ||
"redshift-serverless:CreateSnapshot", | ||
"redshift-serverless:GetSnapshot", | ||
"redshift-serverless:ListTagsForResource", | ||
"redshift-serverless:TagResource", | ||
"redshift-serverless:GetNamespace" | ||
] | ||
}, | ||
"read": { | ||
"permissions": [ | ||
"redshift-serverless:GetSnapshot", | ||
"redshift-serverless:ListTagsForResource", | ||
"redshift-serverless:GetNamespace" | ||
] | ||
}, | ||
"update": { | ||
"permissions": [ | ||
"redshift-serverless:UpdateSnapshot", | ||
"redshift-serverless:GetSnapshot", | ||
"redshift-serverless:ListTagsForResource", | ||
"redshift-serverless:TagResource", | ||
"redshift-serverless:UntagResource", | ||
"redshift-serverless:GetNamespace" | ||
] | ||
}, | ||
"delete": { | ||
"permissions": [ | ||
"redshift-serverless:DeleteSnapshot", | ||
"redshift-serverless:GetSnapshot", | ||
"redshift-serverless:ListTagsForResource", | ||
"redshift-serverless:UntagResource", | ||
"redshift-serverless:GetNamespace" | ||
] | ||
}, | ||
"list": { | ||
"permissions": [ | ||
"redshift-serverless:ListSnapshots", | ||
"redshift-serverless:GetSnapshot", | ||
"redshift-serverless:ListTagsForResource", | ||
"redshift-serverless:GetNamespace" | ||
] | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.