Skip to content

Commit ff56fe4

Browse files
authored
Merge pull request #473 from simonmcc/add-aws-sam-cli
feat(aws): Add support AWS SAM CLI
2 parents 6e74fd8 + 17dea8c commit ff56fe4

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

plugins/aws/plugin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func New() schema.Plugin {
1818
Executables: []schema.Executable{
1919
AWSCLI(),
2020
AWSCDKToolkit(),
21+
AWSSAMCLI(),
2122
eksctlCLI(),
2223
},
2324
}

plugins/aws/sam.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package aws
2+
3+
import (
4+
"github.com/1Password/shell-plugins/sdk"
5+
"github.com/1Password/shell-plugins/sdk/needsauth"
6+
"github.com/1Password/shell-plugins/sdk/schema"
7+
"github.com/1Password/shell-plugins/sdk/schema/credname"
8+
)
9+
10+
func AWSSAMCLI() schema.Executable {
11+
return schema.Executable{
12+
Name: "AWS SAM CLI",
13+
Runs: []string{"sam"},
14+
DocsURL: sdk.URL("https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/reference-sam-cli.html"),
15+
NeedsAuth: needsauth.IfAll(
16+
needsauth.NotForHelpOrVersion(),
17+
needsauth.NotWithoutArgs(),
18+
// skip 1Password authentication for "sam docs", "sam init", "sam local" and "sam validate" and their subcommands
19+
needsauth.NotWhenContainsArgs("docs"),
20+
needsauth.NotWhenContainsArgs("init"),
21+
needsauth.NotWhenContainsArgs("local"),
22+
needsauth.NotWhenContainsArgs("validate"),
23+
),
24+
Uses: []schema.CredentialUsage{
25+
{
26+
Name: credname.AccessKey,
27+
Provisioner: CLIProvisioner{},
28+
},
29+
},
30+
}
31+
}

0 commit comments

Comments
 (0)