Skip to content

Commit 4dd94cc

Browse files
authored
docs(cli): declare --apply and --output on lacework generate (#1493)
* docs(cli): declare --apply and --output on lacework generate * docs(cli): clean up code
1 parent af026bb commit 4dd94cc

File tree

9 files changed

+33
-9
lines changed

9 files changed

+33
-9
lines changed

cli/cmd/generate.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var (
3131
Long: `Generate code to onboard your account and deploy Lacework into various cloud environments.
3232
3333
This command creates Infrastructure as Code (IaC) in the form of Terraform HCL, with the option of running
34-
Terraform and deploying Lacework into AWS, Azure, or GCP.
34+
Terraform and deploying Lacework into AWS, Azure, GCP or OCI.
3535
`,
3636
}
3737
)
@@ -50,6 +50,18 @@ func init() {
5050

5151
// aws subcommands
5252
generateAwsTfCommand.AddCommand(generateAwsControlTowerTfCommand)
53+
54+
// Common flags
55+
generateTfCommand.PersistentFlags().Bool(
56+
"apply",
57+
false,
58+
"run terraform apply without executing plan or prompting",
59+
)
60+
generateTfCommand.PersistentFlags().String(
61+
"output",
62+
"",
63+
"location to write generated content",
64+
)
5365
}
5466

5567
type SurveyQuestionWithValidationArgs struct {

cli/cmd/generate_cloud_account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var (
1010
Long: `Generate cloud-account IaC to deploy Lacework into a cloud environment.
1111
1212
This command creates Infrastructure as Code (IaC) in the form of Terraform HCL, with the option of running
13-
Terraform and deploying Lacework into AWS, Azure, or GCP.
13+
Terraform and deploying Lacework into AWS, Azure, GCP or OCI.
1414
`,
1515
}
1616
)

cli/docs/lacework_generate.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ Generate code to onboard your account
1313
Generate code to onboard your account and deploy Lacework into various cloud environments.
1414

1515
This command creates Infrastructure as Code (IaC) in the form of Terraform HCL, with the option of running
16-
Terraform and deploying Lacework into AWS, Azure, or GCP.
16+
Terraform and deploying Lacework into AWS, Azure, GCP or OCI.
1717

1818

1919
### Options
2020

2121
```
22-
-h, --help help for generate
22+
--apply run terraform apply without executing plan or prompting
23+
-h, --help help for generate
24+
--output string location to write generated content
2325
```
2426

2527
### Options inherited from parent commands

cli/docs/lacework_generate_cloud-account.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Generate cloud integration IaC
1313
Generate cloud-account IaC to deploy Lacework into a cloud environment.
1414

1515
This command creates Infrastructure as Code (IaC) in the form of Terraform HCL, with the option of running
16-
Terraform and deploying Lacework into AWS, Azure, or GCP.
16+
Terraform and deploying Lacework into AWS, Azure, GCP or OCI.
1717

1818

