published on Thursday, Feb 26, 2026 by Pulumi
published on Thursday, Feb 26, 2026 by Pulumi
!> Warning This is a dangerous resource that allows executing ANY SQL statement. It may destroy resources if used incorrectly. It may behave incorrectly combined with other resources. Use at your own risk.
!> Warning Do not run USE ROLE ... or USE WAREHOUSE ... statements as they will cause the provider to produce inconsistent results. Use provider aliases with different roles instead.
!> Sensitive values This resource’s execute, query, revert and query_results fields are not marked as sensitive in the provider. Ensure that no personal data, sensitive data, export-controlled data, or other regulated data is entered as metadata when using the provider. If you use one of these fields, they may be present in logs, so ensure that the provider logs are properly restricted. For more information, see Sensitive values limitations and Metadata fields in Snowflake.
Note It can be theoretically used to manage resource that are not supported by the provider. This is risky and may break other resources if used incorrectly.
Note Use
queryparameter with caution. It will fetch ALL the results returned by the query provided. Try to limit the number of results by writing query with filters. Query failure does not stop resource creation; it simply results inquery_resultsbeing empty.
Note: Default timeout is set to 60 minutes for each Terraform operation.
Resource allowing execution of ANY SQL statement.
Create Execute Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Execute(name: string, args: ExecuteArgs, opts?: CustomResourceOptions);@overload
def Execute(resource_name: str,
args: ExecuteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Execute(resource_name: str,
opts: Optional[ResourceOptions] = None,
execute: Optional[str] = None,
revert: Optional[str] = None,
query: Optional[str] = None)func NewExecute(ctx *Context, name string, args ExecuteArgs, opts ...ResourceOption) (*Execute, error)public Execute(string name, ExecuteArgs args, CustomResourceOptions? opts = null)
public Execute(String name, ExecuteArgs args)
public Execute(String name, ExecuteArgs args, CustomResourceOptions options)
type: snowflake:Execute
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 ExecuteArgs
- 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 ExecuteArgs
- 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 ExecuteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExecuteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExecuteArgs
- 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 executeResource = new Snowflake.Execute("executeResource", new()
{
ExecuteSQL = "string",
Revert = "string",
Query = "string",
});
example, err := snowflake.NewExecute(ctx, "executeResource", &snowflake.ExecuteArgs{
Execute: pulumi.String("string"),
Revert: pulumi.String("string"),
Query: pulumi.String("string"),
})
var executeResource = new Execute("executeResource", ExecuteArgs.builder()
.execute("string")
.revert("string")
.query("string")
.build());
execute_resource = snowflake.Execute("executeResource",
execute="string",
revert="string",
query="string")
const executeResource = new snowflake.Execute("executeResource", {
execute: "string",
revert: "string",
query: "string",
});
type: snowflake:Execute
properties:
execute: string
query: string
revert: string
Execute 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 Execute resource accepts the following input properties:
- Execute
SQL string - SQL statement to execute. Forces recreation of resource on change.
- Revert string
- SQL statement to revert the execute statement. Invoked when resource is being destroyed.
- Query string
- Optional SQL statement to do a read. Invoked on every resource refresh and every time it is changed.
Outputs
All input properties are implicitly available as output properties. Additionally, the Execute resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Query
Results List<ImmutableDictionary<string, string>> - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- Id string
- The provider-assigned unique ID for this managed resource.
- Query
Results []map[string]string - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- id String
- The provider-assigned unique ID for this managed resource.
- query
Results List<Map<String,String>> - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- id string
- The provider-assigned unique ID for this managed resource.
- query
Results {[key: string]: string}[] - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- id str
- The provider-assigned unique ID for this managed resource.
- query_
results Sequence[Mapping[str, str]] - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- id String
- The provider-assigned unique ID for this managed resource.
- query
Results List<Map<String>> - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
Look up Existing Execute Resource
Get an existing Execute 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?: ExecuteState, opts?: CustomResourceOptions): Execute@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
execute: Optional[str] = None,
query: Optional[str] = None,
query_results: Optional[Sequence[Mapping[str, str]]] = None,
revert: Optional[str] = None) -> Executefunc GetExecute(ctx *Context, name string, id IDInput, state *ExecuteState, opts ...ResourceOption) (*Execute, error)public static Execute Get(string name, Input<string> id, ExecuteState? state, CustomResourceOptions? opts = null)public static Execute get(String name, Output<String> id, ExecuteState state, CustomResourceOptions options)resources: _: type: snowflake:Execute get: id: ${id}- 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.
- Execute
SQL string - SQL statement to execute. Forces recreation of resource on change.
- Query string
- Optional SQL statement to do a read. Invoked on every resource refresh and every time it is changed.
- Query
Results List<ImmutableDictionary<string, string>> - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- Revert string
- SQL statement to revert the execute statement. Invoked when resource is being destroyed.
- Execute string
- SQL statement to execute. Forces recreation of resource on change.
- Query string
- Optional SQL statement to do a read. Invoked on every resource refresh and every time it is changed.
- Query
Results []map[string]string - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- Revert string
- SQL statement to revert the execute statement. Invoked when resource is being destroyed.
- execute String
- SQL statement to execute. Forces recreation of resource on change.
- query String
- Optional SQL statement to do a read. Invoked on every resource refresh and every time it is changed.
- query
Results List<Map<String,String>> - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- revert String
- SQL statement to revert the execute statement. Invoked when resource is being destroyed.
- execute string
- SQL statement to execute. Forces recreation of resource on change.
- query string
- Optional SQL statement to do a read. Invoked on every resource refresh and every time it is changed.
- query
Results {[key: string]: string}[] - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- revert string
- SQL statement to revert the execute statement. Invoked when resource is being destroyed.
- execute str
- SQL statement to execute. Forces recreation of resource on change.
- query str
- Optional SQL statement to do a read. Invoked on every resource refresh and every time it is changed.
- query_
results Sequence[Mapping[str, str]] - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- revert str
- SQL statement to revert the execute statement. Invoked when resource is being destroyed.
- execute String
- SQL statement to execute. Forces recreation of resource on change.
- query String
- Optional SQL statement to do a read. Invoked on every resource refresh and every time it is changed.
- query
Results List<Map<String>> - List of key-value maps (text to text) retrieved after executing read query. Will be empty if the query results in an error.
- revert String
- SQL statement to revert the execute statement. Invoked when resource is being destroyed.
Import
$ pulumi import snowflake:index/execute:Execute example '<random_uuid>'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Snowflake pulumi/pulumi-snowflake
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
snowflakeTerraform Provider.
published on Thursday, Feb 26, 2026 by Pulumi
