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

We recommend using Azure Native.

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

azure.cosmosdb.SqlFunction

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

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

    Manages an SQL User Defined Function.

    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
      exampleSqlFunction:
        type: azure:cosmosdb:SqlFunction
        name: example
        properties:
          name: test-function
          containerId: ${exampleSqlContainer.id}
          body: function trigger(){}
    variables:
      example:
        fn::invoke:
          Function: azure:cosmosdb:getAccount
          Arguments:
            name: tfex-cosmosdb-account
            resourceGroupName: tfex-cosmosdb-account-rg
    

    Create SqlFunction Resource

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

    Constructor syntax

    new SqlFunction(name: string, args: SqlFunctionArgs, opts?: CustomResourceOptions);
    @overload
    def SqlFunction(resource_name: str,
                    args: SqlFunctionArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def SqlFunction(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    body: Optional[str] = None,
                    container_id: Optional[str] = None,
                    name: Optional[str] = None)
    func NewSqlFunction(ctx *Context, name string, args SqlFunctionArgs, opts ...ResourceOption) (*SqlFunction, error)
    public SqlFunction(string name, SqlFunctionArgs args, CustomResourceOptions? opts = null)
    public SqlFunction(String name, SqlFunctionArgs args)
    public SqlFunction(String name, SqlFunctionArgs args, CustomResourceOptions options)
    
    type: azure:cosmosdb:SqlFunction
    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 SqlFunctionArgs
    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 SqlFunctionArgs
    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 SqlFunctionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SqlFunctionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SqlFunctionArgs
    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 sqlFunctionResource = new Azure.CosmosDB.SqlFunction("sqlFunctionResource", new()
    {
        Body = "string",
        ContainerId = "string",
        Name = "string",
    });
    
    example, err := cosmosdb.NewSqlFunction(ctx, "sqlFunctionResource", &cosmosdb.SqlFunctionArgs{
    	Body:        pulumi.String("string"),
    	ContainerId: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var sqlFunctionResource = new SqlFunction("sqlFunctionResource", SqlFunctionArgs.builder()
        .body("string")
        .containerId("string")
        .name("string")
        .build());
    
    sql_function_resource = azure.cosmosdb.SqlFunction("sqlFunctionResource",
        body="string",
        container_id="string",
        name="string")
    
    const sqlFunctionResource = new azure.cosmosdb.SqlFunction("sqlFunctionResource", {
        body: "string",
        containerId: "string",
        name: "string",
    });
    
    type: azure:cosmosdb:SqlFunction
    properties:
        body: string
        containerId: string
        name: string
    

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

    Body string
    Body of the User Defined Function.
    ContainerId string
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    Name string
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    Body string
    Body of the User Defined Function.
    ContainerId string
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    Name string
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    body String
    Body of the User Defined Function.
    containerId String
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    name String
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    body string
    Body of the User Defined Function.
    containerId string
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    name string
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    body str
    Body of the User Defined Function.
    container_id str
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    name str
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    body String
    Body of the User Defined Function.
    containerId String
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    name String
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.

    Outputs

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

    Get an existing SqlFunction 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?: SqlFunctionState, opts?: CustomResourceOptions): SqlFunction
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            body: Optional[str] = None,
            container_id: Optional[str] = None,
            name: Optional[str] = None) -> SqlFunction
    func GetSqlFunction(ctx *Context, name string, id IDInput, state *SqlFunctionState, opts ...ResourceOption) (*SqlFunction, error)
    public static SqlFunction Get(string name, Input<string> id, SqlFunctionState? state, CustomResourceOptions? opts = null)
    public static SqlFunction get(String name, Output<String> id, SqlFunctionState 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:
    Body string
    Body of the User Defined Function.
    ContainerId string
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    Name string
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    Body string
    Body of the User Defined Function.
    ContainerId string
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    Name string
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    body String
    Body of the User Defined Function.
    containerId String
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    name String
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    body string
    Body of the User Defined Function.
    containerId string
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    name string
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    body str
    Body of the User Defined Function.
    container_id str
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    name str
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.
    body String
    Body of the User Defined Function.
    containerId String
    The id of the Cosmos DB SQL Container to create the SQL User Defined Function within. Changing this forces a new SQL User Defined Function to be created.
    name String
    The name which should be used for this SQL User Defined Function. Changing this forces a new SQL User Defined Function to be created.

    Import

    SQL User Defined Functions can be imported using the resource id, e.g.

    $ pulumi import azure:cosmosdb/sqlFunction:SqlFunction example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/database1/containers/container1/userDefinedFunctions/userDefinedFunction1
    

    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