1919
### Options
@@ -29,12 +29,14 @@ Terraform and deploying Lacework into AWS, Azure, or GCP.
2929
-k, --api_key string access key id
3030
-s, --api_secret string secret access key
3131
--api_token string access token (replaces the use of api_key and api_secret)
32+
--apply run terraform apply without executing plan or prompting
3233
--debug turn on debug logging
3334
--json switch commands output from human-readable to json format
3435
--nocache turn off caching
3536
--nocolor turn off colors
3637
--noninteractive turn off interactive mode (disable spinners, prompts, etc.)
3738
--organization access organization level data sets (org admins only)
39+
--output string location to write generated content
3840
-p, --profile string switch between profiles configured at ~/.lacework.toml
3941
--subaccount string sub-account name inside your organization (org admins only)
4042
```

cli/docs/lacework_generate_k8s.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ Terraform and deploying Lacework into GKE.
2929
-k, --api_key string access key id
3030
-s, --api_secret string secret access key
3131
--api_token string access token (replaces the use of api_key and api_secret)
32+
--apply run terraform apply without executing plan or prompting
3233
--debug turn on debug logging
3334
--json switch commands output from human-readable to json format
3435
--nocache turn off caching
3536
--nocolor turn off colors
3637
--noninteractive turn off interactive mode (disable spinners, prompts, etc.)
3738
--organization access organization level data sets (org admins only)
39+
--output string location to write generated content
3840
-p, --profile string switch between profiles configured at ~/.lacework.toml
3941
--subaccount string sub-account name inside your organization (org admins only)
4042
```

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ require (
5959
github.com/gabriel-vasile/mimetype v1.4.2
6060
github.com/go-git/go-git/v5 v5.5.2
6161
github.com/go-resty/resty/v2 v2.10.0
62+
github.com/golang/protobuf v1.5.3
6263
github.com/google/uuid v1.3.0
6364
github.com/hashicorp/consul/sdk v0.13.1
6465
github.com/mattn/go-isatty v0.0.18
@@ -101,7 +102,6 @@ require (
101102
github.com/go-git/gcfg v1.5.0 // indirect
102103
github.com/go-git/go-billy/v5 v5.4.0 // indirect
103104
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
104-
github.com/golang/protobuf v1.5.3 // indirect
105105
github.com/google/btree v1.1.2 // indirect
106106
github.com/google/go-cmp v0.5.9 // indirect
107107
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect

integration/test_resources/help/generate

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Generate code to onboard your account and deploy Lacework into various cloud environments.
22

33
This command creates Infrastructure as Code (IaC) in the form of Terraform HCL, with the option of running
4-
Terraform and deploying Lacework into AWS, Azure, or GCP.
4+
Terraform and deploying Lacework into AWS, Azure, GCP or OCI.
55

66
Usage:
77
lacework generate [command]
@@ -14,7 +14,9 @@ Available Commands:
1414
k8s Generate Kubernetes integration IaC
1515

1616
Flags:
17-
-h, --help help for generate
17+
--apply run terraform apply without executing plan or prompting
18+
-h, --help help for generate
19+
--output string location to write generated content
1820

1921
Global Flags:
2022
-a, --account string account subdomain of URL (i.e. <ACCOUNT>.lacework.net)

integration/test_resources/help/generate_cloud-account

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Generate cloud-account IaC to deploy Lacework into a cloud environment.
22

33
This command creates Infrastructure as Code (IaC) in the form of Terraform HCL, with the option of running
4-
Terraform and deploying Lacework into AWS, Azure, or GCP.
4+
Terraform and deploying Lacework into AWS, Azure, GCP or OCI.
55

66
Usage:
77
lacework generate cloud-account [command]
@@ -23,12 +23,14 @@ Global Flags:
2323
-k, --api_key string access key id
2424
-s, --api_secret string secret access key
2525
--api_token string access token (replaces the use of api_key and api_secret)
26+
--apply run terraform apply without executing plan or prompting
2627
--debug turn on debug logging
2728
--json switch commands output from human-readable to json format
2829
--nocache turn off caching
2930
--nocolor turn off colors
3031
--noninteractive turn off interactive mode (disable spinners, prompts, etc.)
3132
--organization access organization level data sets (org admins only)
33+
--output string location to write generated content
3234
-p, --profile string switch between profiles configured at ~/.lacework.toml
3335
--subaccount string sub-account name inside your organization (org admins only)
3436

integration/test_resources/help/generate_k8s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ Global Flags:
1818
-k, --api_key string access key id
1919
-s, --api_secret string secret access key
2020
--api_token string access token (replaces the use of api_key and api_secret)
21+
--apply run terraform apply without executing plan or prompting
2122
--debug turn on debug logging
2223
--json switch commands output from human-readable to json format
2324
--nocache turn off caching
2425
--nocolor turn off colors
2526
--noninteractive turn off interactive mode (disable spinners, prompts, etc.)
2627
--organization access organization level data sets (org admins only)
28+
--output string location to write generated content
2729
-p, --profile string switch between profiles configured at ~/.lacework.toml
2830
--subaccount string sub-account name inside your organization (org admins only)
2931

0 commit comments

Comments
 (0)