1. Packages
  2. Azure Classic
  3. API Docs
  4. cosmosdb
  5. SqlRoleAssignment

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.cosmosdb.SqlRoleAssignment

Explore with Pulumi AI

Manages a Cosmos DB SQL Role Assignment.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const current = azure.core.getClientConfig({});
const example = new azure.core.ResourceGroup("example", {
    name: "example-resources",
    location: "West Europe",
});
const exampleAccount = new azure.cosmosdb.Account("example", {
    name: "example-cosmosdb",
    location: example.location,
    resourceGroupName: example.name,
    offerType: "Standard",
    kind: "GlobalDocumentDB",
    consistencyPolicy: {
        consistencyLevel: "Strong",
    },
    geoLocations: [{
        location: example.location,
        failoverPriority: 0,
    }],
});
const exampleSqlRoleDefinition = new azure.cosmosdb.SqlRoleDefinition("example", {
    name: "examplesqlroledef",
    resourceGroupName: example.name,
    accountName: exampleAccount.name,
    type: "CustomRole",
    assignableScopes: [exampleAccount.id],
    permissions: [{
        dataActions: ["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"],
    }],
});
const exampleSqlRoleAssignment = new azure.cosmosdb.SqlRoleAssignment("example", {
    name: "736180af-7fbc-4c7f-9004-22735173c1c3",
    resourceGroupName: example.name,
    accountName: exampleAccount.name,
    roleDefinitionId: exampleSqlRoleDefinition.id,
    principalId: current.then(current => current.objectId),
    scope: exampleAccount.id,
});
Copy
import pulumi
import pulumi_azure as azure

current = azure.core.get_client_config()
example = azure.core.ResourceGroup("example",
    name="example-resources",
    location="West Europe")
example_account = azure.cosmosdb.Account("example",
    name="example-cosmosdb",
    location=example.location,
    resource_group_name=example.name,
    offer_type="Standard",
    kind="GlobalDocumentDB",
    consistency_policy={
        "consistency_level": "Strong",
    },
    geo_locations=[{
        "location": example.location,
        "failover_priority": 0,
    }])
example_sql_role_definition = azure.cosmosdb.SqlRoleDefinition("example",
    name="examplesqlroledef",
    resource_group_name=example.name,
    account_name=example_account.name,
    type="CustomRole",
    assignable_scopes=[example_account.id],
    permissions=[{
        "data_actions": ["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"],
    }])
