This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding DynamoDB Resource For Creation
**Why:** * allows you to create a dynamodb table via a CRD **This change addresses the need by:** * closes #6 Signed-off-by: Christopher Hein <me@christopherhein.com>
- Loading branch information
1 parent
3db23a4
commit f79f484
Showing
3 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,14 @@ | ||
apiVersion: operator.aws/v1alpha1 | ||
kind: DynamoDB | ||
metadata: | ||
name: dynamodb-table | ||
spec: | ||
tableName: dynamodb-table | ||
hashAttribute: | ||
name: user_id | ||
type: S | ||
rangeAttribute: | ||
name: created_at | ||
type: S | ||
readCapacityUnits: 5 | ||
writeCapacityUnits: 5 |
This file contains 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,95 @@ | ||
apiVersion: operator.aws/v1alpha1 | ||
kind: ModelDefinition | ||
metadata: | ||
name: DynamoDBResource | ||
spec: | ||
kind: DynamoDB | ||
type: Spec # can be Spec or Data | ||
queue: true | ||
useCloudFormation: true | ||
resource: | ||
name: dynamodb | ||
plural: dynamodbs | ||
shortNames: | ||
- name: ddb | ||
- name: ddbs | ||
- name: dynamo | ||
- name: dynamotable | ||
- name: dynamotables | ||
body: | ||
schema: | ||
title: DynamoDB | ||
type: object | ||
properties: | ||
- key: tableName | ||
type: string | ||
description: | | ||
TableName is the name of the DynamoDB Table to be created. | ||
structKey: TableName | ||
templateKey: TableName | ||
- key: rangeAttribute | ||
type: object | ||
description: | | ||
RangeAttribute is the configuration for the range attribute. | ||
structKey: RangeAttribute | ||
templateKey: RangeAttribute | ||
properties: | ||
- key: Name | ||
type: string | ||
description: | | ||
Name is the name of the range attribute on the table. | ||
structKey: Name | ||
templateKey: RangeAttributeName | ||
- key: Type | ||
type: string | ||
description: | | ||
Type is the kind of range attribute that should be used. | ||
structKey: Type | ||
templateKey: RangeAttributeType | ||
- key: readCapacityUnits | ||
type: int | ||
description: | | ||
ReadCapacityUnits specifies the read capacity of the table. | ||
structKey: ReadCapacityUnits | ||
templateKey: ReadCapacityUnits | ||
- key: writeCapacityUnits | ||
type: int | ||
description: | | ||
WriteCapacityUnits specifies the write capacity of the table. | ||
structKey: WriteCapacityUnits | ||
templateKey: WriteCapacityUnits | ||
- key: hashAttribute | ||
type: object | ||
description: | | ||
HashAttribute is the configuration for the hash attribute on the table. | ||
structKey: HashAttribute | ||
templateKey: HashAttribute | ||
properties: | ||
- key: Name | ||
type: string | ||
description: | | ||
Name is the name of the hashing attribute on the table. | ||
structKey: Name | ||
templateKey: HashAttributeName | ||
- key: Type | ||
type: string | ||
description: | | ||
Type is the kind of hash attribute that should be used. | ||
structKey: Type | ||
templateKey: HashAttributeType | ||
output: | ||
schema: | ||
type: object | ||
properties: | ||
- key: tableName | ||
type: string | ||
description: | | ||
TableName is the output tablename incase it changed | ||
structKey: TableName | ||
templateKey: TableName | ||
- key: tableARN | ||
type: string | ||
description: | | ||
TableARN is the full Amazon ARN for the table created | ||
structKey: TableARN | ||
templateKey: TableArn |
This file contains 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