Skip to content

Commit a031886

Browse files
feat(albwaf): onboard albwaf config
Relates to STACKITCLI-444
1 parent 1f3a279 commit a031886

16 files changed

Lines changed: 1670 additions & 0 deletions

docs/stackit_beta_alb-waf.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ stackit beta alb-waf [flags]
3030
### SEE ALSO
3131

3232
* [stackit beta](./stackit_beta.md) - Contains beta STACKIT CLI commands
33+
* [stackit beta alb-waf config](./stackit_beta_alb-waf_config.md) - Provides functionality for WAF configurations of the ALB WAF
3334
* [stackit beta alb-waf custom-rule-group](./stackit_beta_alb-waf_custom-rule-group.md) - Provides functionality for custom rule groups of the ALB WAF
3435
* [stackit beta alb-waf managed-rule-set](./stackit_beta_alb-waf_managed-rule-set.md) - Provides functionality for managed rule sets of the ALB WAF
3536

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## stackit beta alb-waf config
2+
3+
Provides functionality for WAF configurations of the ALB WAF
4+
5+
### Synopsis
6+
7+
Provides functionality for Web Application Firewall (WAF) configurations for application loadbalancers.
8+
9+
```
10+
stackit beta alb-waf config [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit beta alb-waf config"
17+
```
18+
19+
### Options inherited from parent commands
20+
21+
```
22+
-y, --assume-yes If set, skips all confirmation prompts
23+
--async If set, runs the command asynchronously
24+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
25+
-p, --project-id string Project ID
26+
--region string Target region for region-specific requests
27+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
28+
```
29+
30+
### SEE ALSO
31+
32+
* [stackit beta alb-waf](./stackit_beta_alb-waf.md) - Manages the Web Application Firewall (WAF) for application loadbalancers
33+
* [stackit beta alb-waf config create](./stackit_beta_alb-waf_config_create.md) - Creates an ALB WAF configuration
34+
* [stackit beta alb-waf config delete](./stackit_beta_alb-waf_config_delete.md) - Deletes an ALB WAF configuration
35+
* [stackit beta alb-waf config describe](./stackit_beta_alb-waf_config_describe.md) - Shows details of an ALB WAF configuration
36+
* [stackit beta alb-waf config list](./stackit_beta_alb-waf_config_list.md) - Lists all ALB WAF configurations
37+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
## stackit beta alb-waf config create
2+
3+
Creates an ALB WAF configuration
4+
5+
### Synopsis
6+
7+
Creates a STACKIT Application Load Balancer (ALB) Web Application Firewall (WAF) configuration.
8+
9+
```
10+
stackit beta alb-waf config create [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Create an ALB WAF configuration with name "my-waf-config"
17+
$ stackit beta alb-waf config create --name my-waf-config
18+
19+
Create an ALB WAF configuration with a managed rule set, a custom rule group and labels
20+
$ stackit beta alb-waf config create --name my-waf-config --managed-rule-set-name my-managed-rule-set --custom-rule-group-name my-custom-rule-group --labels key1=value1,key2=value2
21+
```
22+
23+
### Options
24+
25+
```
26+
--custom-rule-group-name string Name of the custom rule group configuration to attach to the WAF
27+
-h, --help Help for "stackit beta alb-waf config create"
28+
--labels stringToString Labels are key-value string pairs which can be attached to the WAF configuration. E.g. '--labels key1=value1,key2=value2,...' (default [])
29+
--managed-rule-set-name string Name of the managed rule set configuration to attach to the WAF
30+
--name string Name of the WAF configuration
31+
```
32+
33+
### Options inherited from parent commands
34+
35+
```
36+
-y, --assume-yes If set, skips all confirmation prompts
37+
--async If set, runs the command asynchronously
38+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
39+
-p, --project-id string Project ID
40+
--region string Target region for region-specific requests
41+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
42+
```
43+
44+
### SEE ALSO
45+
46+
* [stackit beta alb-waf config](./stackit_beta_alb-waf_config.md) - Provides functionality for WAF configurations of the ALB WAF
47+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## stackit beta alb-waf config delete
2+
3+
Deletes an ALB WAF configuration
4+
5+
### Synopsis
6+
7+
Deletes a STACKIT Application Load Balancer (ALB) Web Application Firewall (WAF) configuration.
8+
9+
```
10+
stackit beta alb-waf config delete NAME [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Delete an ALB WAF configuration with name "my-waf-config"
17+
$ stackit beta alb-waf config delete my-waf-config
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit beta alb-waf config delete"
24+
```
25+
26+
### Options inherited from parent commands
27+
28+
```
29+
-y, --assume-yes If set, skips all confirmation prompts
30+
--async If set, runs the command asynchronously
31+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
32+
-p, --project-id string Project ID
33+
--region string Target region for region-specific requests
34+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
35+
```
36+
37+
### SEE ALSO
38+
39+
* [stackit beta alb-waf config](./stackit_beta_alb-waf_config.md) - Provides functionality for WAF configurations of the ALB WAF
40+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## stackit beta alb-waf config describe
2+
3+
Shows details of an ALB WAF configuration
4+
5+
### Synopsis
6+
7+
Shows details of a STACKIT Application Load Balancer (ALB) Web Application Firewall (WAF) configuration.
8+
9+
```
10+
stackit beta alb-waf config describe NAME [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Show details of an ALB WAF configuration with name "my-waf-config"
17+
$ stackit beta alb-waf config describe my-waf-config
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit beta alb-waf config describe"
24+
```
25+
26+
### Options inherited from parent commands
27+
28+
```
29+
-y, --assume-yes If set, skips all confirmation prompts
30+
--async If set, runs the command asynchronously
31+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
32+
-p, --project-id string Project ID
33+
--region string Target region for region-specific requests
34+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
35+
```
36+
37+
### SEE ALSO
38+
39+
* [stackit beta alb-waf config](./stackit_beta_alb-waf_config.md) - Provides functionality for WAF configurations of the ALB WAF
40+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## stackit beta alb-waf config list
2+
3+
Lists all ALB WAF configurations
4+
5+
### Synopsis
6+
7+
Lists all STACKIT Application Load Balancer (ALB) Web Application Firewall (WAF) configurations.
8+
9+
```
10+
stackit beta alb-waf config list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
List all ALB WAF configurations
17+
$ stackit beta alb-waf config list
18+
19+
List the first 10 ALB WAF configurations
20+
$ stackit beta alb-waf config list --limit=10
21+
```
22+
23+
### Options
24+
25+
```
26+
-h, --help Help for "stackit beta alb-waf config list"
27+
--limit int Limit the output to the first n elements
28+
```
29+
30+
### Options inherited from parent commands
31+
32+
```
33+
-y, --assume-yes If set, skips all confirmation prompts
34+
--async If set, runs the command asynchronously
35+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
36+
-p, --project-id string Project ID
37+
--region string Target region for region-specific requests
38+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
39+
```
40+
41+
### SEE ALSO
42+
43+
* [stackit beta alb-waf config](./stackit_beta_alb-waf_config.md) - Provides functionality for WAF configurations of the ALB WAF
44+

internal/cmd/beta/alb-waf/alb-waf.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package albwaf
22

33
import (
4+
config "github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/config"
45
customrulegroup "github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/custom-rule-group"
56
managedruleset "github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set"
67
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
@@ -27,5 +28,6 @@ func addSubcommands(cmd *cobra.Command, params *types.CmdParams) {
2728
cmd.AddCommand(
2829
managedruleset.NewCmd(params),
2930
customrulegroup.NewCmd(params),
31+
config.NewCmd(params),
3032
)
3133
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package config
2+
3+
import (
4+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/config/create"
5+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/config/delete"
6+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/config/describe"
7+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/config/list"
8+
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
9+
"github.com/stackitcloud/stackit-cli/internal/pkg/types"
10+
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
11+
12+
"github.com/spf13/cobra"
13+
)
14+
15+
func NewCmd(params *types.CmdParams) *cobra.Command {
16+
cmd := &cobra.Command{
17+
Use: "config",
18+
Short: "Provides functionality for WAF configurations of the ALB WAF",
19+
Long: "Provides functionality for Web Application Firewall (WAF) configurations for application loadbalancers.",
20+
Args: args.NoArgs,
21+
Run: utils.CmdHelp,
22+
}
23+
addSubcommands(cmd, params)
24+
return cmd
25+
}
26+
27+
func addSubcommands(cmd *cobra.Command, params *types.CmdParams) {
28+
cmd.AddCommand(create.NewCmd(params))
29+
cmd.AddCommand(delete.NewCmd(params))
30+
cmd.AddCommand(describe.NewCmd(params))
31+
cmd.AddCommand(list.NewCmd(params))
32+
}

0 commit comments

Comments
 (0)