example_sql_role_assignment = azure.cosmosdb.SqlRoleAssignment("example",
    name="736180af-7fbc-4c7f-9004-22735173c1c3",
    resource_group_name=example.name,
    account_name=example_account.name,
    role_definition_id=example_sql_role_definition.id,
    principal_id=current.object_id,
    scope=example_account.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := core.GetClientConfig(ctx, map[string]interface{}{}, nil)
		if err != nil {
			return err
		}
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("example-resources"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
			Name:              pulumi.String("example-cosmosdb"),
			Location:          example.Location,
			ResourceGroupName: example.Name,
			OfferType:         pulumi.String("Standard"),
			Kind:              pulumi.String("GlobalDocumentDB"),
			ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
				ConsistencyLevel: pulumi.String("Strong"),
			},
			GeoLocations: cosmosdb.AccountGeoLocationArray{
				&cosmosdb.AccountGeoLocationArgs{
					Location:         example.Location,
					FailoverPriority: pulumi.Int(0),
				},
			},
		})
		if err != nil {
			return err
		}
		exampleSqlRoleDefinition, err := cosmosdb.NewSqlRoleDefinition(ctx, "example", &cosmosdb.SqlRoleDefinitionArgs{
			Name:              pulumi.String("examplesqlroledef"),
			ResourceGroupName: example.Name,
			AccountName:       exampleAccount.Name,
			Type:              pulumi.String("CustomRole"),
			AssignableScopes: pulumi.StringArray{
				exampleAccount.ID(),
			},
			Permissions: cosmosdb.SqlRoleDefinitionPermissionArray{
				&cosmosdb.SqlRoleDefinitionPermissionArgs{
					DataActions: pulumi.StringArray{
						pulumi.String("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = cosmosdb.NewSqlRoleAssignment(ctx, "example", &cosmosdb.SqlRoleAssignmentArgs{
			Name:              pulumi.String("736180af-7fbc-4c7f-9004-22735173c1c3"),
			ResourceGroupName: example.Name,
			AccountName:       exampleAccount.Name,
			RoleDefinitionId:  exampleSqlRoleDefinition.ID(),
			PrincipalId:       pulumi.String(current.ObjectId),
			Scope:             exampleAccount.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var current = Azure.Core.GetClientConfig.Invoke();

    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "example-resources",
        Location = "West Europe",
    });

    var exampleAccount = new Azure.CosmosDB.Account("example", new()
    {
        Name = "example-cosmosdb",
        Location = example.Location,
        ResourceGroupName = example.Name,
        OfferType = "Standard",
        Kind = "GlobalDocumentDB",
        ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs
        {
            ConsistencyLevel = "Strong",
        },
        GeoLocations = new[]
        {
            new Azure.CosmosDB.Inputs.AccountGeoLocationArgs
            {
                Location = example.Location,
                FailoverPriority = 0,
            },
        },
    });

    var exampleSqlRoleDefinition = new Azure.CosmosDB.SqlRoleDefinition("example", new()
    {
        Name = "examplesqlroledef",
        ResourceGroupName = example.Name,
        AccountName = exampleAccount.Name,
        Type = "CustomRole",
        AssignableScopes = new[]
        {
            exampleAccount.Id,
        },
        Permissions = new[]
        {
            new Azure.CosmosDB.Inputs.SqlRoleDefinitionPermissionArgs
            {
                DataActions = new[]
                {
                    "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read",
                },
            },
        },
    });

    var exampleSqlRoleAssignment = new Azure.CosmosDB.SqlRoleAssignment("example", new()
    {
        Name = "736180af-7fbc-4c7f-9004-22735173c1c3",
        ResourceGroupName = example.Name,
        AccountName = exampleAccount.Name,
        RoleDefinitionId = exampleSqlRoleDefinition.Id,
        PrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId),
        Scope = exampleAccount.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.cosmosdb.Account;
import com.pulumi.azure.cosmosdb.AccountArgs;
import com.pulumi.azure.cosmosdb.inputs.AccountConsistencyPolicyArgs;
import com.pulumi.azure.cosmosdb.inputs.AccountGeoLocationArgs;
import com.pulumi.azure.cosmosdb.SqlRoleDefinition;
import com.pulumi.azure.cosmosdb.SqlRoleDefinitionArgs;
import com.pulumi.azure.cosmosdb.inputs.SqlRoleDefinitionPermissionArgs;
import com.pulumi.azure.cosmosdb.SqlRoleAssignment;
import com.pulumi.azure.cosmosdb.SqlRoleAssignmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var current = CoreFunctions.getClientConfig();

        var example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name("example-resources")
            .location("West Europe")
            .build());

        var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
            .name("example-cosmosdb")
            .location(example.location())
            .resourceGroupName(example.name())
            .offerType("Standard")
            .kind("GlobalDocumentDB")
            .consistencyPolicy(AccountConsistencyPolicyArgs.builder()
                .consistencyLevel("Strong")
                .build())
            .geoLocations(AccountGeoLocationArgs.builder()
                .location(example.location())
                .failoverPriority(0)
                .build())
            .build());

        var exampleSqlRoleDefinition = new SqlRoleDefinition("exampleSqlRoleDefinition", SqlRoleDefinitionArgs.builder()
            .name("examplesqlroledef")
            .resourceGroupName(example.name())
            .accountName(exampleAccount.name())
            .type("CustomRole")
            .assignableScopes(exampleAccount.id())
            .permissions(SqlRoleDefinitionPermissionArgs.builder()
                .dataActions("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")
                .build())
            .build());

        var exampleSqlRoleAssignment = new SqlRoleAssignment("exampleSqlRoleAssignment", SqlRoleAssignmentArgs.builder()
            .name("736180af-7fbc-4c7f-9004-22735173c1c3")
            .resourceGroupName(example.name())
            .accountName(exampleAccount.name())
            .roleDefinitionId(exampleSqlRoleDefinition.id())
            .principalId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
            .scope(exampleAccount.id())
            .build());

    }
}
Copy
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: example-resources
      location: West Europe
  exampleAccount:
    type: azure:cosmosdb:Account
    name: example
    properties:
      name: example-cosmosdb
      location: ${example.location}
      resourceGroupName: ${example.name}
      offerType: Standard
      kind: GlobalDocumentDB
      consistencyPolicy:
        consistencyLevel: Strong
      geoLocations:
        - location: ${example.location}
          failoverPriority: 0
  exampleSqlRoleDefinition:
    type: azure:cosmosdb:SqlRoleDefinition
    name: example
    properties:
      name: examplesqlroledef
      resourceGroupName: ${example.name}
      accountName: ${exampleAccount.name}
      type: CustomRole
      assignableScopes:
        - ${exampleAccount.id}
      permissions:
        - dataActions:
            - Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read
  exampleSqlRoleAssignment:
    type: azure:cosmosdb:SqlRoleAssignment
    name: example
    properties:
      name: 736180af-7fbc-4c7f-9004-22735173c1c3
      resourceGroupName: ${example.name}
      accountName: ${exampleAccount.name}
      roleDefinitionId: ${exampleSqlRoleDefinition.id}
      principalId: ${current.objectId}
      scope: ${exampleAccount.id}
variables:
  current:
    fn::invoke:
      function: azure:core:getClientConfig
      arguments: {}
Copy

Create SqlRoleAssignment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SqlRoleAssignment(name: string, args: SqlRoleAssignmentArgs, opts?: CustomResourceOptions);
@overload
def SqlRoleAssignment(resource_name: str,
                      args: SqlRoleAssignmentArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def SqlRoleAssignment(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      account_name: Optional[str] = None,
                      principal_id: Optional[str] = None,
                      resource_group_name: Optional[str] = None,
                      role_definition_id: Optional[str] = None,
                      scope: Optional[str] = None,
                      name: Optional[str] = None)
func NewSqlRoleAssignment(ctx *Context, name string, args SqlRoleAssignmentArgs, opts ...ResourceOption) (*SqlRoleAssignment, error)
public SqlRoleAssignment(string name, SqlRoleAssignmentArgs args, CustomResourceOptions? opts = null)
public SqlRoleAssignment(String name, SqlRoleAssignmentArgs args)
public SqlRoleAssignment(String name, SqlRoleAssignmentArgs args, CustomResourceOptions options)
type: azure:cosmosdb:SqlRoleAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SqlRoleAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SqlRoleAssignmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SqlRoleAssignmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SqlRoleAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SqlRoleAssignmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var sqlRoleAssignmentResource = new Azure.CosmosDB.SqlRoleAssignment("sqlRoleAssignmentResource", new()
{
    AccountName = "string",
    PrincipalId = "string",
    ResourceGroupName = "string",
    RoleDefinitionId = "string",
    Scope = "string",
    Name = "string",
});
Copy
example, err := cosmosdb.NewSqlRoleAssignment(ctx, "sqlRoleAssignmentResource", &cosmosdb.SqlRoleAssignmentArgs{
	AccountName:       pulumi.String("string"),
	PrincipalId:       pulumi.String("string"),
	ResourceGroupName: pulumi.String("string"),
	RoleDefinitionId:  pulumi.String("string"),
	Scope:             pulumi.String("string"),
	Name:              pulumi.String("string"),
})
Copy
var sqlRoleAssignmentResource = new SqlRoleAssignment("sqlRoleAssignmentResource", SqlRoleAssignmentArgs.builder()
    .accountName("string")
    .principalId("string")
    .resourceGroupName("string")
    .roleDefinitionId("string")
    .scope("string")
    .name("string")
    .build());
Copy
sql_role_assignment_resource = azure.cosmosdb.SqlRoleAssignment("sqlRoleAssignmentResource",
    account_name="string",
    principal_id="string",
    resource_group_name="string",
    role_definition_id="string",
    scope="string",
    name="string")
Copy
const sqlRoleAssignmentResource = new azure.cosmosdb.SqlRoleAssignment("sqlRoleAssignmentResource", {
    accountName: "string",
    principalId: "string",
    resourceGroupName: "string",
    roleDefinitionId: "string",
    scope: "string",
    name: "string",
});
Copy
type: azure:cosmosdb:SqlRoleAssignment
properties:
    accountName: string
    name: string
    principalId: string
    resourceGroupName: string
    roleDefinitionId: string
    scope: string
Copy

SqlRoleAssignment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SqlRoleAssignment resource accepts the following input properties:

AccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
PrincipalId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
RoleDefinitionId This property is required. string
The resource ID of the Cosmos DB SQL Role Definition.
Scope
This property is required.
Changes to this property will trigger replacement.
string
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
AccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
PrincipalId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
RoleDefinitionId This property is required. string
The resource ID of the Cosmos DB SQL Role Definition.
Scope
This property is required.
Changes to this property will trigger replacement.
string
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
accountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
principalId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
roleDefinitionId This property is required. String
The resource ID of the Cosmos DB SQL Role Definition.
scope
This property is required.
Changes to this property will trigger replacement.
String
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
accountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
principalId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
roleDefinitionId This property is required. string
The resource ID of the Cosmos DB SQL Role Definition.
scope
This property is required.
Changes to this property will trigger replacement.
string
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. string
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
account_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
principal_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
role_definition_id This property is required. str
The resource ID of the Cosmos DB SQL Role Definition.
scope
This property is required.
Changes to this property will trigger replacement.
str
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. str
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
accountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
principalId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
roleDefinitionId This property is required. String
The resource ID of the Cosmos DB SQL Role Definition.
scope
This property is required.
Changes to this property will trigger replacement.
String
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the SqlRoleAssignment resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing SqlRoleAssignment Resource

Get an existing SqlRoleAssignment 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?: SqlRoleAssignmentState, opts?: CustomResourceOptions): SqlRoleAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_name: Optional[str] = None,
        name: Optional[str] = None,
        principal_id: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        role_definition_id: Optional[str] = None,
        scope: Optional[str] = None) -> SqlRoleAssignment
