Skip to content

Commit

Permalink
Merge Sam stack: add LSI to table resource
Browse files Browse the repository at this point in the history
  • Loading branch information
redaLaanait committed Jun 14, 2022
2 parents d8a16ec + e0d1430 commit 4743f46
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
4 changes: 2 additions & 2 deletions stack/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/aws/aws-lambda-go v1.32.0
github.com/aws/aws-sdk-go-v2/config v1.15.8
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.15.6
github.com/ln80/pii v0.1.0
github.com/ln80/pii v0.2.1
)

require (
Expand All @@ -30,4 +30,4 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
)

replace github.com/ln80/pii v0.1.0 => ../
// replace github.com/ln80/pii v0.2.1 => ../
2 changes: 2 additions & 0 deletions stack/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/ln80/pii v0.2.1 h1:io01PjUe+De74LJKFjJsMgM21M75PnP3nqvcj/xKwx0=
github.com/ln80/pii v0.2.1/go.mod h1:oVYcZPGzlWesssVuiFbN/ITd68PqE2VaJUketho7C10=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
5 changes: 4 additions & 1 deletion stack/integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ func TestIntegration(t *testing.T) {
ec.GracePeriod = gracePeriod
})

nspace := "tnt-" + strconv.FormatInt(time.Now().Unix(), 10)
t.Logf("integ test namespace: %s", nspace)

testutil.KeyEngineTestSuite(t, ctx, engine, func(keto *testutil.KeyEngineTestOption) {
keto.Namespace = "tnt-54R"
keto.Namespace = nspace

keto.GracePeriod = gracePeriod

Expand Down
20 changes: 19 additions & 1 deletion stack/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Metadata:
ReadmeUrl: ../README.md
Labels: ['go', 'pii', 'gdpr', 'crypto-shredding', 'dynamodb']
HomePageUrl: https://github.com/ln80/pii
SemanticVersion: 0.0.1
SemanticVersion: 0.0.2
SourceCodeUrl: https://github.com/ln80/pii

Parameters:
Expand Down Expand Up @@ -78,13 +78,31 @@ Resources:
-
AttributeName: _sk
AttributeType: S
-
AttributeName: _lsik
AttributeType: S
KeySchema:
-
AttributeName: _pk
KeyType: HASH
-
AttributeName: _sk
KeyType: RANGE
LocalSecondaryIndexes:
-
IndexName: _lsi
KeySchema:
-
AttributeName: _pk
KeyType: HASH
-
AttributeName: _lsik
KeyType: RANGE
Projection:
ProjectionType: 'INCLUDE'
NonKeyAttributes:
- _key
- _kid
BillingMode: !Ref DynamoDBBillingMode
ProvisionedThroughput:
ReadCapacityUnits: !Ref DynamoDBReadCapacity
Expand Down

0 comments on commit 4743f46

Please sign in to comment.