diff --git a/aliases/aliases.go b/aliases/aliases.go index 5cb68c7b..e7248fd6 100644 --- a/aliases/aliases.go +++ b/aliases/aliases.go @@ -3,6 +3,7 @@ package aliases import "os" var OverrideAwsRegion string +var OverrideAwsProfile string var Search string func init() { @@ -11,6 +12,11 @@ func init() { OverrideAwsRegion = "$" } + OverrideAwsProfile = os.Getenv("ALFRED_AWS_CONSOLE_SERVICES_OVERRIDE_AWS_PROFILE_ALIAS") + if OverrideAwsProfile == "" { + OverrideAwsProfile = "@" + } + Search = os.Getenv("ALFRED_AWS_CONSOLE_SERVICES_WORKFLOW_SEARCH_ALIAS") if Search == "" { Search = "," diff --git a/awsconfig/profiles.go b/awsconfig/profiles.go new file mode 100644 index 00000000..e82b95f2 --- /dev/null +++ b/awsconfig/profiles.go @@ -0,0 +1,83 @@ +package awsconfig + +import ( + "log" + "os" + + "github.com/aws/aws-sdk-go-v2/config" + "gopkg.in/ini.v1" +) + +type Profile struct { + Name string + Region string +} + +var awsProfiles []Profile + +func GetAwsProfiles() []Profile { + if awsProfiles == nil || len(awsProfiles) <= 0 { + loadAwsProfiles() + } + return awsProfiles +} + +func loadAwsProfiles() { + credentialsIniFile, err := ini.Load(GetAwsCredentialsFilePath()) + if err != nil { + log.Println(err) + } + configIniFile, err := ini.Load(GetAwsProfileFilePath()) + if err != nil { + log.Println(err) + } + + awsProfiles = nil + if credentialsIniFile != nil { + for _, section := range credentialsIniFile.Sections() { + if section.Name() == ini.DefaultSection { + // AWS does not specify anything useful in the root section + continue + } + profile := Profile{ + Name: section.Name(), + } + + if configIniFile != nil { + var sectionName string + if profile.Name == "default" { + sectionName = profile.Name + } else { + // all other non-"default" profiles have special prefix + sectionName = "profile " + profile.Name + } + configProfileSection, _ := configIniFile.GetSection(sectionName) + if configProfileSection != nil { + regionKey, _ := configProfileSection.GetKey("region") + if regionKey != nil { + profile.Region = regionKey.Value() + } + } + } + awsProfiles = append(awsProfiles, profile) + } + } +} + +func GetAwsCredentialsFilePath() string { + // see https://docs.aws.amazon.com/sdkref/latest/guide/file-location.html + path, _ := os.LookupEnv("AWS_SHARED_CREDENTIALS_FILE") + if path == "" { + path = config.DefaultSharedCredentialsFilename() + } + return path +} + +func GetAwsProfileFilePath() string { + // see https://docs.aws.amazon.com/sdkref/latest/guide/file-location.html + path, _ := os.LookupEnv("AWS_CONFIG_FILE") + if path == "" { + path = config.DefaultSharedConfigFilename() + } + return path +} diff --git a/awsworkflow/regions.go b/awsconfig/regions.go similarity index 98% rename from awsworkflow/regions.go rename to awsconfig/regions.go index e0bf97eb..f9d30fe5 100644 --- a/awsworkflow/regions.go +++ b/awsconfig/regions.go @@ -1,4 +1,4 @@ -package awsworkflow +package awsconfig type Region struct { Name string diff --git a/awsworkflow/aws.go b/awsworkflow/aws.go index 71e40c2e..875977e8 100644 --- a/awsworkflow/aws.go +++ b/awsworkflow/aws.go @@ -9,11 +9,32 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" aw "github.com/deanishe/awgo" + "github.com/rkoval/alfred-aws-console-services-workflow/awsconfig" "github.com/rkoval/alfred-aws-console-services-workflow/util" ) -func InitAWS(transport http.RoundTripper) aws.Config { - cfg, err := config.LoadDefaultConfig(context.TODO()) +func InitAWS(transport http.RoundTripper, profile *awsconfig.Profile, region *awsconfig.Region) aws.Config { + profileLoadOptionsFunc := func(o *config.LoadOptions) error { + return nil + } + regionLoadOptionsFunc := func(o *config.LoadOptions) error { + return nil + } + if profile != nil { + profileLoadOptionsFunc = config.WithSharedConfigProfile(profile.Name) + if profile.Region != "" { + regionLoadOptionsFunc = config.WithRegion(profile.Region) + } + } + if region != nil { + regionLoadOptionsFunc = config.WithRegion(region.Name) + } + + cfg, err := config.LoadDefaultConfig( + context.TODO(), + profileLoadOptionsFunc, + regionLoadOptionsFunc, + ) if err != nil { panic(err) } diff --git a/go.mod b/go.mod index 8411c3d5..efe86134 100644 --- a/go.mod +++ b/go.mod @@ -26,5 +26,6 @@ require ( github.com/stretchr/testify v1.6.1 golang.org/x/text v0.3.6 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/yaml.v2 v2.2.8 ) diff --git a/go.sum b/go.sum index 6ab69e03..53d6b18d 100644 --- a/go.sum +++ b/go.sum @@ -96,6 +96,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 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/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= diff --git a/main.go b/main.go index d10b1d99..8c595a0b 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,6 @@ import ( aw "github.com/deanishe/awgo" "github.com/deanishe/awgo/update" - "github.com/rkoval/alfred-aws-console-services-workflow/awsworkflow" "github.com/rkoval/alfred-aws-console-services-workflow/workflow" ) @@ -29,9 +28,7 @@ func init() { func main() { wf.Run(func() { log.Printf("running workflow with query: `%s`", query) - cfg := awsworkflow.InitAWS(nil) query = strings.TrimLeft(query, " ") - - workflow.Run(wf, query, cfg, forceFetch, openAll, ymlPath) + workflow.Run(wf, query, nil, forceFetch, openAll, ymlPath) }) } diff --git a/parsers/.snapshots/TestParser-#00 b/parsers/.snapshots/TestParser-#00 index 2fd58fd2..6bef74d0 100644 --- a/parsers/.snapshots/TestParser-#00 +++ b/parsers/.snapshots/TestParser-#00 @@ -5,7 +5,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-$ b/parsers/.snapshots/TestParser-$ index 03b358ab..28538800 100644 --- a/parsers/.snapshots/TestParser-$ +++ b/parsers/.snapshots/TestParser-$ @@ -5,7 +5,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(""), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-$us b/parsers/.snapshots/TestParser-$us index cb951fb8..8797f5e9 100644 --- a/parsers/.snapshots/TestParser-$us +++ b/parsers/.snapshots/TestParser-$us @@ -5,7 +5,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)((len=2) "us"), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-$us-west-2 b/parsers/.snapshots/TestParser-$us-west-2 index f26aed02..28e08f97 100644 --- a/parsers/.snapshots/TestParser-$us-west-2 +++ b/parsers/.snapshots/TestParser-$us-west-2 @@ -5,10 +5,12 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)({ + regionOverride: (*awsconfig.Region)({ Name: (string) (len=9) "us-west-2", Description: (string) (len=16) "US West (Oregon)" }), RegionQuery: (*string)((len=9) "us-west-2"), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-@ b/parsers/.snapshots/TestParser-@ new file mode 100644 index 00000000..ff48c12a --- /dev/null +++ b/parsers/.snapshots/TestParser-@ @@ -0,0 +1,13 @@ +(*parsers.Query)({ + RawQuery: (string) (len=1) "@", + Service: (*awsworkflow.AwsService)(), + SubService: (*awsworkflow.AwsService)(), + HasTrailingWhitespace: (bool) false, + HasOpenAll: (bool) false, + HasDefaultSearchAlias: (bool) false, + regionOverride: (*awsconfig.Region)(), + RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(""), + RemainingQuery: (string) "" +}) diff --git a/parsers/.snapshots/TestParser-@prof b/parsers/.snapshots/TestParser-@prof new file mode 100644 index 00000000..c109465b --- /dev/null +++ b/parsers/.snapshots/TestParser-@prof @@ -0,0 +1,13 @@ +(*parsers.Query)({ + RawQuery: (string) (len=5) "@prof", + Service: (*awsworkflow.AwsService)(), + SubService: (*awsworkflow.AwsService)(), + HasTrailingWhitespace: (bool) false, + HasOpenAll: (bool) false, + HasDefaultSearchAlias: (bool) false, + regionOverride: (*awsconfig.Region)(), + RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)((len=4) "prof"), + RemainingQuery: (string) "" +}) diff --git a/parsers/.snapshots/TestParser-@profile b/parsers/.snapshots/TestParser-@profile new file mode 100644 index 00000000..fa789462 --- /dev/null +++ b/parsers/.snapshots/TestParser-@profile @@ -0,0 +1,13 @@ +(*parsers.Query)({ + RawQuery: (string) (len=8) "@profile", + Service: (*awsworkflow.AwsService)(), + SubService: (*awsworkflow.AwsService)(), + HasTrailingWhitespace: (bool) false, + HasOpenAll: (bool) false, + HasDefaultSearchAlias: (bool) false, + regionOverride: (*awsconfig.Region)(), + RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)((len=7) "profile"), + RemainingQuery: (string) "" +}) diff --git a/parsers/.snapshots/TestParser-OPEN_ALL_elasticbeanstalk_environments b/parsers/.snapshots/TestParser-OPEN_ALL_elasticbeanstalk_environments index d58ea114..71c76ee0 100644 --- a/parsers/.snapshots/TestParser-OPEN_ALL_elasticbeanstalk_environments +++ b/parsers/.snapshots/TestParser-OPEN_ALL_elasticbeanstalk_environments @@ -48,7 +48,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) true, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-_ b/parsers/.snapshots/TestParser-_ index cd246fbd..c328dccc 100644 --- a/parsers/.snapshots/TestParser-_ +++ b/parsers/.snapshots/TestParser-_ @@ -5,7 +5,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-___ b/parsers/.snapshots/TestParser-___ index 5841f661..b47ec1f6 100644 --- a/parsers/.snapshots/TestParser-___ +++ b/parsers/.snapshots/TestParser-___ @@ -5,7 +5,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-______elasticbeanstalk______ b/parsers/.snapshots/TestParser-______elasticbeanstalk______ index e3cc2e71..fc119c90 100644 --- a/parsers/.snapshots/TestParser-______elasticbeanstalk______ +++ b/parsers/.snapshots/TestParser-______elasticbeanstalk______ @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-_elasticbeanstalk b/parsers/.snapshots/TestParser-_elasticbeanstalk index a96b4f09..89abdfdb 100644 --- a/parsers/.snapshots/TestParser-_elasticbeanstalk +++ b/parsers/.snapshots/TestParser-_elasticbeanstalk @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-_elasticbeanstalk_ b/parsers/.snapshots/TestParser-_elasticbeanstalk_ index 30501b49..0b0ea96d 100644 --- a/parsers/.snapshots/TestParser-_elasticbeanstalk_ +++ b/parsers/.snapshots/TestParser-_elasticbeanstalk_ @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-_elasticbeanstalk_,search_term_more_hello_ b/parsers/.snapshots/TestParser-_elasticbeanstalk_,search_term_more_hello_ index 1fc67624..29b6a16a 100644 --- a/parsers/.snapshots/TestParser-_elasticbeanstalk_,search_term_more_hello_ +++ b/parsers/.snapshots/TestParser-_elasticbeanstalk_,search_term_more_hello_ @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) true, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=22) "search term more hello" }) diff --git a/parsers/.snapshots/TestParser-_elasticbeanstalk_subservice_search_term_more_hello b/parsers/.snapshots/TestParser-_elasticbeanstalk_subservice_search_term_more_hello index a090b980..f0bec723 100644 --- a/parsers/.snapshots/TestParser-_elasticbeanstalk_subservice_search_term_more_hello +++ b/parsers/.snapshots/TestParser-_elasticbeanstalk_subservice_search_term_more_hello @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=33) "subservice search term more hello" }) diff --git a/parsers/.snapshots/TestParser-_elasticbeanstalk_subservice_search_term_more_hello_ b/parsers/.snapshots/TestParser-_elasticbeanstalk_subservice_search_term_more_hello_ index 5162eded..7359f9d3 100644 --- a/parsers/.snapshots/TestParser-_elasticbeanstalk_subservice_search_term_more_hello_ +++ b/parsers/.snapshots/TestParser-_elasticbeanstalk_subservice_search_term_more_hello_ @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=33) "subservice search term more hello" }) diff --git a/parsers/.snapshots/TestParser-asdf_asdf b/parsers/.snapshots/TestParser-asdf_asdf index ceaf0daf..fdc3a15a 100644 --- a/parsers/.snapshots/TestParser-asdf_asdf +++ b/parsers/.snapshots/TestParser-asdf_asdf @@ -5,7 +5,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=9) "asdf asdf" }) diff --git a/parsers/.snapshots/TestParser-asdf_asdf_asdf_ b/parsers/.snapshots/TestParser-asdf_asdf_asdf_ index cf27677e..af5da8db 100644 --- a/parsers/.snapshots/TestParser-asdf_asdf_asdf_ +++ b/parsers/.snapshots/TestParser-asdf_asdf_asdf_ @@ -5,7 +5,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=14) "asdf asdf asdf" }) diff --git a/parsers/.snapshots/TestParser-e b/parsers/.snapshots/TestParser-e index 0193eef9..6812168e 100644 --- a/parsers/.snapshots/TestParser-e +++ b/parsers/.snapshots/TestParser-e @@ -5,7 +5,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=1) "e" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_ b/parsers/.snapshots/TestParser-elasticbeanstalk_ index a5764cce..8911e0ff 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_ +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_ @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_$us-west-2 b/parsers/.snapshots/TestParser-elasticbeanstalk_$us-west-2 index ad7b6f62..727afa94 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_$us-west-2 +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_$us-west-2 @@ -38,10 +38,12 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)({ + regionOverride: (*awsconfig.Region)({ Name: (string) (len=9) "us-west-2", Description: (string) (len=16) "US West (Oregon)" }), RegionQuery: (*string)((len=9) "us-west-2"), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_$us-west-2_ b/parsers/.snapshots/TestParser-elasticbeanstalk_$us-west-2_ index df63b260..c6f5ba42 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_$us-west-2_ +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_$us-west-2_ @@ -38,10 +38,12 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)({ + regionOverride: (*awsconfig.Region)({ Name: (string) (len=9) "us-west-2", Description: (string) (len=16) "US West (Oregon)" }), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_$us-whoops-2_ b/parsers/.snapshots/TestParser-elasticbeanstalk_$us-whoops-2_ index 621435e8..26106cff 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_$us-whoops-2_ +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_$us-whoops-2_ @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)((len=11) "us-whoops-2"), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_,search b/parsers/.snapshots/TestParser-elasticbeanstalk_,search index 7346f0bc..3c7f8f90 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_,search +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_,search @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) true, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=6) "search" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_,search_$us-west-2 b/parsers/.snapshots/TestParser-elasticbeanstalk_,search_$us-west-2 index eae51abe..2ff8454f 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_,search_$us-west-2 +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_,search_$us-west-2 @@ -38,10 +38,12 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) true, - RegionOverride: (*awsworkflow.Region)({ + regionOverride: (*awsconfig.Region)({ Name: (string) (len=9) "us-west-2", Description: (string) (len=16) "US West (Oregon)" }), RegionQuery: (*string)((len=9) "us-west-2"), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=6) "search" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_,search_$us-west-2_ b/parsers/.snapshots/TestParser-elasticbeanstalk_,search_$us-west-2_ index 5d20cd56..a27e1f2a 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_,search_$us-west-2_ +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_,search_$us-west-2_ @@ -38,10 +38,12 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) true, - RegionOverride: (*awsworkflow.Region)({ + regionOverride: (*awsconfig.Region)({ Name: (string) (len=9) "us-west-2", Description: (string) (len=16) "US West (Oregon)" }), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=6) "search" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_,search_term_more_hello b/parsers/.snapshots/TestParser-elasticbeanstalk_,search_term_more_hello index b79fa801..7bf441ec 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_,search_term_more_hello +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_,search_term_more_hello @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) true, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=22) "search term more hello" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_,search_term_more_hello_ b/parsers/.snapshots/TestParser-elasticbeanstalk_,search_term_more_hello_ index fb7c03c0..a9b7260b 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_,search_term_more_hello_ +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_,search_term_more_hello_ @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) true, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=22) "search term more hello" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_OPEN_ALL_ b/parsers/.snapshots/TestParser-elasticbeanstalk_OPEN_ALL_ index 3d90bab1..287a6871 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_OPEN_ALL_ +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_OPEN_ALL_ @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) true, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_OPEN_ALL_environments b/parsers/.snapshots/TestParser-elasticbeanstalk_OPEN_ALL_environments index 7ca724d3..0a763c78 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_OPEN_ALL_environments +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_OPEN_ALL_environments @@ -48,7 +48,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) true, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_environments_ b/parsers/.snapshots/TestParser-elasticbeanstalk_environments_ index 3f5c9868..b8f5c028 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_environments_ +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_environments_ @@ -48,7 +48,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) "" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_environments_e-0000 b/parsers/.snapshots/TestParser-elasticbeanstalk_environments_e-0000 index 1377a26e..ac9f62aa 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_environments_e-0000 +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_environments_e-0000 @@ -48,7 +48,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=6) "e-0000" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_subservice_search_term_more_hello b/parsers/.snapshots/TestParser-elasticbeanstalk_subservice_search_term_more_hello index 26cf3b72..93c0e7e2 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_subservice_search_term_more_hello +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_subservice_search_term_more_hello @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) false, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=33) "subservice search term more hello" }) diff --git a/parsers/.snapshots/TestParser-elasticbeanstalk_subservice_search_term_more_hello_ b/parsers/.snapshots/TestParser-elasticbeanstalk_subservice_search_term_more_hello_ index f823ed51..c00f853c 100644 --- a/parsers/.snapshots/TestParser-elasticbeanstalk_subservice_search_term_more_hello_ +++ b/parsers/.snapshots/TestParser-elasticbeanstalk_subservice_search_term_more_hello_ @@ -38,7 +38,9 @@ HasTrailingWhitespace: (bool) true, HasOpenAll: (bool) false, HasDefaultSearchAlias: (bool) false, - RegionOverride: (*awsworkflow.Region)(), + regionOverride: (*awsconfig.Region)(), RegionQuery: (*string)(), + ProfileOverride: (*awsconfig.Profile)(), + ProfileQuery: (*string)(), RemainingQuery: (string) (len=33) "subservice search term more hello" }) diff --git a/parsers/parser.go b/parsers/parser.go index a4947415..1aaa8b6b 100644 --- a/parsers/parser.go +++ b/parsers/parser.go @@ -5,6 +5,7 @@ import ( "log" "strings" + "github.com/rkoval/alfred-aws-console-services-workflow/awsconfig" "github.com/rkoval/alfred-aws-console-services-workflow/awsworkflow" ) @@ -94,16 +95,33 @@ func (p *Parser) Parse(ymlPath string) (*Query, []awsworkflow.AwsService) { query.HasDefaultSearchAlias = true remainingQuery += token.Value case REGION_OVERRIDE: - for _, region := range awsworkflow.AllAWSRegions { + if query.ProfileQuery != nil { + continue + } + for _, region := range awsconfig.AllAWSRegions { if token.Value == region.Name { - query.RegionOverride = ®ion + query.regionOverride = ®ion break } } - if query.RegionOverride == nil || (i >= len(tokens)-1 && !hasTrailingWhitespace) { + if query.regionOverride == nil || (i >= len(tokens)-1 && !hasTrailingWhitespace) { query.RegionQuery = &token.Value } + case PROFILE_OVERRIDE: + if query.RegionQuery != nil { + continue + } + for _, profile := range awsconfig.GetAwsProfiles() { + if token.Value == profile.Name { + query.ProfileOverride = &profile + break + } + } + + if query.ProfileOverride == nil || (i >= len(tokens)-1 && !hasTrailingWhitespace) { + query.ProfileQuery = &token.Value + } default: panic(fmt.Errorf("no handler for token: %#v", token)) } diff --git a/parsers/parser_test.go b/parsers/parser_test.go index ac900211..8bd108f0 100644 --- a/parsers/parser_test.go +++ b/parsers/parser_test.go @@ -56,6 +56,15 @@ var tcs []testCase = []testCase{ { rawQuery: "$us-west-2", }, + { + rawQuery: "@", + }, + { + rawQuery: "@prof", + }, + { + rawQuery: "@profile", + }, { rawQuery: "elasticbeanstalk $us-west-2", }, diff --git a/parsers/query.go b/parsers/query.go index 4107d5f4..a5e93975 100644 --- a/parsers/query.go +++ b/parsers/query.go @@ -1,6 +1,9 @@ package parsers import ( + "strings" + + "github.com/rkoval/alfred-aws-console-services-workflow/awsconfig" "github.com/rkoval/alfred-aws-console-services-workflow/awsworkflow" ) @@ -11,11 +14,20 @@ type Query struct { HasTrailingWhitespace bool HasOpenAll bool HasDefaultSearchAlias bool - RegionOverride *awsworkflow.Region + regionOverride *awsconfig.Region RegionQuery *string + ProfileOverride *awsconfig.Profile + ProfileQuery *string RemainingQuery string } func (q *Query) IsEmpty() bool { - return q.Service == nil && q.SubService == nil && q.RemainingQuery == "" && !q.HasOpenAll && q.RegionOverride == nil && q.RegionQuery == nil + return strings.Trim(q.RawQuery, " ") == "" +} + +func (q *Query) GetRegionOverride() *awsconfig.Region { + if q.Service == nil || !q.Service.HasGlobalRegion { + return q.regionOverride + } + return nil } diff --git a/parsers/scanner.go b/parsers/scanner.go index befd0b7d..5eaadc70 100644 --- a/parsers/scanner.go +++ b/parsers/scanner.go @@ -119,6 +119,10 @@ func (s *Scanner) scanWord() (TokenType, string, bool) { return REGION_OVERRIDE, stringBuf[len(aliases.OverrideAwsRegion):], hasTrailingWhitespace } + if strings.HasPrefix(stringBuf, aliases.OverrideAwsProfile) { + return PROFILE_OVERRIDE, stringBuf[len(aliases.OverrideAwsProfile):], hasTrailingWhitespace + } + switch stringBuf { case "OPEN_ALL": return OPEN_ALL, stringBuf, hasTrailingWhitespace diff --git a/parsers/tokens.go b/parsers/tokens.go index c724b472..e73a71f9 100644 --- a/parsers/tokens.go +++ b/parsers/tokens.go @@ -14,6 +14,7 @@ const ( OPEN_ALL SEARCH_ALIAS REGION_OVERRIDE + PROFILE_OVERRIDE ) type Token struct { diff --git a/searchers/test_searcher.go b/searchers/test_searcher.go index 547e3107..44148b14 100644 --- a/searchers/test_searcher.go +++ b/searchers/test_searcher.go @@ -5,6 +5,7 @@ import ( "github.com/bradleyjkemp/cupaloy" aw "github.com/deanishe/awgo" + "github.com/rkoval/alfred-aws-console-services-workflow/awsworkflow" "github.com/rkoval/alfred-aws-console-services-workflow/searchers/searchutil" "github.com/rkoval/alfred-aws-console-services-workflow/tests" ) @@ -12,9 +13,10 @@ import ( func TestSearcher(t *testing.T, searcher Searcher, fixtureFilename string) { wf := aw.New() - cfg, r := tests.NewAWSRecorderSession(fixtureFilename) + r := tests.NewAWSRecorderSession(fixtureFilename) defer tests.PanicOnError(r.Stop) + cfg := awsworkflow.InitAWS(r, nil, nil) err := searcher.Search( wf, searchutil.SearchArgs{ diff --git a/test.sh b/test.sh index 499a597c..f3fdffac 100755 --- a/test.sh +++ b/test.sh @@ -3,5 +3,7 @@ set -e export TEST=1 source env.sh export AWS_REGION=us-west-2 +export AWS_SHARED_CREDENTIALS_FILE="../tests/test_aws_credentials_file" +export AWS_CONFIG_FILE="../tests/test_aws_config_file" ./generate.sh UPDATE_SNAPSHOTS=true go test ./... $@ \ No newline at end of file diff --git a/tests/test_aws_config_file b/tests/test_aws_config_file new file mode 100644 index 00000000..3276fe7b --- /dev/null +++ b/tests/test_aws_config_file @@ -0,0 +1,14 @@ +[default] +region = us-west-2 + +[profile profile1] +region = us-east-1 + +[profile profile2] +region = eu-west-1 + +[profile profile3] +region = sa-east-1 + +[profile bogusprofile] +region = bogus diff --git a/tests/test_aws_credentials_file b/tests/test_aws_credentials_file new file mode 100644 index 00000000..72dc5f95 --- /dev/null +++ b/tests/test_aws_credentials_file @@ -0,0 +1,13 @@ +[default] +aws_access_key_id=AAAAAAAAAAAAAAAAAAAA +aws_secret_access_key=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz + +[profile1] +aws_access_key_id=BBBBBBBBBBBBBBBBBBBB +aws_secret_access_key=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy + +[profile3] +aws_access_key_id=BBBBBBBBBBBBBBBBBBBB +aws_secret_access_key=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy + +[bogusprofile] \ No newline at end of file diff --git a/tests/test_tools.go b/tests/test_tools.go index 4383a83a..bb0eb2d6 100644 --- a/tests/test_tools.go +++ b/tests/test_tools.go @@ -4,13 +4,11 @@ import ( "os" "regexp" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/dnaeon/go-vcr/cassette" "github.com/dnaeon/go-vcr/recorder" - "github.com/rkoval/alfred-aws-console-services-workflow/awsworkflow" ) -func NewAWSRecorderSession(fixtureName string) (aws.Config, *recorder.Recorder) { +func NewAWSRecorderSession(fixtureName string) *recorder.Recorder { var mode recorder.Mode if os.Getenv("RECORD_VCR") != "" { mode = recorder.ModeRecording @@ -42,9 +40,7 @@ func NewAWSRecorderSession(fixtureName string) (aws.Config, *recorder.Recorder) return nil }) - cfg := awsworkflow.InitAWS(r) - - return cfg, r + return r } func PanicOnError(f func() error) { diff --git a/workflow/.snapshots/TestRun-#00 b/workflow/.snapshots/TestRun-#00 index 03f0ed28..e44bbadf 100644 --- a/workflow/.snapshots/TestRun-#00 +++ b/workflow/.snapshots/TestRun-#00 @@ -19,7 +19,7 @@ }), (*aw.Item)({ title: (string) (len=23) "Using profile \"default\"", - subtitle: (*string)(), + subtitle: (*string)((len=41) "Use \"@\" to override for the current query"), match: (*string)(), uid: (*string)(), autocomplete: (*string)(), diff --git a/workflow/.snapshots/TestRun-$_@ b/workflow/.snapshots/TestRun-$_@ new file mode 100644 index 00000000..a6e9f872 --- /dev/null +++ b/workflow/.snapshots/TestRun-$_@ @@ -0,0 +1,485 @@ +([]*aw.Item) (len=23) { + (*aw.Item)({ + title: (string) (len=9) "ap-east-1", + subtitle: (*string)((len=24) "Asia Pacific (Hong Kong)"), + match: (*string)(), + uid: (*string)((len=9) "ap-east-1"), + autocomplete: (*string)((len=13) "$ap-east-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "eu-west-1", + subtitle: (*string)((len=16) "Europe (Ireland)"), + match: (*string)(), + uid: (*string)((len=9) "eu-west-1"), + autocomplete: (*string)((len=13) "$eu-west-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "eu-west-2", + subtitle: (*string)((len=15) "Europe (London)"), + match: (*string)(), + uid: (*string)((len=9) "eu-west-2"), + autocomplete: (*string)((len=13) "$eu-west-2 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "eu-west-3", + subtitle: (*string)((len=14) "Europe (Paris)"), + match: (*string)(), + uid: (*string)((len=9) "eu-west-3"), + autocomplete: (*string)((len=13) "$eu-west-3 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "sa-east-1", + subtitle: (*string)((len=26) "South America (São Paulo)"), + match: (*string)(), + uid: (*string)((len=9) "sa-east-1"), + autocomplete: (*string)((len=13) "$sa-east-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "us-east-1", + subtitle: (*string)((len=21) "US East (N. Virginia)"), + match: (*string)(), + uid: (*string)((len=9) "us-east-1"), + autocomplete: (*string)((len=13) "$us-east-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "us-east-2", + subtitle: (*string)((len=14) "US East (Ohio)"), + match: (*string)(), + uid: (*string)((len=9) "us-east-2"), + autocomplete: (*string)((len=13) "$us-east-2 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "us-west-1", + subtitle: (*string)((len=23) "US West (N. California)"), + match: (*string)(), + uid: (*string)((len=9) "us-west-1"), + autocomplete: (*string)((len=13) "$us-west-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "us-west-2", + subtitle: (*string)((len=16) "US West (Oregon)"), + match: (*string)(), + uid: (*string)((len=9) "us-west-2"), + autocomplete: (*string)((len=13) "$us-west-2 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "af-south-1", + subtitle: (*string)((len=18) "Africa (Cape Town)"), + match: (*string)(), + uid: (*string)((len=10) "af-south-1"), + autocomplete: (*string)((len=14) "$af-south-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "ap-south-1", + subtitle: (*string)((len=21) "Asia Pacific (Mumbai)"), + match: (*string)(), + uid: (*string)((len=10) "ap-south-1"), + autocomplete: (*string)((len=14) "$ap-south-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "cn-north-1", + subtitle: (*string)((len=15) "China (Beijing)"), + match: (*string)(), + uid: (*string)((len=10) "cn-north-1"), + autocomplete: (*string)((len=14) "$cn-north-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "eu-north-1", + subtitle: (*string)((len=18) "Europe (Stockholm)"), + match: (*string)(), + uid: (*string)((len=10) "eu-north-1"), + autocomplete: (*string)((len=14) "$eu-north-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "eu-south-1", + subtitle: (*string)((len=14) "Europe (Milan)"), + match: (*string)(), + uid: (*string)((len=10) "eu-south-1"), + autocomplete: (*string)((len=14) "$eu-south-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "me-south-1", + subtitle: (*string)((len=21) "Middle East (Bahrain)"), + match: (*string)(), + uid: (*string)((len=10) "me-south-1"), + autocomplete: (*string)((len=14) "$me-south-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "ca-central-1", + subtitle: (*string)((len=16) "Canada (Central)"), + match: (*string)(), + uid: (*string)((len=12) "ca-central-1"), + autocomplete: (*string)((len=16) "$ca-central-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "eu-central-1", + subtitle: (*string)((len=18) "Europe (Frankfurt)"), + match: (*string)(), + uid: (*string)((len=12) "eu-central-1"), + autocomplete: (*string)((len=16) "$eu-central-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-northeast-1", + subtitle: (*string)((len=20) "Asia Pacific (Tokyo)"), + match: (*string)(), + uid: (*string)((len=14) "ap-northeast-1"), + autocomplete: (*string)((len=18) "$ap-northeast-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-northeast-2", + subtitle: (*string)((len=20) "Asia Pacific (Seoul)"), + match: (*string)(), + uid: (*string)((len=14) "ap-northeast-2"), + autocomplete: (*string)((len=18) "$ap-northeast-2 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-northeast-3", + subtitle: (*string)((len=20) "Asia Pacific (Osaka)"), + match: (*string)(), + uid: (*string)((len=14) "ap-northeast-3"), + autocomplete: (*string)((len=18) "$ap-northeast-3 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-southeast-1", + subtitle: (*string)((len=24) "Asia Pacific (Singapore)"), + match: (*string)(), + uid: (*string)((len=14) "ap-southeast-1"), + autocomplete: (*string)((len=18) "$ap-southeast-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-southeast-2", + subtitle: (*string)((len=21) "Asia Pacific (Sydney)"), + match: (*string)(), + uid: (*string)((len=14) "ap-southeast-2"), + autocomplete: (*string)((len=18) "$ap-southeast-2 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "cn-northwest-1", + subtitle: (*string)((len=15) "China (Ningxia)"), + match: (*string)(), + uid: (*string)((len=14) "cn-northwest-1"), + autocomplete: (*string)((len=18) "$cn-northwest-1 @"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-$_@_adsf_asdf b/workflow/.snapshots/TestRun-$_@_adsf_asdf new file mode 100644 index 00000000..86cec220 --- /dev/null +++ b/workflow/.snapshots/TestRun-$_@_adsf_asdf @@ -0,0 +1,56 @@ +([]*aw.Item) (len=2) { + (*aw.Item)({ + title: (string) (len=25) "No matching regions found", + subtitle: (*string)((len=53) "Try starting over with \"$\" again to see the full list"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)(), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=83) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=39) "Update available (current version: 1.0)", + subtitle: (*string)((len=42) "Select this result to navigate to download"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)(), + arg: (*string)((len=71) "https://github.com/rkoval/alfred-aws-console-services-workflow/releases"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=81) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-$asdf_asdf_asdf b/workflow/.snapshots/TestRun-$asdf_asdf_asdf index 2ede92c2..86cec220 100644 --- a/workflow/.snapshots/TestRun-$asdf_asdf_asdf +++ b/workflow/.snapshots/TestRun-$asdf_asdf_asdf @@ -1,7 +1,7 @@ ([]*aw.Item) (len=2) { (*aw.Item)({ title: (string) (len=25) "No matching regions found", - subtitle: (*string)((len=53) "Try starting over with `$` again to see the full list"), + subtitle: (*string)((len=53) "Try starting over with \"$\" again to see the full list"), match: (*string)(), uid: (*string)(), autocomplete: (*string)(), diff --git a/workflow/.snapshots/TestRun-$us-east-1_@ b/workflow/.snapshots/TestRun-$us-east-1_@ new file mode 100644 index 00000000..68ede68c --- /dev/null +++ b/workflow/.snapshots/TestRun-$us-east-1_@ @@ -0,0 +1,86 @@ +([]*aw.Item) (len=4) { + (*aw.Item)({ + title: (string) (len=7) "default", + subtitle: (*string)((len=14) "🌎 us-west-2"), + match: (*string)(), + uid: (*string)((len=7) "default"), + autocomplete: (*string)((len=20) "$us-east-1 @default "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=21) "$us-east-1 @profile1 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "profile3", + subtitle: (*string)((len=14) "🌎 sa-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile3"), + autocomplete: (*string)((len=21) "$us-east-1 @profile3 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "bogusprofile", + subtitle: (*string)((len=10) "🌎 bogus"), + match: (*string)(), + uid: (*string)((len=12) "bogusprofile"), + autocomplete: (*string)((len=25) "$us-east-1 @bogusprofile "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-$us-east-1_@prof b/workflow/.snapshots/TestRun-$us-east-1_@prof new file mode 100644 index 00000000..aeae6c0e --- /dev/null +++ b/workflow/.snapshots/TestRun-$us-east-1_@prof @@ -0,0 +1,65 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=21) "$us-east-1 @profile1 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "profile3", + subtitle: (*string)((len=14) "🌎 sa-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile3"), + autocomplete: (*string)((len=21) "$us-east-1 @profile3 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "bogusprofile", + subtitle: (*string)((len=10) "🌎 bogus"), + match: (*string)(), + uid: (*string)((len=12) "bogusprofile"), + autocomplete: (*string)((len=25) "$us-east-1 @bogusprofile "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-$us-east-1_@prof_asdf_asdf b/workflow/.snapshots/TestRun-$us-east-1_@prof_asdf_asdf new file mode 100644 index 00000000..bdf7befa --- /dev/null +++ b/workflow/.snapshots/TestRun-$us-east-1_@prof_asdf_asdf @@ -0,0 +1,56 @@ +([]*aw.Item) (len=2) { + (*aw.Item)({ + title: (string) (len=26) "No matching profiles found", + subtitle: (*string)((len=53) "Try starting over with \"@\" again to see the full list"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)(), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=83) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=39) "Update available (current version: 1.0)", + subtitle: (*string)((len=42) "Select this result to navigate to download"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)(), + arg: (*string)((len=71) "https://github.com/rkoval/alfred-aws-console-services-workflow/releases"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=81) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-$us-east-1_@profile3_elasticbeanstalk b/workflow/.snapshots/TestRun-$us-east-1_@profile3_elasticbeanstalk new file mode 100644 index 00000000..7544dd7f --- /dev/null +++ b/workflow/.snapshots/TestRun-$us-east-1_@profile3_elasticbeanstalk @@ -0,0 +1,35 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=16) "elasticbeanstalk", + subtitle: (*string)((len=50) "🗂 Elastic Beanstalk – Run and Manage Web Apps"), + match: (*string)((len=34) "elasticbeanstalk Elastic Beanstalk"), + uid: (*string)((len=16) "elasticbeanstalk"), + autocomplete: (*string)((len=38) "$us-east-1 @profile3 elasticbeanstalk "), + arg: (*string)((len=62) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@ b/workflow/.snapshots/TestRun-@ new file mode 100644 index 00000000..57e44130 --- /dev/null +++ b/workflow/.snapshots/TestRun-@ @@ -0,0 +1,86 @@ +([]*aw.Item) (len=4) { + (*aw.Item)({ + title: (string) (len=7) "default", + subtitle: (*string)((len=14) "🌎 us-west-2"), + match: (*string)(), + uid: (*string)((len=7) "default"), + autocomplete: (*string)((len=9) "@default "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=10) "@profile1 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "profile3", + subtitle: (*string)((len=14) "🌎 sa-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile3"), + autocomplete: (*string)((len=10) "@profile3 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "bogusprofile", + subtitle: (*string)((len=10) "🌎 bogus"), + match: (*string)(), + uid: (*string)((len=12) "bogusprofile"), + autocomplete: (*string)((len=14) "@bogusprofile "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@$ b/workflow/.snapshots/TestRun-@$ new file mode 100644 index 00000000..bdf7befa --- /dev/null +++ b/workflow/.snapshots/TestRun-@$ @@ -0,0 +1,56 @@ +([]*aw.Item) (len=2) { + (*aw.Item)({ + title: (string) (len=26) "No matching profiles found", + subtitle: (*string)((len=53) "Try starting over with \"@\" again to see the full list"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)(), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=83) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=39) "Update available (current version: 1.0)", + subtitle: (*string)((len=42) "Select this result to navigate to download"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)(), + arg: (*string)((len=71) "https://github.com/rkoval/alfred-aws-console-services-workflow/releases"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=81) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@_$ b/workflow/.snapshots/TestRun-@_$ new file mode 100644 index 00000000..da7aad67 --- /dev/null +++ b/workflow/.snapshots/TestRun-@_$ @@ -0,0 +1,86 @@ +([]*aw.Item) (len=4) { + (*aw.Item)({ + title: (string) (len=7) "default", + subtitle: (*string)((len=14) "🌎 us-west-2"), + match: (*string)(), + uid: (*string)((len=7) "default"), + autocomplete: (*string)((len=11) "@default $"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=12) "@profile1 $"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "profile3", + subtitle: (*string)((len=14) "🌎 sa-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile3"), + autocomplete: (*string)((len=12) "@profile3 $"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "bogusprofile", + subtitle: (*string)((len=10) "🌎 bogus"), + match: (*string)(), + uid: (*string)((len=12) "bogusprofile"), + autocomplete: (*string)((len=16) "@bogusprofile $"), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@asdf_asdf_asdf b/workflow/.snapshots/TestRun-@asdf_asdf_asdf new file mode 100644 index 00000000..bdf7befa --- /dev/null +++ b/workflow/.snapshots/TestRun-@asdf_asdf_asdf @@ -0,0 +1,56 @@ +([]*aw.Item) (len=2) { + (*aw.Item)({ + title: (string) (len=26) "No matching profiles found", + subtitle: (*string)((len=53) "Try starting over with \"@\" again to see the full list"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)(), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=83) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=39) "Update available (current version: 1.0)", + subtitle: (*string)((len=42) "Select this result to navigate to download"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)(), + arg: (*string)((len=71) "https://github.com/rkoval/alfred-aws-console-services-workflow/releases"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=81) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@prof b/workflow/.snapshots/TestRun-@prof new file mode 100644 index 00000000..629e991e --- /dev/null +++ b/workflow/.snapshots/TestRun-@prof @@ -0,0 +1,65 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=10) "@profile1 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "profile3", + subtitle: (*string)((len=14) "🌎 sa-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile3"), + autocomplete: (*string)((len=10) "@profile3 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "bogusprofile", + subtitle: (*string)((len=10) "🌎 bogus"), + match: (*string)(), + uid: (*string)((len=12) "bogusprofile"), + autocomplete: (*string)((len=14) "@bogusprofile "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@profile1 b/workflow/.snapshots/TestRun-@profile1 new file mode 100644 index 00000000..17bd28f3 --- /dev/null +++ b/workflow/.snapshots/TestRun-@profile1 @@ -0,0 +1,23 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=10) "@profile1 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@profile1_$us-east-2_elasticbeanstalk b/workflow/.snapshots/TestRun-@profile1_$us-east-2_elasticbeanstalk new file mode 100644 index 00000000..b0862f8e --- /dev/null +++ b/workflow/.snapshots/TestRun-@profile1_$us-east-2_elasticbeanstalk @@ -0,0 +1,35 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=16) "elasticbeanstalk", + subtitle: (*string)((len=50) "🗂 Elastic Beanstalk – Run and Manage Web Apps"), + match: (*string)((len=34) "elasticbeanstalk Elastic Beanstalk"), + uid: (*string)((len=16) "elasticbeanstalk"), + autocomplete: (*string)((len=38) "@profile1 $us-east-2 elasticbeanstalk "), + arg: (*string)((len=62) "https://us-east-2.console.aws.amazon.com/elasticbeanstalk/home"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@profile1_eec2 b/workflow/.snapshots/TestRun-@profile1_eec2 new file mode 100644 index 00000000..ecd5a34a --- /dev/null +++ b/workflow/.snapshots/TestRun-@profile1_eec2 @@ -0,0 +1,35 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=15) "ec2imagebuilder", + subtitle: (*string)((len=89) "EC2 Image Builder – A managed service to automate build, customize and deploy OS images"), + match: (*string)((len=33) "ec2imagebuilder EC2 Image Builder"), + uid: (*string)((len=15) "ec2imagebuilder"), + autocomplete: (*string)((len=26) "@profile1 ec2imagebuilder "), + arg: (*string)((len=58) "https://us-east-1.console.aws.amazon.com/imagebuilder/home"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=26) "images/ec2imagebuilder.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk b/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk new file mode 100644 index 00000000..50871392 --- /dev/null +++ b/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk @@ -0,0 +1,35 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=16) "elasticbeanstalk", + subtitle: (*string)((len=50) "🗂 Elastic Beanstalk – Run and Manage Web Apps"), + match: (*string)((len=34) "elasticbeanstalk Elastic Beanstalk"), + uid: (*string)((len=16) "elasticbeanstalk"), + autocomplete: (*string)((len=27) "@profile1 elasticbeanstalk "), + arg: (*string)((len=62) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk_appli b/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk_appli new file mode 100644 index 00000000..2c6f8a51 --- /dev/null +++ b/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk_appli @@ -0,0 +1,35 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=29) "elasticbeanstalk applications", + subtitle: (*string)((len=39) "🔎 Elastic Beanstalk – Applications"), + match: (*string)((len=25) "applications Applications"), + uid: (*string)((len=12) "applications"), + autocomplete: (*string)((len=40) "@profile1 elasticbeanstalk applications "), + arg: (*string)((len=76) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home#/applications"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk_applications b/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk_applications new file mode 100644 index 00000000..2c6f8a51 --- /dev/null +++ b/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk_applications @@ -0,0 +1,35 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=29) "elasticbeanstalk applications", + subtitle: (*string)((len=39) "🔎 Elastic Beanstalk – Applications"), + match: (*string)((len=25) "applications Applications"), + uid: (*string)((len=12) "applications"), + autocomplete: (*string)((len=40) "@profile1 elasticbeanstalk applications "), + arg: (*string)((len=76) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home#/applications"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk_applications_ b/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk_applications_ new file mode 100644 index 00000000..2b7d4441 --- /dev/null +++ b/workflow/.snapshots/TestRun-@profile1_elasticbeanstalk_applications_ @@ -0,0 +1,101 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=4) "App1", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "@profile1 elasticbeanstalk applications App1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App1"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App2", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "@profile1 elasticbeanstalk applications App2 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App2"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App3", + subtitle: (*string)((len=20) "Description for App3"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "@profile1 elasticbeanstalk applications App3 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App3"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-_ b/workflow/.snapshots/TestRun-_ index 03f0ed28..e44bbadf 100644 --- a/workflow/.snapshots/TestRun-_ +++ b/workflow/.snapshots/TestRun-_ @@ -19,7 +19,7 @@ }), (*aw.Item)({ title: (string) (len=23) "Using profile \"default\"", - subtitle: (*string)(), + subtitle: (*string)((len=41) "Use \"@\" to override for the current query"), match: (*string)(), uid: (*string)(), autocomplete: (*string)(), diff --git a/workflow/.snapshots/TestRun-eec2_@profile1 b/workflow/.snapshots/TestRun-eec2_@profile1 new file mode 100644 index 00000000..206a1863 --- /dev/null +++ b/workflow/.snapshots/TestRun-eec2_@profile1 @@ -0,0 +1,23 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=15) "eec2 @profile1 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-eec2_@profile1_ b/workflow/.snapshots/TestRun-eec2_@profile1_ new file mode 100644 index 00000000..a0b22112 --- /dev/null +++ b/workflow/.snapshots/TestRun-eec2_@profile1_ @@ -0,0 +1,35 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=15) "ec2imagebuilder", + subtitle: (*string)((len=89) "EC2 Image Builder – A managed service to automate build, customize and deploy OS images"), + match: (*string)((len=33) "ec2imagebuilder EC2 Image Builder"), + uid: (*string)((len=15) "ec2imagebuilder"), + autocomplete: (*string)((len=26) "ec2imagebuilder @profile1 "), + arg: (*string)((len=58) "https://us-east-1.console.aws.amazon.com/imagebuilder/home"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=26) "images/ec2imagebuilder.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_@profile1_applications b/workflow/.snapshots/TestRun-elasticbeanstalk_@profile1_applications new file mode 100644 index 00000000..42d97079 --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_@profile1_applications @@ -0,0 +1,35 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=29) "elasticbeanstalk applications", + subtitle: (*string)((len=39) "🔎 Elastic Beanstalk – Applications"), + match: (*string)((len=25) "applications Applications"), + uid: (*string)((len=12) "applications"), + autocomplete: (*string)((len=40) "elasticbeanstalk @profile1 applications "), + arg: (*string)((len=76) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home#/applications"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_@profile1_applications_ b/workflow/.snapshots/TestRun-elasticbeanstalk_@profile1_applications_ new file mode 100644 index 00000000..207925d6 --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_@profile1_applications_ @@ -0,0 +1,101 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=4) "App1", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk @profile1 applications App1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App1"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App2", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk @profile1 applications App2 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App2"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App3", + subtitle: (*string)((len=20) "Description for App3"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk @profile1 applications App3 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App3"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1 b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1 new file mode 100644 index 00000000..b1aaed24 --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1 @@ -0,0 +1,23 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=40) "elasticbeanstalk applications @profile1 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_ new file mode 100644 index 00000000..9b708385 --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_ @@ -0,0 +1,101 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=4) "App1", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications @profile1 App1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App1"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App2", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications @profile1 App2 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App2"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App3", + subtitle: (*string)((len=20) "Description for App3"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications @profile1 App3 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App3"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_Ap b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_Ap new file mode 100644 index 00000000..9b708385 --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_Ap @@ -0,0 +1,101 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=4) "App1", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications @profile1 App1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App1"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App2", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications @profile1 App2 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App2"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App3", + subtitle: (*string)((len=20) "Description for App3"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications @profile1 App3 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App3"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_Ap_ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_Ap_ new file mode 100644 index 00000000..9b708385 --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_Ap_ @@ -0,0 +1,101 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=4) "App1", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications @profile1 App1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App1"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App2", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications @profile1 App2 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App2"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App3", + subtitle: (*string)((len=20) "Description for App3"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications @profile1 App3 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App3"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_arn:aws:elasticbeanstalk:us-east-1:0000000000:application-Ap b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_arn:aws:elasticbeanstalk:us-east-1:0000000000:application-Ap new file mode 100644 index 00000000..d43c25c4 --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile1_arn:aws:elasticbeanstalk:us-east-1:0000000000:application-Ap @@ -0,0 +1,101 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=4) "App1", + subtitle: (*string)(""), + match: (*string)((len=62) "arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App1"), + uid: (*string)(), + autocomplete: (*string)((len=103) "elasticbeanstalk applications @profile1 arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App1"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App2", + subtitle: (*string)(""), + match: (*string)((len=62) "arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App2"), + uid: (*string)(), + autocomplete: (*string)((len=103) "elasticbeanstalk applications @profile1 arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App2 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App2"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App3", + subtitle: (*string)((len=20) "Description for App3"), + match: (*string)((len=62) "arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App3"), + uid: (*string)(), + autocomplete: (*string)((len=103) "elasticbeanstalk applications @profile1 arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App3 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App3"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile3_$us-east-1_ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile3_$us-east-1_ new file mode 100644 index 00000000..fd1643aa --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_@profile3_$us-east-1_ @@ -0,0 +1,101 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=4) "App1", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=56) "elasticbeanstalk applications @profile3 $us-east-1 App1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App1"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App2", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=56) "elasticbeanstalk applications @profile3 $us-east-1 App2 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App2"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App3", + subtitle: (*string)((len=20) "Description for App3"), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=56) "elasticbeanstalk applications @profile3 $us-east-1 App3 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App3"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_App1_@prof b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_App1_@prof new file mode 100644 index 00000000..ca25b28d --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_App1_@prof @@ -0,0 +1,65 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=45) "elasticbeanstalk applications App1 @profile1 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "profile3", + subtitle: (*string)((len=14) "🌎 sa-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile3"), + autocomplete: (*string)((len=45) "elasticbeanstalk applications App1 @profile3 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "bogusprofile", + subtitle: (*string)((len=10) "🌎 bogus"), + match: (*string)(), + uid: (*string)((len=12) "bogusprofile"), + autocomplete: (*string)((len=49) "elasticbeanstalk applications App1 @bogusprofile "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_App1_@profile1 b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_App1_@profile1 new file mode 100644 index 00000000..3646ec96 --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_App1_@profile1 @@ -0,0 +1,23 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), + match: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=45) "elasticbeanstalk applications App1 @profile1 "), + arg: (*string)(), + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[aw.ModKey]*aw.Modifier) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_App1_@profile1_ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_App1_@profile1_ new file mode 100644 index 00000000..86bb7de6 --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_App1_@profile1_ @@ -0,0 +1,35 @@ +([]*aw.Item) (len=1) { + (*aw.Item)({ + title: (string) (len=4) "App1", + subtitle: (*string)(""), + match: (*string)(), + uid: (*string)(), + autocomplete: (*string)((len=45) "elasticbeanstalk applications App1 @profile1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App1"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-elasticbeanstalk_applications_arn:aws:elasticbeanstalk:us-east-1:0000000000:application-Ap_@profile1_ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_arn:aws:elasticbeanstalk:us-east-1:0000000000:application-Ap_@profile1_ new file mode 100644 index 00000000..826012ef --- /dev/null +++ b/workflow/.snapshots/TestRun-elasticbeanstalk_applications_arn:aws:elasticbeanstalk:us-east-1:0000000000:application-Ap_@profile1_ @@ -0,0 +1,101 @@ +([]*aw.Item) (len=3) { + (*aw.Item)({ + title: (string) (len=4) "App1", + subtitle: (*string)(""), + match: (*string)((len=62) "arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App1"), + uid: (*string)(), + autocomplete: (*string)((len=103) "elasticbeanstalk applications arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App1 @profile1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App1"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App2", + subtitle: (*string)(""), + match: (*string)((len=62) "arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App2"), + uid: (*string)(), + autocomplete: (*string)((len=103) "elasticbeanstalk applications arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App2 @profile1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App2"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=4) "App3", + subtitle: (*string)((len=20) "Description for App3"), + match: (*string)((len=62) "arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App3"), + uid: (*string)(), + autocomplete: (*string)((len=103) "elasticbeanstalk applications arn:aws:elasticbeanstalk:us-east-1:0000000000:application/App3 @profile1 "), + arg: (*string)((len=122) "https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/application/overview?applicationName=App3"), + valid: (bool) true, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=8) "open-url" + }, + mods: (map[aw.ModKey]*aw.Modifier) (len=1) { + (aw.ModKey) (len=3) "cmd": (*aw.Modifier)({ + Key: (aw.ModKey) (len=3) "cmd", + arg: (*string)(), + subtitle: (*string)((len=21) "Copy URL to clipboard"), + valid: (bool) false, + icon: (*aw.Icon)(), + vars: (map[string]string) (len=1) { + (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" + } + }) + }, + icon: (*aw.Icon)({ + Value: (string) (len=27) "images/elasticbeanstalk.png", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/workflow.go b/workflow/workflow.go index f55891ab..fa1bf7eb 100644 --- a/workflow/workflow.go +++ b/workflow/workflow.go @@ -3,6 +3,7 @@ package workflow import ( "fmt" "log" + "net/http" "os" "os/exec" "strings" @@ -11,6 +12,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" aw "github.com/deanishe/awgo" "github.com/rkoval/alfred-aws-console-services-workflow/aliases" + "github.com/rkoval/alfred-aws-console-services-workflow/awsconfig" "github.com/rkoval/alfred-aws-console-services-workflow/awsworkflow" "github.com/rkoval/alfred-aws-console-services-workflow/parsers" "github.com/rkoval/alfred-aws-console-services-workflow/searchers" @@ -18,7 +20,7 @@ import ( "github.com/rkoval/alfred-aws-console-services-workflow/util" ) -func Run(wf *aw.Workflow, rawQuery string, cfg aws.Config, forceFetch, openAll bool, ymlPath string) { +func Run(wf *aw.Workflow, rawQuery string, transport http.RoundTripper, forceFetch, openAll bool, ymlPath string) { log.Println("using workflow cacheDir: " + wf.CacheDir()) log.Println("using workflow dataDir: " + wf.DataDir()) @@ -26,6 +28,42 @@ func Run(wf *aw.Workflow, rawQuery string, cfg aws.Config, forceFetch, openAll b query, awsServices := parser.Parse(ymlPath) defer finalize(wf, query) + log.Printf("using query: %#v", query) + + if query.RegionQuery != nil { + for _, region := range awsconfig.AllAWSRegions { + autocomplete := strings.Replace(rawQuery, aliases.OverrideAwsRegion+*query.RegionQuery, aliases.OverrideAwsRegion+region.Name+" ", 1) + wf.NewItem(region.Name). + Subtitle(region.Description). + Icon(aw.IconWeb). + Autocomplete(autocomplete). + UID(region.Name) + } + log.Printf("filtering with region override %q", *query.RegionQuery) + res := wf.Filter(*query.RegionQuery) + log.Printf("%d results match %q", len(res), *query.RegionQuery) + return + } + + if query.ProfileQuery != nil { + for _, profile := range awsconfig.GetAwsProfiles() { + autocomplete := strings.Replace(rawQuery, aliases.OverrideAwsProfile+*query.ProfileQuery, aliases.OverrideAwsProfile+profile.Name+" ", 1) + item := wf.NewItem(profile.Name). + Icon(aw.IconAccount). + Autocomplete(autocomplete). + UID(profile.Name) + + if profile.Region != "" { + item.Subtitle(fmt.Sprintf("🌎 %s", profile.Region)) + } + } + log.Printf("filtering with profile override %q", *query.ProfileQuery) + res := wf.Filter(*query.ProfileQuery) + log.Printf("%d results match %q", len(res), *query.ProfileQuery) + return + } + + cfg := awsworkflow.InitAWS(transport, query.ProfileOverride, query.GetRegionOverride()) searchArgs := searchutil.SearchArgs{ Cfg: cfg, ForceFetch: forceFetch, @@ -33,8 +71,6 @@ func Run(wf *aw.Workflow, rawQuery string, cfg aws.Config, forceFetch, openAll b Profile: util.GetProfile(cfg), } - log.Printf("using query: %#v", query) - if query.IsEmpty() { handleEmptyQuery(wf, searchArgs) return @@ -45,26 +81,6 @@ func Run(wf *aw.Workflow, rawQuery string, cfg aws.Config, forceFetch, openAll b return } - // TODO need to autocomplete correctly within services/subservices/searchers with respect to region - - if query.RegionQuery != nil { - for _, region := range awsworkflow.AllAWSRegions { - autocomplete := strings.Replace(rawQuery, aliases.OverrideAwsRegion+*query.RegionQuery, aliases.OverrideAwsRegion+region.Name+" ", 1) - wf.NewItem(region.Name). - Subtitle(region.Description). - Icon(aw.IconWeb). - Autocomplete(autocomplete). - UID(region.Name) - } - log.Printf("filtering with region override %q", *query.RegionQuery) - res := wf.Filter(*query.RegionQuery) - log.Printf("%d results match %q", len(res), *query.RegionQuery) - return - } else if query.RegionOverride != nil && (query.Service == nil || !query.Service.HasGlobalRegion) { - cfg.Region = query.RegionOverride.Name - searchArgs.Cfg.Region = query.RegionOverride.Name - } - if query.Service == nil || (!query.HasTrailingWhitespace && query.SubService == nil && !query.HasDefaultSearchAlias && query.RemainingQuery == "") { if query.Service == nil { searchArgs.Query = query.RemainingQuery @@ -122,7 +138,10 @@ func finalize(wf *aw.Workflow, query *parsers.Query) { subtitle := "" if query.RegionQuery != nil { title = "No matching regions found" - subtitle = "Try starting over with `$` again to see the full list" + subtitle = fmt.Sprintf("Try starting over with \"%s\" again to see the full list", aliases.OverrideAwsRegion) + } else if query.ProfileQuery != nil { + title = "No matching profiles found" + subtitle = fmt.Sprintf("Try starting over with \"%s\" again to see the full list", aliases.OverrideAwsProfile) } else { title = "No matching services found" subtitle = "Try another query (example: `aws ec2 instances`)" @@ -142,6 +161,7 @@ func handleEmptyQuery(wf *aw.Workflow, searchArgs searchutil.SearchArgs) { if searchArgs.Profile != "" { wf.NewItem("Using profile \"" + searchArgs.Profile + "\""). + Subtitle("Use \"" + aliases.OverrideAwsProfile + "\" to override for the current query"). Icon(aw.IconAccount) } diff --git a/workflow/workflow_test.go b/workflow/workflow_test.go index a2b89a5a..a12ab2c8 100644 --- a/workflow/workflow_test.go +++ b/workflow/workflow_test.go @@ -38,6 +38,42 @@ var tcs []testCase = []testCase{ { query: "$asdf asdf asdf", }, + { + query: "@", + }, + { + query: "@prof", + }, + { + query: "@profile1", + }, + { + query: "@asdf asdf asdf", + }, + { + query: "@$", + }, + { + query: "@ $", + }, + { + query: "$ @", + }, + { + query: "$ @ adsf asdf", + }, + { + query: "$us-east-1 @", + }, + { + query: "$us-east-1 @prof", + }, + { + query: "$us-east-1 @prof asdf asdf", + }, + { + query: "$us-east-1 @profile3 elasticbeanstalk", + }, { query: "alex", }, @@ -179,6 +215,72 @@ var tcs []testCase = []testCase{ query: "elasticbeanstalk applications arn:aws:elasticbeanstalk:us-east-1:0000000000:application/Ap $us-east-1 ", fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test }, + { + query: "@profile1 elasticbeanstalk", + }, + { + query: "@profile1 $us-east-2 elasticbeanstalk", + }, + { + query: "@profile1 elasticbeanstalk appli", + }, + { + query: "@profile1 elasticbeanstalk applications", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "@profile1 elasticbeanstalk applications ", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk @profile1 applications", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk @profile1 applications ", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk applications @profile1", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk applications @profile1 ", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk applications @profile1 Ap", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk applications @profile1 Ap ", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk applications App1 @profile1", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk applications App1 @prof", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk applications App1 @profile1 ", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk applications @profile1 arn:aws:elasticbeanstalk:us-east-1:0000000000:application/Ap", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + { + query: "elasticbeanstalk applications arn:aws:elasticbeanstalk:us-east-1:0000000000:application/Ap @profile1 ", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, + + { + query: "elasticbeanstalk applications @profile3 $us-east-1 ", + fixtureName: "../searchers/elastic_beanstalk_applications_test_us-east-1", // reuse test fixture from this other test + }, { query: "lambda", }, @@ -260,12 +362,21 @@ var tcs []testCase = []testCase{ { query: "eec2 $us-east-1", }, + { + query: "eec2 @profile1", + }, { query: "eec2 $us-east-1 ", }, + { + query: "eec2 @profile1 ", + }, { query: "$us-east-1 eec2", }, + { + query: "@profile1 eec2", + }, { query: "ec2", }, @@ -478,9 +589,9 @@ func testWorkflow(t *testing.T, tc testCase, forceFetch, snapshot bool) []*aw.It updater := &tests.MockAlfredUpdater{} wf := aw.New(aw.Update(updater)) - cfg, r := tests.NewAWSRecorderSession(tc.fixtureName) + r := tests.NewAWSRecorderSession(tc.fixtureName) defer tests.PanicOnError(r.Stop) - Run(wf, tc.query, cfg, forceFetch, false, "../console-services.yml") + Run(wf, tc.query, r, forceFetch, false, "../console-services.yml") if tc.deleteItemArgBeforeSnapshot { for i := range wf.Feedback.Items {