-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add region config * support yaml and yml configs * configure aws session * fix shared vars interpolstion * improve interpolation error * release v1.3.4 * fix deprecated goreleaser configs
- Loading branch information
Showing
16 changed files
with
163 additions
and
86 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
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 |
---|---|---|
|
@@ -178,3 +178,6 @@ dist | |
|
||
# End of https://www.toptal.com/developers/gitignore/api/node | ||
|
||
.env | ||
env.json | ||
types |
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
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
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 |
---|---|---|
@@ -1,18 +1,33 @@ | ||
package aws | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/aws/client" | ||
"github.com/aws/aws-sdk-go/aws/session" | ||
) | ||
|
||
var Session = session.Must(session.NewSession()) | ||
var ses *session.Session | ||
|
||
var ( | ||
numberOfRetries = 10 | ||
throttleDelay = client.DefaultRetryerMinRetryDelay | ||
) | ||
func NewSession(cfg aws.Config) *session.Session { | ||
if ses == nil { | ||
if cfg.Retryer == nil { | ||
cfg.Retryer = Retryer | ||
} | ||
|
||
if cfg.Region == nil { | ||
region := os.Getenv("AWS_REGION") | ||
cfg.Region = ®ion | ||
} | ||
|
||
ses = session.Must(session.NewSession(&cfg)) | ||
} | ||
|
||
return ses | ||
} | ||
|
||
var Retryer = client.DefaultRetryer{ | ||
NumMaxRetries: numberOfRetries, | ||
MinThrottleDelay: throttleDelay, | ||
NumMaxRetries: 2, | ||
MinThrottleDelay: client.DefaultRetryerMaxRetryDelay, | ||
} |
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
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
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
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
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
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
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
Oops, something went wrong.