Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
Adding Support For ResourceName for DynamoDB
Browse files Browse the repository at this point in the history
**Why:**

* Re-runs code generator after uodating the model file.

**This change addresses the need by:**

* closes #52

Signed-off-by: Christopher Hein <me@christopherhein.com>
  • Loading branch information
christopherhein committed Aug 25, 2018
1 parent 79aefff commit 6474c2f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/dynamodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: DynamoDB
metadata:
name: dynamodb-table
spec:
tableName: dynamodb-table
hashAttribute:
name: user_id
type: S
Expand Down
2 changes: 1 addition & 1 deletion models/dynamodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
type: object
properties:
- key: tableName
type: string
type: resourceName
description: |
TableName is the name of the DynamoDB Table to be created.
structKey: TableName
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/dynamodb/cft.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (s *Cloudformation) CreateStack() (output *cloudformation.CreateStackOutput
resourceVersion := helpers.CreateParam("ResourceVersion", s.DynamoDB.ResourceVersion)
namespace := helpers.CreateParam("Namespace", s.DynamoDB.Namespace)
clusterName := helpers.CreateParam("ClusterName", s.config.ClusterName)
tableName := helpers.CreateParam("TableName", helpers.Stringify(s.DynamoDB.Spec.TableName))
tableName := helpers.CreateParam("TableName", helpers.Stringify(s.DynamoDB.Name))
rangeAttributeName := helpers.CreateParam("RangeAttributeName", helpers.Stringify(s.DynamoDB.Spec.RangeAttribute.Name))
rangeAttributeType := helpers.CreateParam("RangeAttributeType", helpers.Stringify(s.DynamoDB.Spec.RangeAttribute.Type))
readCapacityUnits := helpers.CreateParam("ReadCapacityUnits", helpers.Stringify(s.DynamoDB.Spec.ReadCapacityUnits))
Expand Down Expand Up @@ -134,7 +134,7 @@ func (s *Cloudformation) UpdateStack(updated *awsV1alpha1.DynamoDB) (output *clo
resourceVersion := helpers.CreateParam("ResourceVersion", s.DynamoDB.ResourceVersion)
namespace := helpers.CreateParam("Namespace", s.DynamoDB.Namespace)
clusterName := helpers.CreateParam("ClusterName", s.config.ClusterName)
tableName := helpers.CreateParam("TableName", helpers.Stringify(updated.Spec.TableName))
tableName := helpers.CreateParam("TableName", helpers.Stringify(s.DynamoDB.Name))
rangeAttributeName := helpers.CreateParam("RangeAttributeName", helpers.Stringify(updated.Spec.RangeAttribute.Name))
rangeAttributeType := helpers.CreateParam("RangeAttributeType", helpers.Stringify(updated.Spec.RangeAttribute.Type))
readCapacityUnits := helpers.CreateParam("ReadCapacityUnits", helpers.Stringify(updated.Spec.ReadCapacityUnits))
Expand Down

0 comments on commit 6474c2f

Please sign in to comment.