Skip to content

Commit ca9f6c2

Browse files
Ina StoyanovainfraredgirlmarinalimeiraMarina Limeirabwhaley
authored
Feature: DynamoDB Lock (#46)
* Copied from terragrunt v0.6.2 * Moving stuff to another directory * Adding initial code, assuming DynamoDB table exists already * Initial clean up * Add function for playground * Getting package ready for importing * Add logging * Change logging output to Info * Add skeleton for testing * Passing logger as input * Add unit-test skeleton * Asserts that it creates and releases lock * Using Retry library and remove global vars * Remove comments * removing logging, as message is passed to retry logic * Update session creation * rename function with interface * Create DynamoDB table if parameter passed in * Updating dependencies * Update function signatures * Adding releaseLock public interface * Updating AcquireTest to use options * Updating test * use require.NoError instead of assert * using unique IDs for the test * Oops, we want uniqueID only for the string, not the table * Update test to use GetLockStatus * Updating comments * Update lock/lock.go Co-authored-by: Ben Whaley <bwhaley@gmail.com> * Update lock/lock.go Co-authored-by: Ben Whaley <bwhaley@gmail.com> * Update lock/lock.go Co-authored-by: Ben Whaley <bwhaley@gmail.com> * Update lock/lock.go Co-authored-by: Ben Whaley <bwhaley@gmail.com> * Update lock/lock.go Co-authored-by: Ben Whaley <bwhaley@gmail.com> * Update lock/lock.go Co-authored-by: Ben Whaley <bwhaley@gmail.com> * Update lock/lock.go Co-authored-by: Ben Whaley <bwhaley@gmail.com> * Adding comments & sorting the struct declaration * Update lock/lock_test.go Co-authored-by: Ben Whaley <bwhaley@gmail.com> * Addressing PR feedback * Fix some comments * Adding deleting table to cleanup after test * Cleaning up table from test * Fix error message that it tests for * Remove cleanup of dynamodb table * Removing retryRelease * Update lock/lock.go * Apply suggestions from code review Update comments Co-authored-by: Ana Krivokapic <ana@gruntwork.io> Co-authored-by: Marina Limeira <marinaflessa@gmail.com> Co-authored-by: Marina Limeira <marina@gruntwork.io> Co-authored-by: Ben Whaley <bwhaley@gmail.com>
1 parent a3c7d1f commit ca9f6c2

File tree

4 files changed

+582
-34
lines changed

4 files changed

+582
-34
lines changed

go.mod

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,39 @@ module github.com/gruntwork-io/go-commons
33
go 1.13
44

55
require (
6-
github.com/aws/aws-sdk-go v1.38.0 // indirect
6+
github.com/agext/levenshtein v1.2.3 // indirect
7+
github.com/aws/aws-sdk-go v1.38.0
78
github.com/aws/aws-sdk-go-v2 v1.3.3
89
github.com/aws/aws-sdk-go-v2/config v1.1.6
910
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.2.2
1011
github.com/bgentry/speakeasy v0.1.0
1112
github.com/fatih/color v1.9.0
1213
github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0
1314
github.com/go-sql-driver/mysql v1.5.0 // indirect
15+
github.com/go-test/deep v1.0.7 // indirect
16+
github.com/google/go-cmp v0.5.5 // indirect
1417
github.com/gruntwork-io/terratest v0.32.9
18+
github.com/hashicorp/errwrap v1.1.0 // indirect
1519
github.com/hashicorp/go-multierror v1.1.0
20+
github.com/hashicorp/hcl/v2 v2.9.1 // indirect
21+
github.com/kr/pretty v0.2.1 // indirect
1622
github.com/kr/text v0.2.0 // indirect
23+
github.com/kylelemons/godebug v1.1.0 // indirect
24+
github.com/mattn/go-colorable v0.1.7 // indirect
1725
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326
26+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
1827
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
28+
github.com/pquerna/otp v1.2.1-0.20191009055518-468c2dd2b58d // indirect
1929
github.com/sirupsen/logrus v1.6.0
2030
github.com/stretchr/testify v1.6.1
2131
github.com/urfave/cli v1.22.4
32+
github.com/zclconf/go-cty v1.8.1 // indirect
2233
golang.org/x/crypto v0.0.0-20210317152858-513c2a44f670
34+
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect
2335
golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d // indirect
2436
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 // indirect
37+
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
2538
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
39+
gopkg.in/yaml.v2 v2.3.0 // indirect
40+
gopkg.in/yaml.v3 v3.0.0-20210107172259-749611fa9fcc // indirect
2641
)

0 commit comments

Comments
 (0)