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

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

azure.cosmosdb.getSqlRoleDefinition

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

    Use this data source to access information about an existing Cosmos DB SQL Role Definition.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.cosmosdb.getSqlRoleDefinition({
        resourceGroupName: "tfex-cosmosdb-sql-role-definition-rg",
        accountName: "tfex-cosmosdb-sql-role-definition-account-name",
        roleDefinitionId: "00000000-0000-0000-0000-000000000000",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.cosmosdb.get_sql_role_definition(resource_group_name="tfex-cosmosdb-sql-role-definition-rg",
        account_name="tfex-cosmosdb-sql-role-definition-account-name",
        role_definition_id="00000000-0000-0000-0000-000000000000")
    
    package main
    
    import (
    	"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 {
    		_, err := cosmosdb.LookupSqlRoleDefinition(ctx, &cosmosdb.LookupSqlRoleDefinitionArgs{
    			ResourceGroupName: "tfex-cosmosdb-sql-role-definition-rg",
    			AccountName:       "tfex-cosmosdb-sql-role-definition-account-name",
    			RoleDefinitionId:  "00000000-0000-0000-0000-000000000000",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.CosmosDB.GetSqlRoleDefinition.Invoke(new()
        {
            ResourceGroupName = "tfex-cosmosdb-sql-role-definition-rg",
            AccountName = "tfex-cosmosdb-sql-role-definition-account-name",
            RoleDefinitionId = "00000000-0000-0000-0000-000000000000",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.cosmosdb.CosmosdbFunctions;
    import com.pulumi.azure.cosmosdb.inputs.GetSqlRoleDefinitionArgs;
    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 example = CosmosdbFunctions.getSqlRoleDefinition(GetSqlRoleDefinitionArgs.builder()
                .resourceGroupName("tfex-cosmosdb-sql-role-definition-rg")
                .accountName("tfex-cosmosdb-sql-role-definition-account-name")
                .roleDefinitionId("00000000-0000-0000-0000-000000000000")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:cosmosdb:getSqlRoleDefinition
          Arguments:
            resourceGroupName: tfex-cosmosdb-sql-role-definition-rg
            accountName: tfex-cosmosdb-sql-role-definition-account-name
            roleDefinitionId: 00000000-0000-0000-0000-000000000000
    

    Using getSqlRoleDefinition

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSqlRoleDefinition(args: GetSqlRoleDefinitionArgs, opts?: InvokeOptions): Promise<GetSqlRoleDefinitionResult>
    function getSqlRoleDefinitionOutput(args: GetSqlRoleDefinitionOutputArgs, opts?: InvokeOptions): Output<GetSqlRoleDefinitionResult>
    def get_sql_role_definition(account_name: Optional[str] = None,
                                resource_group_name: Optional[str] = None,
                                role_definition_id: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetSqlRoleDefinitionResult
    def get_sql_role_definition_output(account_name: Optional[pulumi.Input[str]] = None,
                                resource_group_name: Optional[pulumi.Input[str]] = None,
                                role_definition_id: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetSqlRoleDefinitionResult]
    func LookupSqlRoleDefinition(ctx *Context, args *LookupSqlRoleDefinitionArgs, opts ...InvokeOption) (*LookupSqlRoleDefinitionResult, error)
    func LookupSqlRoleDefinitionOutput(ctx *Context, args *LookupSqlRoleDefinitionOutputArgs, opts ...InvokeOption) LookupSqlRoleDefinitionResultOutput

    > Note: This function is named LookupSqlRoleDefinition in the Go SDK.

    public static class GetSqlRoleDefinition 
    {
        public static Task<GetSqlRoleDefinitionResult> InvokeAsync(GetSqlRoleDefinitionArgs args, InvokeOptions? opts = null)
        public static Output<GetSqlRoleDefinitionResult> Invoke(GetSqlRoleDefinitionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSqlRoleDefinitionResult> getSqlRoleDefinition(GetSqlRoleDefinitionArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:cosmosdb/getSqlRoleDefinition:getSqlRoleDefinition
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountName string
    The name of the Cosmos DB Account.
    ResourceGroupName string
    The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
    RoleDefinitionId string
    The GUID as the name of the Cosmos DB SQL Role Definition.
    AccountName string
    The name of the Cosmos DB Account.
    ResourceGroupName string
    The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
    RoleDefinitionId string
    The GUID as the name of the Cosmos DB SQL Role Definition.
    accountName String
    The name of the Cosmos DB Account.
    resourceGroupName String
    The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
    roleDefinitionId String
    The GUID as the name of the Cosmos DB SQL Role Definition.
    accountName string
    The name of the Cosmos DB Account.
    resourceGroupName string
    The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
    roleDefinitionId string
    The GUID as the name of the Cosmos DB SQL Role Definition.
    account_name str
    The name of the Cosmos DB Account.
    resource_group_name str
    The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
    role_definition_id str
    The GUID as the name of the Cosmos DB SQL Role Definition.
    accountName String
    The name of the Cosmos DB Account.
    resourceGroupName String
    The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
    roleDefinitionId String
    The GUID as the name of the Cosmos DB SQL Role Definition.

    getSqlRoleDefinition Result

    The following output properties are available:

    AccountName string
    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.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The role name of the Cosmos DB SQL Role Definition.
    Permissions List<GetSqlRoleDefinitionPermission>
    A permissions block as defined below.
    ResourceGroupName string
    RoleDefinitionId string
    Type string
    The type of the Cosmos DB SQL Role Definition.
    AccountName string
    AssignableScopes []string
    A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The role name of the Cosmos DB SQL Role Definition.
    Permissions []GetSqlRoleDefinitionPermission
    A permissions block as defined below.
    ResourceGroupName string
    RoleDefinitionId string
    Type string
    The type of the Cosmos DB SQL Role Definition.
    accountName String
    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.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The role name of the Cosmos DB SQL Role Definition.
    permissions List<GetSqlRoleDefinitionPermission>
    A permissions block as defined below.
    resourceGroupName String
    roleDefinitionId String
    type String
    The type of the Cosmos DB SQL Role Definition.
    accountName string
    assignableScopes string[]
    A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The role name of the Cosmos DB SQL Role Definition.
    permissions GetSqlRoleDefinitionPermission[]
    A permissions block as defined below.
    resourceGroupName string
    roleDefinitionId string
    type string
    The type of the Cosmos DB SQL Role Definition.
    account_name str
    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.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The role name of the Cosmos DB SQL Role Definition.
    permissions Sequence[GetSqlRoleDefinitionPermission]
    A permissions block as defined below.
    resource_group_name str
    role_definition_id str
    type str
    The type of the Cosmos DB SQL Role Definition.
    accountName String
    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.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The role name of the Cosmos DB SQL Role Definition.
    permissions List<Property Map>
    A permissions block as defined below.
    resourceGroupName String
    roleDefinitionId String
    type String
    The type of the Cosmos DB SQL Role Definition.

    Supporting Types

    GetSqlRoleDefinitionPermission

    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.

    Package Details

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

    We recommend using Azure Native.

    Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi