Skip to content

Commit

Permalink
Set default region if none is provided for SSM control files (#6)
Browse files Browse the repository at this point in the history
* set default region if none is provided for SSM control files
  • Loading branch information
fishnix authored Jul 15, 2020
1 parent bfaf502 commit ee2fccf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Binary Release

on:
release:
types: [created]

jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/amd64, windows/amd64, darwin/amd64
goos: [linux, windows, darwin]
goarch: [amd64]
steps:
- uses: actions/checkout@v2
- uses: wangyoucao577/go-release-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

`deco` has three options currently, `validate`, `show`, and `run`.

```
```text
deco gets your app ready to run when a container
starts. For example: the filters allow you to specify
individual files to filter and key/value pairs to use when
Expand Down
11 changes: 10 additions & 1 deletion control/ssm.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package control

import (
"os"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ssm"
Expand All @@ -19,8 +21,15 @@ type SSM struct {
func NewSSM(opts ...SSMOption) *SSM {
Logger.Println("[INFO] creating new ssm provider")

region := "us-east-1"
if r, ok := os.LookupEnv("AWS_REGION"); ok {
region = r
} else if r, ok := os.LookupEnv("AWS_DEFAULT_REGION"); ok {
region = r
}

s := SSM{}
s.config = aws.NewConfig()
s.config = aws.NewConfig().WithRegion(region)

for _, opt := range opts {
opt(&s)
Expand Down

0 comments on commit ee2fccf

Please sign in to comment.