DanBUK
6 years ago
No known key found for this signature in database
GPG Key ID: 27052C4772FC4FA2
3 changed files with
13 additions and
0 deletions
-
DOCS.md
-
main.go
-
plugin.go
|
|
@ -222,5 +222,7 @@ role_arn_to_assume |
|
|
|
root_dir |
|
|
|
: The root directory where the terraform files live. When unset, the top level directory will be assumed. |
|
|
|
|
|
|
|
data_dir |
|
|
|
: The directory where terraform put's it's data files. When unset, .terraform assumed. (TF_DATA_DIR) |
|
|
|
parallelism |
|
|
|
: The number of concurrent operations as Terraform walks its graph. |
|
|
|
|
|
@ -73,6 +73,11 @@ func main() { |
|
|
|
Usage: "The root directory where the terraform files live. When unset, the top level directory will be assumed", |
|
|
|
EnvVar: "PLUGIN_ROOT_DIR", |
|
|
|
}, |
|
|
|
cli.StringFlag{ |
|
|
|
Name: "data_dir", |
|
|
|
Usage: "The directory where terraform put's it's data files. When unset, .terraform assumed. (TF_DATA_DIR)", |
|
|
|
EnvVar: "PLUGIN_DATA_DIR", |
|
|
|
}, |
|
|
|
cli.StringFlag{ |
|
|
|
Name: "secrets", |
|
|
|
Usage: "a map of secrets to pass to the Terraform `plan` and `apply` commands. Each value is passed as a `<key>=<ENV>` option", |
|
|
@ -145,6 +150,7 @@ func run(c *cli.Context) error { |
|
|
|
Sensitive: c.Bool("sensitive"), |
|
|
|
RoleARN: c.String("role_arn_to_assume"), |
|
|
|
RootDir: c.String("root_dir"), |
|
|
|
DataDir: c.String("data_dir"), |
|
|
|
Parallelism: c.Int("parallelism"), |
|
|
|
Targets: c.StringSlice("targets"), |
|
|
|
VarFiles: c.StringSlice("var_files"), |
|
|
|
|
|
@ -29,6 +29,7 @@ type ( |
|
|
|
Sensitive bool |
|
|
|
RoleARN string |
|
|
|
RootDir string |
|
|
|
DataDir string |
|
|
|
Parallelism int |
|
|
|
Targets []string |
|
|
|
VarFiles []string |
|
|
@ -71,6 +72,10 @@ func (p Plugin) Exec() error { |
|
|
|
assumeRole(p.Config.RoleARN) |
|
|
|
} |
|
|
|
|
|
|
|
if p.Config.DataDir != "" { |
|
|
|
os.Setenv("TF_DATA_DIR", p.Config.DataDir) |
|
|
|
} |
|
|
|
|
|
|
|
// writing the .netrc file with Github credentials in it.
|
|
|
|
err := writeNetrc(p.Netrc.Machine, p.Netrc.Login, p.Netrc.Password) |
|
|
|
if err != nil { |
|
|
|