UserAssignedIdentity
Manages a user assigned identity.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "eastus",
});
var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new Azure.Authorization.UserAssignedIdentityArgs
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/authorization"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("eastus"),
})
if err != nil {
return err
}
_, err = authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus")
example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity",
resource_group_name=example_resource_group.name,
location=example_resource_group.location)import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "eastus"});
const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", {
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
});Create a UserAssignedIdentity Resource
new UserAssignedIdentity(name: string, args: UserAssignedIdentityArgs, opts?: CustomResourceOptions);def UserAssignedIdentity(resource_name, opts=None, location=None, name=None, resource_group_name=None, tags=None, __props__=None);func NewUserAssignedIdentity(ctx *Context, name string, args UserAssignedIdentityArgs, opts ...ResourceOption) (*UserAssignedIdentity, error)public UserAssignedIdentity(string name, UserAssignedIdentityArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args UserAssignedIdentityArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args UserAssignedIdentityArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserAssignedIdentityArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
UserAssignedIdentity Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The UserAssignedIdentity resource accepts the following input properties:
- Resource
Group stringName The name of the resource group in which to create the user assigned identity.
- Location string
The location/region where the user assigned identity is created.
- Name string
The name of the user assigned identity. Changing this forces a new identity to be created.
- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Resource
Group stringName The name of the resource group in which to create the user assigned identity.
- Location string
The location/region where the user assigned identity is created.
- Name string
The name of the user assigned identity. Changing this forces a new identity to be created.
- map[string]string
A mapping of tags to assign to the resource.
- resource
Group stringName The name of the resource group in which to create the user assigned identity.
- location string
The location/region where the user assigned identity is created.
- name string
The name of the user assigned identity. Changing this forces a new identity to be created.
- {[key: string]: string}
A mapping of tags to assign to the resource.
- resource_
group_ strname The name of the resource group in which to create the user assigned identity.
- location str
The location/region where the user assigned identity is created.
- name str
The name of the user assigned identity. Changing this forces a new identity to be created.
- Dict[str, str]
A mapping of tags to assign to the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the UserAssignedIdentity resource produces the following output properties:
Look up an Existing UserAssignedIdentity Resource
Get an existing UserAssignedIdentity resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: UserAssignedIdentityState, opts?: CustomResourceOptions): UserAssignedIdentitystatic get(resource_name, id, opts=None, client_id=None, location=None, name=None, principal_id=None, resource_group_name=None, tags=None, __props__=None);func GetUserAssignedIdentity(ctx *Context, name string, id IDInput, state *UserAssignedIdentityState, opts ...ResourceOption) (*UserAssignedIdentity, error)public static UserAssignedIdentity Get(string name, Input<string> id, UserAssignedIdentityState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Client
Id string Client ID associated with the user assigned identity.
- Location string
The location/region where the user assigned identity is created.
- Name string
The name of the user assigned identity. Changing this forces a new identity to be created.
- Principal
Id string Service Principal ID associated with the user assigned identity.
- Resource
Group stringName The name of the resource group in which to create the user assigned identity.
- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Client
Id string Client ID associated with the user assigned identity.
- Location string
The location/region where the user assigned identity is created.
- Name string
The name of the user assigned identity. Changing this forces a new identity to be created.
- Principal
Id string Service Principal ID associated with the user assigned identity.
- Resource
Group stringName The name of the resource group in which to create the user assigned identity.
- map[string]string
A mapping of tags to assign to the resource.
- client
Id string Client ID associated with the user assigned identity.
- location string
The location/region where the user assigned identity is created.
- name string
The name of the user assigned identity. Changing this forces a new identity to be created.
- principal
Id string Service Principal ID associated with the user assigned identity.
- resource
Group stringName The name of the resource group in which to create the user assigned identity.
- {[key: string]: string}
A mapping of tags to assign to the resource.
- client_
id str Client ID associated with the user assigned identity.
- location str
The location/region where the user assigned identity is created.
- name str
The name of the user assigned identity. Changing this forces a new identity to be created.
- principal_
id str Service Principal ID associated with the user assigned identity.
- resource_
group_ strname The name of the resource group in which to create the user assigned identity.
- Dict[str, str]
A mapping of tags to assign to the resource.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.