Policies Overview
Text size
Policies Overview
The stackgen policies command is used to list, inspect, and upload resource restriction policies from the CLI. Use stackgen policies resource-restriction instead of stackgen upload resource-restriction-policy (deprecated).
Usage
stackgen policies [command]
Sub Commands
Resource restriction
List, inspect by ID or exact name (--id / --name), or upload policies that limit which resources users can add to topologies.
| Subcommand | Description |
|---|---|
list | List resource restriction policies, or one policy with --id or --name. Alias: ls. |
upload | Upload a resource restriction policy from a JSON file. |
Flags
| Flag | Description |
|---|---|
-h, --help | Help for policies. |
See Global CLI flags for --interactive, --log, --output, --project, and --stackgen-home.
Examples
List all resource restriction policies
stackgen policies resource-restriction list
The above command will display every resource restriction policy in the project.
List one policy by ID or name
stackgen policies resource-restriction list --id <policy-id>
stackgen policies resource-restriction list --name <policy-name>
The above command will show only the matching policy.
Upload a policy from a JSON file
stackgen policies resource-restriction upload -p /path/to/resource_restriction_policy.json
The above command will:
- Read the restriction policy from the specified JSON file.
- Upload the policy to StackGen.