azure-native.authorization.getPolicyAssignment
Explore with Pulumi AI
This operation retrieves a single policy assignment, given its name and the scope it was created at. API Version: 2020-09-01.
Using getPolicyAssignment
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getPolicyAssignment(args: GetPolicyAssignmentArgs, opts?: InvokeOptions): Promise<GetPolicyAssignmentResult>
function getPolicyAssignmentOutput(args: GetPolicyAssignmentOutputArgs, opts?: InvokeOptions): Output<GetPolicyAssignmentResult>
def get_policy_assignment(policy_assignment_name: Optional[str] = None,
scope: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPolicyAssignmentResult
def get_policy_assignment_output(policy_assignment_name: Optional[pulumi.Input[str]] = None,
scope: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPolicyAssignmentResult]
func LookupPolicyAssignment(ctx *Context, args *LookupPolicyAssignmentArgs, opts ...InvokeOption) (*LookupPolicyAssignmentResult, error)
func LookupPolicyAssignmentOutput(ctx *Context, args *LookupPolicyAssignmentOutputArgs, opts ...InvokeOption) LookupPolicyAssignmentResultOutput
> Note: This function is named LookupPolicyAssignment
in the Go SDK.
public static class GetPolicyAssignment
{
public static Task<GetPolicyAssignmentResult> InvokeAsync(GetPolicyAssignmentArgs args, InvokeOptions? opts = null)
public static Output<GetPolicyAssignmentResult> Invoke(GetPolicyAssignmentInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPolicyAssignmentResult> getPolicyAssignment(GetPolicyAssignmentArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azure-native:authorization:getPolicyAssignment
arguments:
# arguments dictionary
The following arguments are supported:
- Policy
Assignment stringName The name of the policy assignment to get.
- Scope string
The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
- Policy
Assignment stringName The name of the policy assignment to get.
- Scope string
The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
- policy
Assignment StringName The name of the policy assignment to get.
- scope String
The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
- policy
Assignment stringName The name of the policy assignment to get.
- scope string
The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
- policy_
assignment_ strname The name of the policy assignment to get.
- scope str
The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
- policy
Assignment StringName The name of the policy assignment to get.
- scope String
The scope of the policy assignment. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
getPolicyAssignment Result
The following output properties are available:
- Id string
The ID of the policy assignment.
- Name string
The name of the policy assignment.
- Scope string
The scope for the policy assignment.
- Type string
The type of the policy assignment.
- Description string
This message will be part of response in case of policy violation.
- Display
Name string The display name of the policy assignment.
- Enforcement
Mode string The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
- Identity
Pulumi.
Azure Native. Authorization. Outputs. Identity Response The managed identity associated with the policy assignment.
- Location string
The location of the policy assignment. Only required when utilizing managed identity.
- Metadata object
The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
- Non
Compliance List<Pulumi.Messages Azure Native. Authorization. Outputs. Non Compliance Message Response> The messages that describe why a resource is non-compliant with the policy.
- Not
Scopes List<string> The policy's excluded scopes.
- Parameters
Dictionary<string, Pulumi.
Azure Native. Authorization. Outputs. Parameter Values Value Response> The parameter values for the assigned policy rule. The keys are the parameter names.
- Policy
Definition stringId The ID of the policy definition or policy set definition being assigned.
- Id string
The ID of the policy assignment.
- Name string
The name of the policy assignment.
- Scope string
The scope for the policy assignment.
- Type string
The type of the policy assignment.
- Description string
This message will be part of response in case of policy violation.
- Display
Name string The display name of the policy assignment.
- Enforcement
Mode string The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
- Identity
Identity
Response The managed identity associated with the policy assignment.
- Location string
The location of the policy assignment. Only required when utilizing managed identity.
- Metadata interface{}
The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
- Non
Compliance []NonMessages Compliance Message Response The messages that describe why a resource is non-compliant with the policy.
- Not
Scopes []string The policy's excluded scopes.
- Parameters
map[string]Parameter
Values Value Response The parameter values for the assigned policy rule. The keys are the parameter names.
- Policy
Definition stringId The ID of the policy definition or policy set definition being assigned.
- id String
The ID of the policy assignment.
- name String
The name of the policy assignment.
- scope String
The scope for the policy assignment.
- type String
The type of the policy assignment.
- description String
This message will be part of response in case of policy violation.
- display
Name String The display name of the policy assignment.
- enforcement
Mode String The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
- identity
Identity
Response The managed identity associated with the policy assignment.
- location String
The location of the policy assignment. Only required when utilizing managed identity.
- metadata Object
The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
- non
Compliance List<NonMessages Compliance Message Response> The messages that describe why a resource is non-compliant with the policy.
- not
Scopes List<String> The policy's excluded scopes.
- parameters
Map<String,Parameter
Values Value Response> The parameter values for the assigned policy rule. The keys are the parameter names.
- policy
Definition StringId The ID of the policy definition or policy set definition being assigned.
- id string
The ID of the policy assignment.
- name string
The name of the policy assignment.
- scope string
The scope for the policy assignment.
- type string
The type of the policy assignment.
- description string
This message will be part of response in case of policy violation.
- display
Name string The display name of the policy assignment.
- enforcement
Mode string The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
- identity
Identity
Response The managed identity associated with the policy assignment.
- location string
The location of the policy assignment. Only required when utilizing managed identity.
- metadata any
The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
- non
Compliance NonMessages Compliance Message Response[] The messages that describe why a resource is non-compliant with the policy.
- not
Scopes string[] The policy's excluded scopes.
- parameters
{[key: string]: Parameter
Values Value Response} The parameter values for the assigned policy rule. The keys are the parameter names.
- policy
Definition stringId The ID of the policy definition or policy set definition being assigned.
- id str
The ID of the policy assignment.
- name str
The name of the policy assignment.
- scope str
The scope for the policy assignment.
- type str
The type of the policy assignment.
- description str
This message will be part of response in case of policy violation.
- display_
name str The display name of the policy assignment.
- enforcement_
mode str The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
- identity
Identity
Response The managed identity associated with the policy assignment.
- location str
The location of the policy assignment. Only required when utilizing managed identity.
- metadata Any
The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
- non_
compliance_ Sequence[Nonmessages Compliance Message Response] The messages that describe why a resource is non-compliant with the policy.
- not_
scopes Sequence[str] The policy's excluded scopes.
- parameters
Mapping[str, Parameter
Values Value Response] The parameter values for the assigned policy rule. The keys are the parameter names.
- policy_
definition_ strid The ID of the policy definition or policy set definition being assigned.
- id String
The ID of the policy assignment.
- name String
The name of the policy assignment.
- scope String
The scope for the policy assignment.
- type String
The type of the policy assignment.
- description String
This message will be part of response in case of policy violation.
- display
Name String The display name of the policy assignment.
- enforcement
Mode String The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
- identity Property Map
The managed identity associated with the policy assignment.
- location String
The location of the policy assignment. Only required when utilizing managed identity.
- metadata Any
The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.
- non
Compliance List<Property Map>Messages The messages that describe why a resource is non-compliant with the policy.
- not
Scopes List<String> The policy's excluded scopes.
- parameters Map<Property Map>
The parameter values for the assigned policy rule. The keys are the parameter names.
- policy
Definition StringId The ID of the policy definition or policy set definition being assigned.
Supporting Types
IdentityResponse
- Principal
Id string The principal ID of the resource identity.
- Tenant
Id string The tenant ID of the resource identity.
- Type string
The identity type. This is the only required field when adding a system assigned identity to a resource.
- Principal
Id string The principal ID of the resource identity.
- Tenant
Id string The tenant ID of the resource identity.
- Type string
The identity type. This is the only required field when adding a system assigned identity to a resource.
- principal
Id String The principal ID of the resource identity.
- tenant
Id String The tenant ID of the resource identity.
- type String
The identity type. This is the only required field when adding a system assigned identity to a resource.
- principal
Id string The principal ID of the resource identity.
- tenant
Id string The tenant ID of the resource identity.
- type string
The identity type. This is the only required field when adding a system assigned identity to a resource.
- principal_
id str The principal ID of the resource identity.
- tenant_
id str The tenant ID of the resource identity.
- type str
The identity type. This is the only required field when adding a system assigned identity to a resource.
- principal
Id String The principal ID of the resource identity.
- tenant
Id String The tenant ID of the resource identity.
- type String
The identity type. This is the only required field when adding a system assigned identity to a resource.
NonComplianceMessageResponse
- Message string
A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.
- Policy
Definition stringReference Id The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.
- Message string
A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.
- Policy
Definition stringReference Id The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.
- message String
A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.
- policy
Definition StringReference Id The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.
- message string
A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.
- policy
Definition stringReference Id The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.
- message str
A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.
- policy_
definition_ strreference_ id The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.
- message String
A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.
- policy
Definition StringReference Id The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.
ParameterValuesValueResponse
- Value object
The value of the parameter.
- Value interface{}
The value of the parameter.
- value Object
The value of the parameter.
- value any
The value of the parameter.
- value Any
The value of the parameter.
- value Any
The value of the parameter.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0