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

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.cosmosdb.SqlStoredProcedure

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Manages a SQL Stored Procedure within a Cosmos DB Account SQL Database.

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    resources:
      exampleSqlDatabase:
        type: azure:cosmosdb:SqlDatabase
        name: example
        properties:
          name: tfex-cosmos-db
          resourceGroupName: ${example.resourceGroupName}
          accountName: ${example.name}
          throughput: 400
      exampleSqlContainer:
        type: azure:cosmosdb:SqlContainer
        name: example
        properties:
          name: example-container
          resourceGroupName: ${example.resourceGroupName}
          accountName: ${example.name}
          databaseName: ${exampleSqlDatabase.name}
          partitionKeyPath: /id
      exampleSqlStoredProcedure:
        type: azure:cosmosdb:SqlStoredProcedure
        name: example
        properties:
          name: test-stored-proc
          resourceGroupName: ${example.resourceGroupName}
          accountName: ${example.name}
          databaseName: ${exampleSqlDatabase.name}
          containerName: ${exampleSqlContainer.name}
          body: |2
               function () { var context = getContext(); var response = context.getResponse(); response.setBody('Hello, World'); }
    variables:
      example:
        fn::invoke:
          Function: azure:cosmosdb:getAccount
          Arguments:
            name: tfex-cosmosdb-account
            resourceGroupName: tfex-cosmosdb-account-rg
    

    Create SqlStoredProcedure Resource

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

    Constructor syntax

    new SqlStoredProcedure(name: string, args: SqlStoredProcedureArgs, opts?: CustomResourceOptions);
    @overload
    def SqlStoredProcedure(resource_name: str,
                           args: SqlStoredProcedureArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def SqlStoredProcedure(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           account_name: Optional[str] = None,
                           body: Optional[str] = None,
                           container_name: Optional[str] = None,
                           database_name: Optional[str] = None,
                           resource_group_name: Optional[str] = None,
                           name: Optional[str] = None)
    func NewSqlStoredProcedure(ctx *Context, name string, args SqlStoredProcedureArgs, opts ...ResourceOption) (*SqlStoredProcedure, error)
    public SqlStoredProcedure(string name, SqlStoredProcedureArgs args, CustomResourceOptions? opts = null)
    public SqlStoredProcedure(String name, SqlStoredProcedureArgs args)
    public SqlStoredProcedure(String name, SqlStoredProcedureArgs args, CustomResourceOptions options)
    
    type: azure:cosmosdb:SqlStoredProcedure
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SqlStoredProcedureArgs
    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 SqlStoredProcedureArgs
    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 SqlStoredProcedureArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SqlStoredProcedureArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SqlStoredProcedureArgs
    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 sqlStoredProcedureResource = new Azure.CosmosDB.SqlStoredProcedure("sqlStoredProcedureResource", new()
    {
        AccountName = "string",
        Body = "string",
        ContainerName = "string",
        DatabaseName = "string",
        ResourceGroupName = "string",
        Name = "string",
    });
    
    example, err := cosmosdb.NewSqlStoredProcedure(ctx, "sqlStoredProcedureResource", &cosmosdb.SqlStoredProcedureArgs{
    	AccountName:       pulumi.String("string"),
    	Body:              pulumi.String("string"),
    	ContainerName:     pulumi.String("string"),
    	DatabaseName:      pulumi.String("string"),
    	ResourceGroupName: pulumi.String("string"),
    	Name:              pulumi.String("string"),
    })
    
    var sqlStoredProcedureResource = new SqlStoredProcedure("sqlStoredProcedureResource", SqlStoredProcedureArgs.builder()
        .accountName("string")
        .body("string")
        .containerName("string")
        .databaseName("string")
        .resourceGroupName("string")
        .name("string")
        .build());
    
    sql_stored_procedure_resource = azure.cosmosdb.SqlStoredProcedure("sqlStoredProcedureResource",
        account_name="string",
        body="string",
        container_name="string",
        database_name="string",
        resource_group_name="string",
        name="string")
    
    const sqlStoredProcedureResource = new azure.cosmosdb.SqlStoredProcedure("sqlStoredProcedureResource", {
        accountName: "string",
        body: "string",
        containerName: "string",
        databaseName: "string",
        resourceGroupName: "string",
        name: "string",
    });
    
    type: azure:cosmosdb:SqlStoredProcedure
    properties:
        accountName: string
        body: string
        containerName: string
        databaseName: string
        name: string
        resourceGroupName: string
    

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

    AccountName string
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    Body string
    The body of the stored procedure.
    ContainerName string
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    DatabaseName string
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
    Name string
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    AccountName string
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    Body string
    The body of the stored procedure.
    ContainerName string
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    DatabaseName string
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
    Name string
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    accountName String
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    body String
    The body of the stored procedure.
    containerName String
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    databaseName String
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    accountName string
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    body string
    The body of the stored procedure.
    containerName string
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    databaseName string
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    resourceGroupName string
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
    name string
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    account_name str
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    body str
    The body of the stored procedure.
    container_name str
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    database_name str
    The name of the Cosmos DB SQL Database to create the stored procedure within. 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 Database is created. Changing this forces a new resource to be created.
    name str
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    accountName String
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    body String
    The body of the stored procedure.
    containerName String
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    databaseName String
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.

    Outputs

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

    Get an existing SqlStoredProcedure 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?: SqlStoredProcedureState, opts?: CustomResourceOptions): SqlStoredProcedure
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_name: Optional[str] = None,
            body: Optional[str] = None,
            container_name: Optional[str] = None,
            database_name: Optional[str] = None,
            name: Optional[str] = None,
            resource_group_name: Optional[str] = None) -> SqlStoredProcedure
    func GetSqlStoredProcedure(ctx *Context, name string, id IDInput, state *SqlStoredProcedureState, opts ...ResourceOption) (*SqlStoredProcedure, error)
    public static SqlStoredProcedure Get(string name, Input<string> id, SqlStoredProcedureState? state, CustomResourceOptions? opts = null)
    public static SqlStoredProcedure get(String name, Output<String> id, SqlStoredProcedureState 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 to create the stored procedure within. Changing this forces a new resource to be created.
    Body string
    The body of the stored procedure.
    ContainerName string
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    DatabaseName string
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    Name string
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
    AccountName string
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    Body string
    The body of the stored procedure.
    ContainerName string
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    DatabaseName string
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    Name string
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
    accountName String
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    body String
    The body of the stored procedure.
    containerName String
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    databaseName String
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
    accountName string
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    body string
    The body of the stored procedure.
    containerName string
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    databaseName string
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    name string
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    resourceGroupName string
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.
    account_name str
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    body str
    The body of the stored procedure.
    container_name str
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    database_name str
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    name str
    Specifies the name of the Cosmos DB SQL Stored Procedure. 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 Database is created. Changing this forces a new resource to be created.
    accountName String
    The name of the Cosmos DB Account to create the stored procedure within. Changing this forces a new resource to be created.
    body String
    The body of the stored procedure.
    containerName String
    The name of the Cosmos DB SQL Container to create the stored procedure within. Changing this forces a new resource to be created.
    databaseName String
    The name of the Cosmos DB SQL Database to create the stored procedure within. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Cosmos DB SQL Stored Procedure. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.

    Import

    CosmosDB SQL Stored Procedures can be imported using the resource id, e.g.

    $ pulumi import azure:cosmosdb/sqlStoredProcedure:SqlStoredProcedure db1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/db1/containers/c1/storedProcedures/sp1
    

    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.
    azure logo

    We recommend using Azure Native.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi