Azure Classic

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

SqlRoleDefinition

Manages a Cosmos DB SQL Role Definition.

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
        {
            RoleDefinitionId = "84cf3a8b-4122-4448-bce2-fa423cfe0a15",
            ResourceGroupName = exampleResourceGroup.Name,
            AccountName = exampleAccount.Name,
            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}/dbs/sales";
                }),
            },
            Permissions = 
            {
                new Azure.CosmosDB.Inputs.SqlRoleDefinitionPermissionArgs
                {
                    DataActions = 
                    {
                        "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read",
                    },
                },
            },
        });
    }

}
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
		}
		_, err = cosmosdb.NewSqlRoleDefinition(ctx, "exampleSqlRoleDefinition", &cosmosdb.SqlRoleDefinitionArgs{
			RoleDefinitionId:  pulumi.String("84cf3a8b-4122-4448-bce2-fa423cfe0a15"),
			ResourceGroupName: exampleResourceGroup.Name,
			AccountName:       exampleAccount.Name,
			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%v", "/subscriptions/", current.SubscriptionId, "/resourceGroups/", exampleResourceGroupName, "/providers/Microsoft.DocumentDB/databaseAccounts/", exampleAccountName, "/dbs/sales"), 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
		}
		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()        
            .roleDefinitionId("84cf3a8b-4122-4448-bce2-fa423cfe0a15")
            .resourceGroupName(exampleResourceGroup.name())
            .accountName(exampleAccount.name())
            .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/dbs/sales", current.apply(getClientConfigResult -> getClientConfigResult.subscriptionId()),exampleResourceGroupName,exampleAccountName);
            }))
            .permissions(SqlRoleDefinitionPermissionArgs.builder()
                .dataActions("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read")
                .build())
            .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",
    role_definition_id="84cf3a8b-4122-4448-bce2-fa423cfe0a15",
    resource_group_name=example_resource_group.name,
    account_name=example_account.name,
    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}/dbs/sales")],
    permissions=[azure.cosmosdb.SqlRoleDefinitionPermissionArgs(
        data_actions=["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"],
    )])
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", {
    roleDefinitionId: "84cf3a8b-4122-4448-bce2-fa423cfe0a15",
    resourceGroupName: exampleResourceGroup.name,
    accountName: exampleAccount.name,
    assignableScopes: [pulumi.all([current, exampleResourceGroup.name, exampleAccount.name]).apply(([current, exampleResourceGroupName, exampleAccountName]) => `/subscriptions/${current.subscriptionId}/resourceGroups/${exampleResourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${exampleAccountName}/dbs/sales`)],
    permissions: [{
        dataActions: ["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"],
    }],
});
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:
      roleDefinitionId: 84cf3a8b-4122-4448-bce2-fa423cfe0a15
      resourceGroupName: ${exampleResourceGroup.name}
      accountName: ${exampleAccount.name}
      assignableScopes:
        - /subscriptions/${current.subscriptionId}/resourceGroups/${exampleResourceGroup.name}/providers/Microsoft.DocumentDB/databaseAccounts/${exampleAccount.name}/dbs/sales
      permissions:
        - dataActions:
            - Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read
variables:
  current:
    Fn::Invoke:
      Function: azure:core:getClientConfig
      Arguments: {}

Create a SqlRoleDefinition Resource

new SqlRoleDefinition(name: string, args: SqlRoleDefinitionArgs, opts?: CustomResourceOptions);
@overload
def SqlRoleDefinition(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      account_name: Optional[str] = None,
                      assignable_scopes: Optional[Sequence[str]] = None,
                      name: Optional[str] = None,
                      permissions: Optional[Sequence[SqlRoleDefinitionPermissionArgs]] = None,
                      resource_group_name: Optional[str] = None,
                      role_definition_id: Optional[str] = None,
                      type: Optional[str] = None)
@overload
def SqlRoleDefinition(resource_name: str,
                      args: SqlRoleDefinitionArgs,
                      opts: Optional[ResourceOptions] = None)
func NewSqlRoleDefinition(ctx *Context, name string, args SqlRoleDefinitionArgs, opts ...ResourceOption) (*SqlRoleDefinition, error)
public SqlRoleDefinition(string name, SqlRoleDefinitionArgs args, CustomResourceOptions? opts = null)
public SqlRoleDefinition(String name, SqlRoleDefinitionArgs args)
public SqlRoleDefinition(String name, SqlRoleDefinitionArgs args, CustomResourceOptions options)
type: azure:cosmosdb:SqlRoleDefinition
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

SqlRoleDefinition 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 SqlRoleDefinition resource accepts the following input properties:

AccountName string

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

AssignableScopes List<string>

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

Permissions List<SqlRoleDefinitionPermissionArgs>

A permissions block as defined below.

ResourceGroupName string

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

Name string

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

RoleDefinitionId string

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

Type string

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

AssignableScopes []string

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

Permissions []SqlRoleDefinitionPermissionArgs

A permissions block as defined below.

ResourceGroupName string

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

Name string

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

RoleDefinitionId string

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

Type string

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

assignableScopes List<String>

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

permissions List<SqlRoleDefinitionPermissionArgs>

A permissions block as defined below.

resourceGroupName String

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

name String

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

roleDefinitionId String

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

type String

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

assignableScopes string[]

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

permissions SqlRoleDefinitionPermissionArgs[]

A permissions block as defined below.

resourceGroupName string

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

name string

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

roleDefinitionId string

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

type string

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

assignable_scopes Sequence[str]

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

permissions Sequence[SqlRoleDefinitionPermissionArgs]

A permissions block as defined below.

resource_group_name str

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

name str

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

role_definition_id str

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

type str

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

assignableScopes List<String>

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

permissions List<Property Map>

A permissions block as defined below.

resourceGroupName String

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

name String

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

roleDefinitionId String

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

type String

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the SqlRoleDefinition 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 SqlRoleDefinition Resource

Get an existing SqlRoleDefinition 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?: SqlRoleDefinitionState, opts?: CustomResourceOptions): SqlRoleDefinition
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_name: Optional[str] = None,
        assignable_scopes: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        permissions: Optional[Sequence[SqlRoleDefinitionPermissionArgs]] = None,
        resource_group_name: Optional[str] = None,
        role_definition_id: Optional[str] = None,
        type: Optional[str] = None) -> SqlRoleDefinition
func GetSqlRoleDefinition(ctx *Context, name string, id IDInput, state *SqlRoleDefinitionState, opts ...ResourceOption) (*SqlRoleDefinition, error)
public static SqlRoleDefinition Get(string name, Input<string> id, SqlRoleDefinitionState? state, CustomResourceOptions? opts = null)
public static SqlRoleDefinition get(String name, Output<String> id, SqlRoleDefinitionState 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.

AssignableScopes List<string>

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

Name string

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

Permissions List<SqlRoleDefinitionPermissionArgs>

A permissions block as defined below.

ResourceGroupName string

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

RoleDefinitionId string

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

Type string

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

AssignableScopes []string

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

Name string

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

Permissions []SqlRoleDefinitionPermissionArgs

A permissions block as defined below.

ResourceGroupName string

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

RoleDefinitionId string

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

Type string

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

assignableScopes List<String>

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

name String

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

permissions List<SqlRoleDefinitionPermissionArgs>

A permissions block as defined below.

resourceGroupName String

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

roleDefinitionId String

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

type String

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

assignableScopes string[]

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

name string

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

permissions SqlRoleDefinitionPermissionArgs[]

A permissions block as defined below.

resourceGroupName string

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

roleDefinitionId string

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

type string

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

assignable_scopes Sequence[str]

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

name str

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

permissions Sequence[SqlRoleDefinitionPermissionArgs]

A permissions block as defined below.

resource_group_name str

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

role_definition_id str

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

type str

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. 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.

assignableScopes List<String>

A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition. It will allow application of this Cosmos DB SQL Role Definition on the entire Database Account or any underlying Database/Collection. Scopes higher than Database Account are not enforceable as assignable scopes.

name String

An user-friendly name for the Cosmos DB SQL Role Definition which must be unique for the Database Account.

permissions List<Property Map>

A permissions block as defined below.

resourceGroupName String

The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. Changing this forces a new resource to be created.

roleDefinitionId String

The GUID as the name of the Cosmos DB SQL Role Definition - one will be generated if not specified. Changing this forces a new resource to be created.

type String

The type of the Cosmos DB SQL Role Definition. Possible values are BuiltInRole and CustomRole. Defaults to CustomRole. Changing this forces a new resource to be created.

Supporting Types

SqlRoleDefinitionPermission

DataActions List<string>

A list of data actions that are allowed for the Cosmos DB SQL Role Definition.

DataActions []string

A list of data actions that are allowed for the Cosmos DB SQL Role Definition.

dataActions List<String>

A list of data actions that are allowed for the Cosmos DB SQL Role Definition.

dataActions string[]

A list of data actions that are allowed for the Cosmos DB SQL Role Definition.

data_actions Sequence[str]

A list of data actions that are allowed for the Cosmos DB SQL Role Definition.

dataActions List<String>

A list of data actions that are allowed for the Cosmos DB SQL Role Definition.

Import

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

 $ pulumi import azure:cosmosdb/sqlRoleDefinition:SqlRoleDefinition example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlRoleDefinitions/28b3c337-f436-482b-a167-c2618dc52033

Package Details

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

This Pulumi package is based on the azurerm Terraform Provider.