Policy Groups
List Policy Groups
/api/orgs/{orgName}/policygroupsReturns a list of all Policy Groups for the organization. Policy Groups define which Policy Packs are enforced on which stacks, with configurable enforcement levels (advisory, mandatory, or disabled) per pack. Every organization has a default Policy Group, and additional groups can be created to apply different policy sets to different environments (e.g., stricter enforcement in production).
Request Parameters
orgNamestring path requiredThe organization name
Responses
- List of policy groups
- ↳
namestring requiredThe unique name of the policy group. - ↳
isOrgDefaultboolean requiredWhether this is the organization’s default policy group, applied to all stacks not in another group. - ↳
numStacksinteger requiredNumber of stacks assigned to this policy group. - ↳
numAccountsinteger optionalNumber of cloud accounts assigned to this policy group. - ↳
entityTypeenum requiredThe type of entity this policy group targets (e.g. stacks, accounts).Values:stacks,accounts - ↳
modeenum requiredThe enforcement mode of the policy group.Values:audit,preventative - ↳
numEnabledPolicyPacksinteger requiredNumber of policy packs currently enabled in this group.
New Policy Group
/api/orgs/{orgName}/policygroupsCreates a new Policy Group for an organization. Policy Groups define which Policy Packs are enforced on which stacks or cloud accounts, with configurable enforcement levels (advisory, mandatory, or disabled) per pack. This allows different policy strictness for different environments, such as advisory-only in development and mandatory in production.
Request Parameters
orgNamestring path requiredThe organization name
Request Body
namestring requiredThe name of the new policy group.entityTypeenum requiredThe type of entities this policy group applies to (stacks or accounts).Values:stacks,accountsmodeenum optionalThe enforcement mode for the policy group (audit or preventative). Defaults to ‘audit’ for account policy groups, ‘preventative’ for stack policy groups.Values:audit,preventativeagentPoolIdstring optionalAgent pool ID for policy evaluation. Defaults to Pulumi hosted pool if not specified.
Responses
Get Policy Group
/api/orgs/{orgName}/policygroups/{policyGroup}Returns the details of a specific Policy Group, including the list of Policy Packs applied to it and their enforcement levels (advisory, mandatory, or disabled), as well as the stacks or cloud accounts assigned to the group. Policy Groups enable targeted policy enforcement by associating sets of policies with specific infrastructure resources.
Request Parameters
orgNamestring path requiredThe organization namepolicyGroupstring path requiredThe policy group name
Responses
namestring requiredThe name of the policy group.isOrgDefaultboolean requiredTrue if this is either the default stacks or default accounts policy group for the organization.entityTypeenum requiredThe type of entities this policy group applies to (stacks or accounts).Values:stacks,accountsmodeenum requiredThe enforcement mode for the policy group (audit or preventative).Values:audit,preventative- List of stacks that are members of this policy group.
- ↳
namestring requiredThe name - ↳
routingProjectstring requiredThe routing project - List of policy packs that are applied to this policy group.
- ↳
namestring requiredThe name - ↳
displayNamestring requiredThe display name - ↳
versioninteger requiredThe version number - ↳
versionTagstring requiredThe version tag - ↳
configmap[string]object optionalThe configuration that is to be passed to the Policy Pack. This map ties Policies with their configuration. - ↳
environmentsarray[string] optionalReferences to ESC environments to use for this policy pack. accountsarray[string] requiredList of Insights account names that are members of this policy group.agentPoolIdstring optionalAgent pool ID for audit policy evaluation. Defaults to Pulumi hosted pool if not specified.
Update Policy Group
/api/orgs/{orgName}/policygroups/{policyGroup}Updates a Policy Group’s configuration. This multi-purpose endpoint supports several operations in a single request via different body fields:
newName: rename the policy groupaddStack/removeStack: add or remove stacks (withnameandroutingProjectfields)addPolicyPack/removePolicyPack: add or remove policy packs (withname,version,versionTag, and optionalconfig)addInsightsAccount/removeInsightsAccount: add or remove Insights accounts
Enforcement levels for policy packs are advisory, mandatory, or disabled.
Request Parameters
orgNamestring path requiredThe organization namepolicyGroupstring path requiredThe policy group name
Request Body
- An Insights account to add to the policy group.
- ↳
idstring requiredID of the account. - ↳
namestring requiredThe name of the account. - The user with ownership of this Insights account
- ↳
providerstring requiredThe cloud provider for the account (e.g., aws, gcp, azure-native). - ↳
providerVersionstring optionalThe version of the Pulumi provider package used for discovery. - ↳
providerEnvRefstring optionalReference to an ESC environment containing provider credentials, in the format ‘project/environment’ with an optional @version suffix. - ↳
scheduledScanEnabledboolean requiredIf true, the account is scheduled for recurring discovery. - ↳
agentPoolIDstring optionalThe ID of the agent pool to run account discovery workflows. If not specified, discovery will use the default agent pool. - ↳
providerConfigobject optionalProvider-specific configuration for the account. - Status of the last discovery scan for this account.
newNamestring optionalThe new name to assign to the policy group.- A stack to add to the policy group.
- ↳
namestring requiredThe name - ↳
routingProjectstring requiredThe routing project - An Insights account to remove from the policy group.
- ↳
idstring requiredID of the account. - ↳
namestring requiredThe name of the account. - The user with ownership of this Insights account
- ↳
providerstring requiredThe cloud provider for the account (e.g., aws, gcp, azure-native). - ↳
providerVersionstring optionalThe version of the Pulumi provider package used for discovery. - ↳
providerEnvRefstring optionalReference to an ESC environment containing provider credentials, in the format ‘project/environment’ with an optional @version suffix. - ↳
scheduledScanEnabledboolean requiredIf true, the account is scheduled for recurring discovery. - ↳
agentPoolIDstring optionalThe ID of the agent pool to run account discovery workflows. If not specified, discovery will use the default agent pool. - ↳
providerConfigobject optionalProvider-specific configuration for the account. - Status of the last discovery scan for this account.
agentPoolIdstring optionalAgent pool ID for audit policy evaluation. Set to empty string to clear, omit to leave unchanged.- A stack to remove from the policy group.
- ↳
namestring requiredThe name - ↳
routingProjectstring requiredThe routing project - A policy pack to enable for the policy group.
- ↳
namestring requiredThe name - ↳
displayNamestring requiredThe display name - ↳
versioninteger requiredThe version number - ↳
versionTagstring requiredThe version tag - ↳
configmap[string]object optionalThe configuration that is to be passed to the Policy Pack. This map ties Policies with their configuration. - ↳
environmentsarray[string] optionalReferences to ESC environments to use for this policy pack. - A policy pack to disable for the policy group.
- ↳
namestring requiredThe name - ↳
displayNamestring requiredThe display name - ↳
versioninteger requiredThe version number - ↳
versionTagstring requiredThe version tag - ↳
configmap[string]object optionalThe configuration that is to be passed to the Policy Pack. This map ties Policies with their configuration. - ↳
environmentsarray[string] optionalReferences to ESC environments to use for this policy pack.
Responses
Delete Policy Group
/api/orgs/{orgName}/policygroups/{policyGroup}Deletes a Policy Group from an organization. A Policy Group defines which Policy Packs are enforced on which stacks, with configurable enforcement levels (advisory, mandatory, or disabled) per pack. The organization’s default Policy Group cannot be deleted. Deleting a Policy Group removes all policy enforcement associations for the stacks that were assigned to it.
Request Parameters
orgNamestring path requiredThe organization namepolicyGroupstring path requiredThe policy group name
Responses
Batch Update Policy Group
/api/orgs/{orgName}/policygroups/{policyGroup}/batchBatchUpdatePolicyGroup applies multiple update operations to the Policy Group efficiently. Each operation in the list uses the same fields as UpdatePolicyGroupRequest. Operations are grouped by type (adds, removes) and processed in batches for efficiency.
Request Parameters
orgNamestring path requiredThe organization namepolicyGroupstring path requiredThe policy group name
Request Body
Responses
Get Policy Group Metadata
/api/orgs/{orgName}/policygroups/metadataReturns high-level policy protection metrics for an organization, including the number of stacks protected by policy enforcement, the total number of Policy Groups, and overall policy coverage statistics.
Request Parameters
orgNamestring path requiredThe organization name
Responses
ProtectedStacksinteger requiredNumber of unique stacks in any policy group (preventative or audit). Deprecated: Use PreventativeStacks and AuditStacks for breakdown by modeProtectedStackResourcesinteger requiredNumber of resources in unique stacks in any policy group (preventative or audit). Deprecated: Use PreventativeStackResources and AuditStackResources for breakdown by modePreventativeStacksinteger requiredNumber of stacks in preventative policy groupsPreventativeStackResourcesinteger requiredNumber of resources in stacks in preventative policy groupsAuditStacksinteger requiredNumber of stacks in audit policy groupsAuditStackResourcesinteger requiredNumber of resources in stacks in audit policy groupsTotalStacksinteger requiredTotal number of stacks in the organizationTotalStackResourcesinteger requiredTotal number of resources in all stacksProtectedAccountsinteger requiredNumber of accounts in policy groupsProtectedAccountResourcesinteger requiredNumber of resources in accounts in policy groupsTotalAccountsinteger requiredTotal number of accounts in the organizationTotalAccountResourcesinteger requiredTotal number of resources in all accounts
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.