Policies

1. List Policies

Retrieves a list of CoreStack Policies for a given tenant. ID in the output is referred as Policy ID

Syntax
(.venv)$ corestack policies-list

Parameters

None

Sample Output

2. View Policy

Retrieves a CoreStack Policy by its ID. Policy ID can be fetched from the output of policies-list command. Name, Description, Classification (Cost, Utilization, Security, Access etc.,), Created By, Updated By etc., will be available as output

Syntax
(.venv)$ corestack policy-show <policy_id>

Parameters

Attributes Description
policy_id Required.ID of the CoreStack Policy to be retrieved

Sample Output

3. Execute Policy

Executes a policy by its ID with the inputs (Request Body). Request body is expected to vary for each policy and the same can be identified using policy content retrieved as part of policy-show command

Syntax
(.venv)$ corestack policy-execute <policy_id> <body>

Parameters

Attributes Description
policy_id Required.ID of the CoreStack Policy to be executed
body Required. JSON content with the needed inputs to execute the policy
Example:
{
“service_accounts”: [{
“region”: “us-east-1”,
“id”: “59a508cf07e31206a6a3282b”
}]
}

Sample Output