Skip to content

Commit

Permalink
upgraded aws sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
rkoval committed Jul 12, 2021
1 parent e3700ba commit eeb3a0c
Show file tree
Hide file tree
Showing 34 changed files with 401 additions and 274 deletions.
17 changes: 10 additions & 7 deletions awsworkflow/aws.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
package awsworkflow

import (
"context"
"net/http"

"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
aw "github.com/deanishe/awgo"
)

func NewWorkflowSession(transport http.RoundTripper) *session.Session {
sess := session.Must(session.NewSession())
func NewWorkflowConfig(transport http.RoundTripper) aws.Config {
cfg, err := config.LoadDefaultConfig(context.TODO())
if err != nil {
panic(err)
}

if transport != nil {
client := &http.Client{
cfg.HTTPClient = &http.Client{
Transport: transport,
}
sess.Config.WithHTTPClient(client)
}
// cfg.WithLogLevel(aws.LogDebugWithHTTPBody)
return sess
return cfg
}

func GetImageIcon(id string) *aw.Icon {
Expand Down
48 changes: 34 additions & 14 deletions caching/caching.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"io/ioutil"
"log"
"os"
"strings"

"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go"
aw "github.com/deanishe/awgo"

"github.com/cheekybits/genny/generic"
Expand All @@ -16,30 +17,49 @@ import (
//go:generate genny -in=$GOFILE -out=gen-$GOFILE gen "Entity=cloudwatchlogs.LogGroup,ec2.Instance,s3.Bucket,ec2.SecurityGroup,elasticbeanstalk.EnvironmentDescription,wafv2.IPSetSummary,wafv2.WebACLSummary,lambda.FunctionConfiguration,cloudformation.Stack,rds.DBInstance"
type Entity = generic.Type

type EntityArrayFetcher = func(*session.Session) ([]Entity, error)
type EntityArrayFetcher = func(aws.Config) ([]Entity, error)

func LoadEntityArrayFromCache(wf *aw.Workflow, session *session.Session, cacheName string, fetcher EntityArrayFetcher, forceFetch bool, rawQuery string) []Entity {
func LoadEntityArrayFromCache(wf *aw.Workflow, cfg aws.Config, cacheName string, fetcher EntityArrayFetcher, forceFetch bool, rawQuery string) []Entity {
// TODO optimization: not all services have sa region associated with them, so cache can be reused across regions (e.g., s3 buckets are global)
cacheName += "_" + *session.Config.Region
cacheName += "_" + cfg.Region

results := []Entity{}
lastFetchErrPath := wf.CacheDir() + "/last-fetch-err.txt"
if forceFetch {
log.Printf("fetching from aws ...")
results, err := fetcher(session)
results, err := fetcher(cfg)

if err != nil {
log.Printf("fetch error occurred. writing to %s ...", lastFetchErrPath)
_ = ioutil.WriteFile(lastFetchErrPath, []byte(err.Error()), 0600)
if aerr, ok := err.(awserr.Error); ok {
message := aerr.Message()
if message != "" {
panic(message)
}
if aerr.Code() == "AccessDeniedException" {
panic(errors.New("You do not have access to fetch these. Check your IAM permissions"))
var errString string
var missingRegionError *aws.MissingRegionError
if errors.As(err, &missingRegionError) {
errString = "MissingRegion"
} else {
var apiErr smithy.APIError
if errors.As(err, &apiErr) {
errCode := apiErr.ErrorCode()
if errCode == "AccessDeniedException" {
errString = "You do not have access to fetch these. Check your IAM permissions"
} else {
errString = errCode

message := apiErr.ErrorMessage()
if message != "" {
errString += ": " + message
}
}
}
}
if errString == "" {
errString = err.Error()
}
if strings.Contains(errString, "failed to retrieve credentials") {
// workaround hack; aws-sdk-go-v2 will automatically attempt to get credentials from the metadata service URL if file not specified,
// but that's bad given that we will never be run in AWS. as a result, just populate an error string that informs users better
errString = "NoCredentialProviders"
}
_ = ioutil.WriteFile(lastFetchErrPath, []byte(errString), 0600)
panic(err)
} else {
os.Remove(lastFetchErrPath)
Expand Down
6 changes: 4 additions & 2 deletions caching/fetch_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,20 @@ func handleFetchErr(wf *aw.Workflow, lastFetchErrPath string) error {
return nil
}

// TODO need to fix "no results" display when there's really a fetch error

errString := string(data)
wf.Configure(aw.SuppressUIDs(true))
if strings.HasPrefix(errString, "NoCredentialProviders") {
util.NewURLItem(wf, "AWS credentials not configured in ~/.aws/credentials").
Subtitle("Press enter to open AWS docs for how to configure").
Arg("https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials").
Arg("https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#creating-the-credentials-file").
Icon(aw.IconError).
Valid(true)
} else if strings.HasPrefix(errString, "MissingRegion") {
util.NewURLItem(wf, "AWS default region not configured in ~/.aws/config").
Subtitle("Press enter to open AWS docs for how to configure").
Arg("https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-the-region").
Arg("https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#creating-the-config-file").
Icon(aw.IconError).
Valid(true)
} else {
Expand Down
1 change: 1 addition & 0 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set -e
command -v genny >> /dev/null || go get github.com/cheekybits/genny
command -v goimports >> /dev/null || go get golang.org/x/tools/cmd/goimports
go generate ./...
go run generators/gen-caching_importer/main.go
goimports -w caching/gen-caching.go
53 changes: 53 additions & 0 deletions generators/gen-caching_importer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package main

import (
"fmt"
"os"
"regexp"
"strings"
)

func main() {
importLines := getImportLines()

filename := "caching/gen-caching.go"
content, err := os.ReadFile(filename)
if err != nil {
panic(err)
}

lines := strings.Split(string(content[:]), "\n")

for i, line := range lines {
if strings.Contains(line, "\"github.com/aws/aws-sdk-go-v2/aws\"") {
lines = append(lines[:i+1+len(importLines)], lines[i+1:]...) // i < len(a)
for j, importLine := range importLines {
lines[i+1+j] = importLine
}
break
}
}

err = os.WriteFile(filename, []byte(strings.Join(lines, "\n")), 0600)
if err != nil {
panic(err)
}
}

func getImportLines() []string {
cachingFileContents, err := os.ReadFile("caching/caching.go")
if err != nil {
panic(err)
}
entitiesRawString := regexp.MustCompile("//go:generate genny .*\"Entity=(.+)\"")
matches := entitiesRawString.FindStringSubmatch(string(cachingFileContents[:]))
entities := strings.Split(matches[1], ",")

importLines := []string{}
for _, entity := range entities {
pkg := strings.Split(entity, ".")[0]
importLines = append(importLines, fmt.Sprintf("\t%s \"github.com/aws/aws-sdk-go-v2/service/%s/types\"", pkg, pkg))
}

return importLines
}
16 changes: 14 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@ module github.com/rkoval/alfred-aws-console-services-workflow
go 1.16

require (
github.com/aws/aws-sdk-go v1.34.10
github.com/aws/aws-sdk-go-v2 v1.7.0
github.com/aws/aws-sdk-go-v2/config v1.4.1
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.6.0
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.5.0
github.com/aws/aws-sdk-go-v2/service/ec2 v1.11.0
github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.4.0
github.com/aws/aws-sdk-go-v2/service/lambda v1.4.0
github.com/aws/aws-sdk-go-v2/service/rds v1.5.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.11.0
github.com/aws/aws-sdk-go-v2/service/wafv2 v1.6.0
github.com/aws/smithy-go v1.5.0
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible
github.com/cheekybits/genny v1.0.0
github.com/deanishe/awgo v0.25.0
github.com/dnaeon/go-vcr v1.0.1
github.com/stretchr/testify v1.6.1
gopkg.in/yaml.v2 v2.2.2
golang.org/x/text v0.3.6 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/yaml.v2 v2.2.8
)
65 changes: 51 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
github.com/aws/aws-sdk-go v1.34.10 h1:VU78gcf/3wA4HNEDCHidK738l7K0Bals4SJnfnvXOtY=
github.com/aws/aws-sdk-go v1.34.10/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go-v2 v1.7.0 h1:UYGnoIPIzed+ycmgw8Snb/0HK+KlMD+SndLTneG8ncE=
github.com/aws/aws-sdk-go-v2 v1.7.0/go.mod h1:tb9wi5s61kTDA5qCkcDbt3KRVV74GGslQkl/DRdX/P4=
github.com/aws/aws-sdk-go-v2/config v1.4.1 h1:PcGp9Kf+1dHJmP3EIDZJmAmWfGABFTU0obuvYQNzWH8=
github.com/aws/aws-sdk-go-v2/config v1.4.1/go.mod h1:HCDWZ/oeY59TPtXslxlbkCqLQBsVu6b09kiG43tdP+I=
github.com/aws/aws-sdk-go-v2/credentials v1.3.0 h1:vXxTINCsHn6LKhR043jwSLd6CsL7KOEU7b1woMr1K1A=
github.com/aws/aws-sdk-go-v2/credentials v1.3.0/go.mod h1:tOcv+qDZ0O+6Jk2beMl5JnZX6N0H7O8fw9UsD3bP7GI=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.2.0 h1:ucExzYCoAiL9GpKOsKkQLsa43wTT23tcdP4cDTSbZqY=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.2.0/go.mod h1:XvzoGzuS0kKPzCQtJCC22Xh/mMgVAzfGo/0V+mk/Cu0=
github.com/aws/aws-sdk-go-v2/internal/ini v1.1.0 h1:DJq/vXXF+LAFaa/kQX9C6arlf4xX4uaaqGWIyAKOCpM=
github.com/aws/aws-sdk-go-v2/internal/ini v1.1.0/go.mod h1:qGQ/9IfkZonRNSNLE99/yBJ7EPA/h8jlWEqtJCcaj+Q=
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.6.0 h1:n/UowzzshLr2YRsKIaMN8b0GnxejI8dNnPArkJBaifA=
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.6.0/go.mod h1:wcQkQeXg7hKjavJNYFgEC+osSCZvfMHQ4qfyfxYfQtE=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.5.0 h1:6xvDu+XzNsWWvwO78t7Iw5FOxN48sKEBFbKCaPFZMJ0=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.5.0/go.mod h1:mF+VgnZy51T0vksGkMjQsqAVcGAvCVgTICjwXFs1mDc=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.11.0 h1:KFzMDGBBkeo22Ty+A4xFc7LY7TmwOaJSETj/l7o90Vo=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.11.0/go.mod h1:WEDK28a3G3+BQCzP50oGA/6807+Sx/Ogn8BttfJ27zY=
github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.4.0 h1:aXJdmWyTzo2+uqPhw3MOj2NUMcEi9c5c3VjQT9eUso0=
github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.4.0/go.mod h1:9YGohXNTEQTmejHJw0Ino8VzSJyg4IwLCqGaeh6VRbI=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.2.0 h1:wfI4yrOCMAGdHaEreQ65ycSmPLVc2Q82O+r7ZxYTynA=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.2.0/go.mod h1:2Kc2Pybp1Hr2ZCCOz78mWnNSZYEKKBQgNcizVGk9sko=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.0 h1:g2npzssI/6XsoQaPYCxliMFeC5iNKKvO0aC+/wWOE0A=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.0/go.mod h1:a7XLWNKuVgOxjssEF019IiHPv35k8KHBaWv/wJAfi2A=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.5.0 h1:6KmDU3XCGTcZlWPtP/gh7wYErrovnIxjX7um8iiuVsU=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.5.0/go.mod h1:541bxEA+Z8quwit9ZT7uxv/l9xRz85/HS41l9OxOQdY=
github.com/aws/aws-sdk-go-v2/service/lambda v1.4.0 h1:kER9ICYXKQxU7t4BSIbK6dCxLREtM4DTlGTsttaJXV0=
github.com/aws/aws-sdk-go-v2/service/lambda v1.4.0/go.mod h1:yKVqZqXjhuSGQwrz3GvHtLTqgeHIbMkKgwSVeVRL+2k=
github.com/aws/aws-sdk-go-v2/service/rds v1.5.0 h1:2V7sHzSToOXEZwNgQtPmC8PmmEgN3cHOJb3fPY+e3pI=
github.com/aws/aws-sdk-go-v2/service/rds v1.5.0/go.mod h1:Jdl9xGR2vVsZ/IyF0E+8sWmhRxV1KRN5IYf+keJlooA=
github.com/aws/aws-sdk-go-v2/service/s3 v1.11.0 h1:FuKlyrDBZBk0RFxjqFPtx9y/KDsxTa3MoFVUgIW9w3Q=
github.com/aws/aws-sdk-go-v2/service/s3 v1.11.0/go.mod h1:zJe8mEFDS2F04nO0pKVBPfArAv2ycC6wt3ILvrV4SQw=
github.com/aws/aws-sdk-go-v2/service/sso v1.3.0 h1:DMi9w+TpUam7eJ8ksL7svfzpqpqem2MkDAJKW8+I2/k=
github.com/aws/aws-sdk-go-v2/service/sso v1.3.0/go.mod h1:qWR+TUuvfji9udM79e4CPe87C5+SjMEb2TFXkZaI0Vc=
github.com/aws/aws-sdk-go-v2/service/sts v1.5.0 h1:Y1K9dHE2CYOWOvaJSIITq4mJfLX43iziThTvqs5FqOg=
github.com/aws/aws-sdk-go-v2/service/sts v1.5.0/go.mod h1:HjDKUmissf6Mlut+WzG2r35r6LeTKmLEDJ6p9NryzLg=
github.com/aws/aws-sdk-go-v2/service/wafv2 v1.6.0 h1:vcbhib4yO9yynn0JKjvMT9TR3+P+IWCesk1HUJQbMf4=
github.com/aws/aws-sdk-go-v2/service/wafv2 v1.6.0/go.mod h1:wjkI/W8g2yGoovGv6SS654lCgdVdhPmNkMn3IN4AsRk=
github.com/aws/smithy-go v1.5.0 h1:2grDq7LxZlo8BZUDeqRfQnQWLZpInmh2TLPPkJku3YM=
github.com/aws/smithy-go v1.5.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E=
github.com/bmatcuk/doublestar v1.3.1/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible h1:UafIjBvWQmS9i/xRg+CamMrnLTKNzo+bdmT/oH34c2Y=
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible/go.mod h1:Au1Xw1sgaJ5iSFktEhYsS0dbQiS1B0/XMXl+42y9Ilk=
Expand All @@ -16,40 +52,41 @@ github.com/deanishe/go-env v0.4.0/go.mod h1:RgEcGAqdRnt8ybQteAbv1Ys2lWIRE7TlgON/
github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
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/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
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=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
howett.net/plist v0.0.0-20200419221736-3b63eb3a43b5/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0=
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func init() {
func main() {
wf.Run(func() {
log.Printf("running workflow with query: `%s`", query)
session := awsworkflow.NewWorkflowSession(nil)
cfg := awsworkflow.NewWorkflowConfig(nil)
query = strings.TrimLeft(query, " ")

workflow.Run(wf, query, session, forceFetch, openAll, ymlPath)
workflow.Run(wf, query, cfg, forceFetch, openAll, ymlPath)
})
}
Loading

0 comments on commit eeb3a0c

Please sign in to comment.