We recommend using Azure Native.
azure.cosmosdb.SqlTrigger
Explore with Pulumi AI
Manages an SQL Trigger.
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
exampleSqlTrigger:
type: azure:cosmosdb:SqlTrigger
name: example
properties:
name: test-trigger
containerId: ${exampleSqlContainer.id}
body: function trigger(){}
operation: Delete
type: Post
variables:
example:
fn::invoke:
Function: azure:cosmosdb:getAccount
Arguments:
name: tfex-cosmosdb-account
resourceGroupName: tfex-cosmosdb-account-rg
Create SqlTrigger Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SqlTrigger(name: string, args: SqlTriggerArgs, opts?: CustomResourceOptions);
@overload
def SqlTrigger(resource_name: str,
args: SqlTriggerArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SqlTrigger(resource_name: str,
opts: Optional[ResourceOptions] = None,
body: Optional[str] = None,
container_id: Optional[str] = None,
operation: Optional[str] = None,
type: Optional[str] = None,
name: Optional[str] = None)
func NewSqlTrigger(ctx *Context, name string, args SqlTriggerArgs, opts ...ResourceOption) (*SqlTrigger, error)
public SqlTrigger(string name, SqlTriggerArgs args, CustomResourceOptions? opts = null)
public SqlTrigger(String name, SqlTriggerArgs args)
public SqlTrigger(String name, SqlTriggerArgs args, CustomResourceOptions options)
type: azure:cosmosdb:SqlTrigger
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 SqlTriggerArgs
- 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 SqlTriggerArgs
- 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 SqlTriggerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SqlTriggerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SqlTriggerArgs
- 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 sqlTriggerResource = new Azure.CosmosDB.SqlTrigger("sqlTriggerResource", new()
{
Body = "string",
ContainerId = "string",
Operation = "string",
Type = "string",
Name = "string",
});
example, err := cosmosdb.NewSqlTrigger(ctx, "sqlTriggerResource", &cosmosdb.SqlTriggerArgs{
Body: pulumi.String("string"),
ContainerId: pulumi.String("string"),
Operation: pulumi.String("string"),
Type: pulumi.String("string"),
Name: pulumi.String("string"),
})
var sqlTriggerResource = new SqlTrigger("sqlTriggerResource", SqlTriggerArgs.builder()
.body("string")
.containerId("string")
.operation("string")
.type("string")
.name("string")
.build());
sql_trigger_resource = azure.cosmosdb.SqlTrigger("sqlTriggerResource",
body="string",
container_id="string",
operation="string",
type="string",
name="string")
const sqlTriggerResource = new azure.cosmosdb.SqlTrigger("sqlTriggerResource", {
body: "string",
containerId: "string",
operation: "string",
type: "string",
name: "string",
});
type: azure:cosmosdb:SqlTrigger
properties:
body: string
containerId: string
name: string
operation: string
type: string
SqlTrigger 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 SqlTrigger resource accepts the following input properties:
- Body string
- Body of the Trigger.
- Container
Id string - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- Operation string
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - Type string
- Type of the Trigger. Possible values are
Pre
andPost
. - Name string
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- Body string
- Body of the Trigger.
- Container
Id string - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- Operation string
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - Type string
- Type of the Trigger. Possible values are
Pre
andPost
. - Name string
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- body String
- Body of the Trigger.
- container
Id String - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- operation String
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - type String
- Type of the Trigger. Possible values are
Pre
andPost
. - name String
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- body string
- Body of the Trigger.
- container
Id string - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- operation string
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - type string
- Type of the Trigger. Possible values are
Pre
andPost
. - name string
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- body str
- Body of the Trigger.
- container_
id str - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- operation str
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - type str
- Type of the Trigger. Possible values are
Pre
andPost
. - name str
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- body String
- Body of the Trigger.
- container
Id String - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- operation String
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - type String
- Type of the Trigger. Possible values are
Pre
andPost
. - name String
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the SqlTrigger 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 SqlTrigger Resource
Get an existing SqlTrigger 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?: SqlTriggerState, opts?: CustomResourceOptions): SqlTrigger
@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,
operation: Optional[str] = None,
type: Optional[str] = None) -> SqlTrigger
func GetSqlTrigger(ctx *Context, name string, id IDInput, state *SqlTriggerState, opts ...ResourceOption) (*SqlTrigger, error)
public static SqlTrigger Get(string name, Input<string> id, SqlTriggerState? state, CustomResourceOptions? opts = null)
public static SqlTrigger get(String name, Output<String> id, SqlTriggerState 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.
- Body string
- Body of the Trigger.
- Container
Id string - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- Name string
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- Operation string
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - Type string
- Type of the Trigger. Possible values are
Pre
andPost
.
- Body string
- Body of the Trigger.
- Container
Id string - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- Name string
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- Operation string
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - Type string
- Type of the Trigger. Possible values are
Pre
andPost
.
- body String
- Body of the Trigger.
- container
Id String - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- name String
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- operation String
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - type String
- Type of the Trigger. Possible values are
Pre
andPost
.
- body string
- Body of the Trigger.
- container
Id string - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- name string
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- operation string
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - type string
- Type of the Trigger. Possible values are
Pre
andPost
.
- body str
- Body of the Trigger.
- container_
id str - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- name str
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- operation str
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - type str
- Type of the Trigger. Possible values are
Pre
andPost
.
- body String
- Body of the Trigger.
- container
Id String - The id of the Cosmos DB SQL Container to create the SQL Trigger within. Changing this forces a new SQL Trigger to be created.
- name String
- The name which should be used for this SQL Trigger. Changing this forces a new SQL Trigger to be created.
- operation String
- The operation the trigger is associated with. Possible values are
All
,Create
,Update
,Delete
andReplace
. - type String
- Type of the Trigger. Possible values are
Pre
andPost
.
Import
SQL Triggers can be imported using the resource id
, e.g.
$ pulumi import azure:cosmosdb/sqlTrigger:SqlTrigger example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/database1/containers/container1/triggers/trigger1
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.