func GetSqlRoleAssignment(ctx *Context, name string, id IDInput, state *SqlRoleAssignmentState, opts ...ResourceOption) (*SqlRoleAssignment, error)
public static SqlRoleAssignment Get(string name, Input<string> id, SqlRoleAssignmentState? state, CustomResourceOptions? opts = null)
public static SqlRoleAssignment get(String name, Output<String> id, SqlRoleAssignmentState state, CustomResourceOptions options)
resources:  _:    type: azure:cosmosdb:SqlRoleAssignment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AccountName Changes to this property will trigger replacement. string
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
PrincipalId Changes to this property will trigger replacement. string
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
ResourceGroupName Changes to this property will trigger replacement. string
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
RoleDefinitionId string
The resource ID of the Cosmos DB SQL Role Definition.
Scope Changes to this property will trigger replacement. string
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
AccountName Changes to this property will trigger replacement. string
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
PrincipalId Changes to this property will trigger replacement. string
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
ResourceGroupName Changes to this property will trigger replacement. string
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
RoleDefinitionId string
The resource ID of the Cosmos DB SQL Role Definition.
Scope Changes to this property will trigger replacement. string
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
accountName Changes to this property will trigger replacement. String
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
principalId Changes to this property will trigger replacement. String
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
resourceGroupName Changes to this property will trigger replacement. String
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
roleDefinitionId String
The resource ID of the Cosmos DB SQL Role Definition.
scope Changes to this property will trigger replacement. String
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
accountName Changes to this property will trigger replacement. string
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. string
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
principalId Changes to this property will trigger replacement. string
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
resourceGroupName Changes to this property will trigger replacement. string
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
roleDefinitionId string
The resource ID of the Cosmos DB SQL Role Definition.
scope Changes to this property will trigger replacement. string
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
account_name Changes to this property will trigger replacement. str
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. str
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
principal_id Changes to this property will trigger replacement. str
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
resource_group_name Changes to this property will trigger replacement. str
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
role_definition_id str
The resource ID of the Cosmos DB SQL Role Definition.
scope Changes to this property will trigger replacement. str
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.
accountName Changes to this property will trigger replacement. String
The name of the Cosmos DB Account. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
The GUID as the name of the Cosmos DB SQL Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.
principalId Changes to this property will trigger replacement. String
The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.
resourceGroupName Changes to this property will trigger replacement. String
The name of the Resource Group in which the Cosmos DB SQL Role Assignment is created. Changing this forces a new resource to be created.
roleDefinitionId String
The resource ID of the Cosmos DB SQL Role Definition.
scope Changes to this property will trigger replacement. String
The data plane resource path for which access is being granted through this Cosmos DB SQL Role Assignment. Changing this forces a new resource to be created.

Import

Cosmos DB SQL Role Assignments can be imported using the resource id, e.g.

$ pulumi import azure:cosmosdb/sqlRoleAssignment:SqlRoleAssignment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlRoleAssignments/9e007587-dbcd-4190-84cb-fcab5a09ca39
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.