Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Friday, Jun 10, 2022 by Pulumi

SqlRoleAssignment

Manages a Cosmos DB SQL Role Assignment.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var current = Output.Create(Azure.Core.GetClientConfig.InvokeAsync());
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "West Europe",
        });
        var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new Azure.CosmosDB.AccountArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            OfferType = "Standard",
            Kind = "GlobalDocumentDB",
            ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs
            {
                ConsistencyLevel = "Strong",
            },
            GeoLocations = 
            {
                new Azure.CosmosDB.Inputs.AccountGeoLocationArgs
                {
                    Location = exampleResourceGroup.Location,
                    FailoverPriority = 0,
                },
            },
        });
        var exampleSqlRoleDefinition = new Azure.CosmosDB.SqlRoleDefinition("exampleSqlRoleDefinition", new Azure.CosmosDB.SqlRoleDefinitionArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            AccountName = exampleAccount.Name,
            Type = "CustomRole",
            AssignableScopes = 
            {
                Output.Tuple(current, exampleResourceGroup.Name, exampleAccount.Name).Apply(values =>
                {
                    var current = values.Item1;
                    var exampleResourceGroupName = values.Item2;
                    var exampleAccountName = values.Item3;
                    return $"/subscriptions/{current.SubscriptionId}/resourceGroups/{exampleResourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{exampleAccountName}";
                }),
            },
            Permissions = 
            {
                new Azure.CosmosDB.Inputs.SqlRoleDefinitionPermissionArgs
                {
                    DataActions = 
                    {
                        "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read",
                    },
                },
            },
        });
        var exampleSqlRoleAssignment = new Azure.CosmosDB.SqlRoleAssignment("exampleSqlRoleAssignment", new Azure.CosmosDB.SqlRoleAssignmentArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            AccountName = exampleAccount.Name,
            RoleDefinitionId = exampleSqlRoleDefinition.Id,
            PrincipalId = current.Apply(current => current.ObjectId),
            Scope = Output.Tuple(current, exampleResourceGroup.Name, exampleAccount.Name).Apply(values =>
            {
                var current = values.Item1;
                var exampleResourceGroupName = values.Item2;
                var exampleAccountName = values.Item3;
                return $"/subscriptions/{current.SubscriptionId}/resourceGroups/{exampleResourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{exampleAccountName}";
            }),
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/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, nil, nil)
		if err != nil {
			return err
		}
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			OfferType:         pulumi.String("Standard"),
			Kind:              pulumi.String("GlobalDocumentDB"),
			ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
				ConsistencyLevel: pulumi.String("Strong"),
			},
			GeoLocations: cosmosdb.AccountGeoLocationArray{
				&cosmosdb.AccountGeoLocationArgs{
					Location:         exampleResourceGroup.Location,
					FailoverPriority: pulumi.Int(0),
				},
			},
		})
		if err != nil {
			return err
		}
		exampleSqlRoleDefinition, err := cosmosdb.NewSqlRoleDefinition(ctx, "exampleSqlRoleDefinition", &cosmosdb.SqlRoleDefinitionArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			AccountName:       exampleAccount.Name,
			Type:              pulumi.String("CustomRole"),
			AssignableScopes: pulumi.StringArray{
				pulumi.All(exampleResourceGroup.Name, exampleAccount.Name).ApplyT(func(_args []interface{}) (string, error) {
					exampleResourceGroupName := _args[0].(string)
					exampleAccountName := _args[1].(string)
					return fmt.Sprintf("%v%v%v%v%v%v", "/subscriptions/", current.SubscriptionId, "/resourceGroups/", exampleResourceGroupName, "/providers/Microsoft.DocumentDB/databaseAccounts/", exampleAccountName), nil
				}).(pulumi.StringOutput),
			},
			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, "exampleSqlRoleAssignment", &cosmosdb.SqlRoleAssignmentArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			AccountName:       exampleAccount.Name,
			RoleDefinitionId:  exampleSqlRoleDefinition.ID(),
			PrincipalId:       pulumi.String(current.ObjectId),
			Scope: pulumi.All(exampleResourceGroup.Name, exampleAccount.Name).ApplyT(func(_args []interface{}) (string, error) {
				exampleResourceGroupName := _args[0].(string)
				exampleAccountName := _args[1].(string)
				return fmt.Sprintf("%v%v%v%v%v%v", "/subscriptions/", current.SubscriptionId, "/resourceGroups/", exampleResourceGroupName, "/providers/Microsoft.DocumentDB/databaseAccounts/", exampleAccountName), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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

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

        var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

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

        var exampleSqlRoleDefinition = new SqlRoleDefinition("exampleSqlRoleDefinition", SqlRoleDefinitionArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .accountName(exampleAccount.name())
            .type("CustomRole")
            .assignableScopes(Output.tuple(exampleResourceGroup.name(), exampleAccount.name()).apply(values -> {
                var exampleResourceGroupName = values.t1;
                var exampleAccountName = values.t2;
                return String.format("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s", current.apply(getClientConfigResult -> getClientConfigResult.subscriptionId()),exampleResourceGroupName,exampleAccountName);
            }))
            .permissions(SqlRoleDefinitionPermissionArgs.builder()
                .dataActions("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")
                .build())
            .build());

        var exampleSqlRoleAssignment = new SqlRoleAssignment("exampleSqlRoleAssignment", SqlRoleAssignmentArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .accountName(exampleAccount.name())
            .roleDefinitionId(exampleSqlRoleDefinition.id())
            .principalId(current.apply(getClientConfigResult -> getClientConfigResult.objectId()))
            .scope(Output.tuple(exampleResourceGroup.name(), exampleAccount.name()).apply(values -> {
                var exampleResourceGroupName = values.t1;
                var exampleAccountName = values.t2;
                return String.format("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DocumentDB/databaseAccounts/%s", current.apply(getClientConfigResult -> getClientConfigResult.subscriptionId()),exampleResourceGroupName,exampleAccountName);
            }))
            .build());

    }
}
import pulumi
import pulumi_azure as azure

current = azure.core.get_client_config()
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_account = azure.cosmosdb.Account("exampleAccount",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    offer_type="Standard",
    kind="GlobalDocumentDB",
    consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs(
        consistency_level="Strong",
    ),
    geo_locations=[azure.cosmosdb.AccountGeoLocationArgs(
        location=example_resource_group.location,
        failover_priority=0,
    )])
example_sql_role_definition = azure.cosmosdb.SqlRoleDefinition("exampleSqlRoleDefinition",
    resource_group_name=example_resource_group.name,
    account_name=example_account.name,
    type="CustomRole",
    assignable_scopes=[pulumi.Output.all(example_resource_group.name, example_account.name).apply(lambda exampleResourceGroupName, exampleAccountName: f"/subscriptions/{current.subscription_id}/resourceGroups/{example_resource_group_name}/providers/Microsoft.DocumentDB/databaseAccounts/{example_account_name}")],
    permissions=[azure.cosmosdb.SqlRoleDefinitionPermissionArgs(
        data_actions=["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"],
    )])
example_sql_role_assignment = azure.cosmosdb.SqlRoleAssignment("exampleSqlRoleAssignment",
    resource_group_name=example_resource_group.name,
    account_name=example_account.name,
    role_definition_id=example_sql_role_definition.id,
    principal_id=current.object_id,
    scope=pulumi.Output.all(example_resource_group.name, example_account.name).apply(lambda exampleResourceGroupName, exampleAccountName: f"/subscriptions/{current.subscription_id}/resourceGroups/{example_resource_group_name}/providers/Microsoft.DocumentDB/databaseAccounts/{example_account_name}"))
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const current = azure.core.getClientConfig({});
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleAccount = new azure.cosmosdb.Account("exampleAccount", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    offerType: "Standard",
    kind: "GlobalDocumentDB",
    consistencyPolicy: {
        consistencyLevel: "Strong",
    },
    geoLocations: [{
        location: exampleResourceGroup.location,
        failoverPriority: 0,
    }],
});
const exampleSqlRoleDefinition = new azure.cosmosdb.SqlRoleDefinition("exampleSqlRoleDefinition", {
    resourceGroupName: exampleResourceGroup.name,
    accountName: exampleAccount.name,
    type: "CustomRole",
    assignableScopes: [pulumi.all([current, exampleResourceGroup.name, exampleAccount.name]).apply(([current, exampleResourceGroupName, exampleAccountName]) => `/subscriptions/${current.subscriptionId}/resourceGroups/${exampleResourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${exampleAccountName}`)],
    permissions: [{
        dataActions: ["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"],
    }],
});
const exampleSqlRoleAssignment = new azure.cosmosdb.SqlRoleAssignment("exampleSqlRoleAssignment", {
    resourceGroupName: exampleResourceGroup.name,
    accountName: exampleAccount.name,
    roleDefinitionId: exampleSqlRoleDefinition.id,
    principalId: current.then(current => current.objectId),
    scope: pulumi.all([current, exampleResourceGroup.name, exampleAccount.name]).apply(([current, exampleResourceGroupName, exampleAccountName]) => `/subscriptions/${current.subscriptionId}/resourceGroups/${exampleResourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${exampleAccountName}`),
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleAccount:
    type: azure:cosmosdb:Account
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      offerType: Standard
      kind: GlobalDocumentDB
      consistencyPolicy:
        consistencyLevel: Strong
      geoLocations:
        - location: ${exampleResourceGroup.location}
          failoverPriority: 0
  exampleSqlRoleDefinition:
    type: azure:cosmosdb:SqlRoleDefinition
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      accountName: ${exampleAccount.name}
      type: CustomRole
      assignableScopes:
        - /subscriptions/${current.subscriptionId}/resourceGroups/${exampleResourceGroup.name}/providers/Microsoft.DocumentDB/databaseAccounts/${exampleAccount.name}
      permissions:
        - dataActions:
            - Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read
  exampleSqlRoleAssignment:
    type: azure:cosmosdb:SqlRoleAssignment
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      accountName: ${exampleAccount.name}
      roleDefinitionId: ${exampleSqlRoleDefinition.id}
      principalId: ${current.objectId}
      scope: /subscriptions/${current.subscriptionId}/resourceGroups/${exampleResourceGroup.name}/providers/Microsoft.DocumentDB/databaseAccounts/${exampleAccount.name}
variables:
  current:
    Fn::Invoke:
      Function: azure:core:getClientConfig
      Arguments: {}

Create a SqlRoleAssignment Resource

new SqlRoleAssignment(name: string, args: SqlRoleAssignmentArgs, opts?: CustomResourceOptions);
@overload
def SqlRoleAssignment(resource_name: 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)
@overload
def SqlRoleAssignment(resource_name: str,
                      args: SqlRoleAssignmentArgs,
                      opts: Optional[ResourceOptions] = 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.

name string
The unique name of the resource.
args SqlRoleAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args 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 string
The unique name of the resource.
args SqlRoleAssignmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SqlRoleAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SqlRoleAssignmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

The SqlRoleAssignment resource accepts the following input properties:

AccountName string

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

PrincipalId string

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

ResourceGroupName 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 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 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 string

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

PrincipalId string

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

ResourceGroupName 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 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 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 String

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

principalId String

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

resourceGroupName 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 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 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 string

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

principalId string

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

resourceGroupName 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 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 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 str

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

principal_id str

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

resource_group_name 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 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 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 String

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

principalId String

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

resourceGroupName 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 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 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 an 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)
Resource lookup is not supported in YAML
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.
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:
AccountName string

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

Name 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 string

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

ResourceGroupName 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 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 string

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

Name 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 string

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

ResourceGroupName 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 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 String

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

name 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 String

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

resourceGroupName 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 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 string

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

name 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 string

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

resourceGroupName 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 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 str

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

name 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 str

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

resource_group_name 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 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 String

The name of the Cosmos DB Account. Changing this forces a new resource to be created.

name 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 String

The ID of the Principal (Client) in Azure Active Directory. Changing this forces a new resource to be created.

resourceGroupName 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 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

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.