This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi
azure-native.authorization.getPolicyAssignment
Explore with Pulumi AI
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi
This operation retrieves a single policy assignment, given its name and the scope it was created at. Azure REST API version: 2022-06-01.
Other available API versions: 2016-04-01, 2016-12-01, 2019-06-01, 2020-03-01, 2023-04-01, 2024-04-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.
- System
Data Pulumi.Azure Native. Authorization. Outputs. System Data Response - The system metadata relating to this resource.
- 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.
- Overrides
List<Pulumi.
Azure Native. Authorization. Outputs. Override Response> - The policy property value override.
- 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.
- Resource
Selectors List<Pulumi.Azure Native. Authorization. Outputs. Resource Selector Response> - The resource selector list to filter policies by resource properties.
- Id string
- The ID of the policy assignment.
- Name string
- The name of the policy assignment.
- Scope string
- The scope for the policy assignment.
- System
Data SystemData Response - The system metadata relating to this resource.
- 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.
- Overrides
[]Override
Response - The policy property value override.
- 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.
- Resource
Selectors []ResourceSelector Response - The resource selector list to filter policies by resource properties.
- id String
- The ID of the policy assignment.
- name String
- The name of the policy assignment.
- scope String
- The scope for the policy assignment.
- system
Data SystemData Response - The system metadata relating to this resource.
- 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.
- overrides
List<Override
Response> - The policy property value override.
- 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.
- resource
Selectors List<ResourceSelector Response> - The resource selector list to filter policies by resource properties.
- id string
- The ID of the policy assignment.
- name string
- The name of the policy assignment.
- scope string
- The scope for the policy assignment.
- system
Data SystemData Response - The system metadata relating to this resource.
- 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.
- overrides
Override
Response[] - The policy property value override.
- 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.
- resource
Selectors ResourceSelector Response[] - The resource selector list to filter policies by resource properties.
- id str
- The ID of the policy assignment.
- name str
- The name of the policy assignment.
- scope str
- The scope for the policy assignment.
- system_
data SystemData Response - The system metadata relating to this resource.
- 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.
- overrides
Sequence[Override
Response] - The policy property value override.
- 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.
- resource_
selectors Sequence[ResourceSelector Response] - The resource selector list to filter policies by resource properties.
- id String
- The ID of the policy assignment.
- name String
- The name of the policy assignment.
- scope String
- The scope for the policy assignment.
- system
Data Property Map - The system metadata relating to this resource.
- 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.
- overrides List<Property Map>
- The policy property value override.
- 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.
- resource
Selectors List<Property Map> - The resource selector list to filter policies by resource properties.
Supporting Types
IdentityResponse
- Principal
Id string - The principal ID of the resource identity. This property will only be provided for a system assigned identity
- Tenant
Id string - The tenant ID of the resource identity. This property will only be provided for a system assigned identity
- Type string
- The identity type. This is the only required field when adding a system or user assigned identity to a resource.
- User
Assigned Dictionary<string, Pulumi.Identities Azure Native. Authorization. Inputs. Identity Response User Assigned Identities> - The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
- Principal
Id string - The principal ID of the resource identity. This property will only be provided for a system assigned identity
- Tenant
Id string - The tenant ID of the resource identity. This property will only be provided for a system assigned identity
- Type string
- The identity type. This is the only required field when adding a system or user assigned identity to a resource.
- User
Assigned map[string]IdentityIdentities Response User Assigned Identities - The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
- principal
Id String - The principal ID of the resource identity. This property will only be provided for a system assigned identity
- tenant
Id String - The tenant ID of the resource identity. This property will only be provided for a system assigned identity
- type String
- The identity type. This is the only required field when adding a system or user assigned identity to a resource.
- user
Assigned Map<String,IdentityIdentities Response User Assigned Identities> - The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
- principal
Id string - The principal ID of the resource identity. This property will only be provided for a system assigned identity
- tenant
Id string - The tenant ID of the resource identity. This property will only be provided for a system assigned identity
- type string
- The identity type. This is the only required field when adding a system or user assigned identity to a resource.
- user
Assigned {[key: string]: IdentityIdentities Response User Assigned Identities} - The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
- principal_
id str - The principal ID of the resource identity. This property will only be provided for a system assigned identity
- tenant_
id str - The tenant ID of the resource identity. This property will only be provided for a system assigned identity
- type str
- The identity type. This is the only required field when adding a system or user assigned identity to a resource.
- user_
assigned_ Mapping[str, Identityidentities Response User Assigned Identities] - The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
- principal
Id String - The principal ID of the resource identity. This property will only be provided for a system assigned identity
- tenant
Id String - The tenant ID of the resource identity. This property will only be provided for a system assigned identity
- type String
- The identity type. This is the only required field when adding a system or user assigned identity to a resource.
- user
Assigned Map<Property Map>Identities - The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
IdentityResponseUserAssignedIdentities
- Client
Id string - The client id of user assigned identity.
- Principal
Id string - The principal id of user assigned identity.
- Client
Id string - The client id of user assigned identity.
- Principal
Id string - The principal id of user assigned identity.
- client
Id String - The client id of user assigned identity.
- principal
Id String - The principal id of user assigned identity.
- client
Id string - The client id of user assigned identity.
- principal
Id string - The principal id of user assigned identity.
- client_
id str - The client id of user assigned identity.
- principal_
id str - The principal id of user assigned identity.
- client
Id String - The client id of user assigned identity.
- principal
Id String - The principal id of user assigned identity.
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.
OverrideResponse
- Kind string
- The override kind.
- Selectors
List<Pulumi.
Azure Native. Authorization. Inputs. Selector Response> - The list of the selector expressions.
- Value string
- The value to override the policy property.
- Kind string
- The override kind.
- Selectors
[]Selector
Response - The list of the selector expressions.
- Value string
- The value to override the policy property.
- kind String
- The override kind.
- selectors
List<Selector
Response> - The list of the selector expressions.
- value String
- The value to override the policy property.
- kind string
- The override kind.
- selectors
Selector
Response[] - The list of the selector expressions.
- value string
- The value to override the policy property.
- kind str
- The override kind.
- selectors
Sequence[Selector
Response] - The list of the selector expressions.
- value str
- The value to override the policy property.
- kind String
- The override kind.
- selectors List<Property Map>
- The list of the selector expressions.
- value String
- The value to override the policy property.
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.
ResourceSelectorResponse
- Name string
- The name of the resource selector.
- Selectors
List<Pulumi.
Azure Native. Authorization. Inputs. Selector Response> - The list of the selector expressions.
- Name string
- The name of the resource selector.
- Selectors
[]Selector
Response - The list of the selector expressions.
- name String
- The name of the resource selector.
- selectors
List<Selector
Response> - The list of the selector expressions.
- name string
- The name of the resource selector.
- selectors
Selector
Response[] - The list of the selector expressions.
- name str
- The name of the resource selector.
- selectors
Sequence[Selector
Response] - The list of the selector expressions.
- name String
- The name of the resource selector.
- selectors List<Property Map>
- The list of the selector expressions.
SelectorResponse
SystemDataResponse
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The timestamp of resource last modification (UTC)
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - The type of identity that last modified the resource.
- created_
at str - The timestamp of resource creation (UTC).
- created_
by str - The identity that created the resource.
- created_
by_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The timestamp of resource last modification (UTC)
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi