-
Notifications
You must be signed in to change notification settings - Fork 258
Expand file tree
/
Copy pathterraform.go
More file actions
42 lines (40 loc) · 1.15 KB
/
terraform.go
File metadata and controls
42 lines (40 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package terraform
import (
"github.com/1Password/shell-plugins/sdk"
"github.com/1Password/shell-plugins/sdk/needsauth"
"github.com/1Password/shell-plugins/sdk/schema"
)
func TerraformCLI() schema.Executable {
return schema.Executable{
Name: "Terraform CLI",
Runs: []string{"terraform"},
DocsURL: sdk.URL("https://developer.hashicorp.com/terraform/cli"),
NeedsAuth: needsauth.IfAll(
needsauth.NotForHelpOrVersion(),
needsauth.NotWithoutArgs(),
),
Uses: []schema.CredentialUsage{
{
Description: "Credentials to use within the Terraform project",
SelectFrom: &schema.CredentialSelection{
ID: "project",
IncludeAllCredentials: true,
AllowMultiple: true,
},
Optional: true,
NeedsAuth: needsauth.IfAny(
needsauth.ForCommand("refresh"),
needsauth.ForCommand("init"),
needsauth.ForCommand("state"),
needsauth.ForCommand("plan"),
needsauth.ForCommand("apply"),
needsauth.ForCommand("destroy"),
needsauth.ForCommand("import"),
needsauth.ForCommand("test"),
needsauth.ForCommand("output"),
needsauth.ForCommand("taint"),
),
},
},
}
}