azure-native.resourcegraph.GraphQuery
Explore with Pulumi AI
Graph Query entity definition. Azure REST API version: 2020-04-01-preview. Prior API version in Azure Native 1.x: 2018-09-01-preview.
Other available API versions: 2018-09-01-preview, 2019-04-01, 2021-03-01, 2022-10-01.
Example Usage
Create Graph Query
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var graphQuery = new AzureNative.ResourceGraph.GraphQuery("graphQuery", new()
{
Description = "Docker VMs in PROD",
Query = "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
ResourceGroupName = "my-resource-group",
ResourceName = "MyDockerVMs",
Tags = null,
});
});
package main
import (
resourcegraph "github.com/pulumi/pulumi-azure-native-sdk/resourcegraph/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := resourcegraph.NewGraphQuery(ctx, "graphQuery", &resourcegraph.GraphQueryArgs{
Description: pulumi.String("Docker VMs in PROD"),
Query: pulumi.String("where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'"),
ResourceGroupName: pulumi.String("my-resource-group"),
ResourceName: pulumi.String("MyDockerVMs"),
Tags: nil,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.resourcegraph.GraphQuery;
import com.pulumi.azurenative.resourcegraph.GraphQueryArgs;
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) {
var graphQuery = new GraphQuery("graphQuery", GraphQueryArgs.builder()
.description("Docker VMs in PROD")
.query("where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'")
.resourceGroupName("my-resource-group")
.resourceName("MyDockerVMs")
.tags()
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
graph_query = azure_native.resourcegraph.GraphQuery("graphQuery",
description="Docker VMs in PROD",
query="where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
resource_group_name="my-resource-group",
resource_name_="MyDockerVMs",
tags={})
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const graphQuery = new azure_native.resourcegraph.GraphQuery("graphQuery", {
description: "Docker VMs in PROD",
query: "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
resourceGroupName: "my-resource-group",
resourceName: "MyDockerVMs",
tags: {},
});
resources:
graphQuery:
type: azure-native:resourcegraph:GraphQuery
properties:
description: Docker VMs in PROD
query: where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'
resourceGroupName: my-resource-group
resourceName: MyDockerVMs
tags: {}
Create GraphQuery Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GraphQuery(name: string, args: GraphQueryArgs, opts?: CustomResourceOptions);
@overload
def GraphQuery(resource_name: str,
args: GraphQueryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GraphQuery(resource_name: str,
opts: Optional[ResourceOptions] = None,
query: Optional[str] = None,
resource_group_name: Optional[str] = None,
description: Optional[str] = None,
resource_name_: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewGraphQuery(ctx *Context, name string, args GraphQueryArgs, opts ...ResourceOption) (*GraphQuery, error)
public GraphQuery(string name, GraphQueryArgs args, CustomResourceOptions? opts = null)
public GraphQuery(String name, GraphQueryArgs args)
public GraphQuery(String name, GraphQueryArgs args, CustomResourceOptions options)
type: azure-native:resourcegraph:GraphQuery
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 GraphQueryArgs
- 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 GraphQueryArgs
- 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 GraphQueryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GraphQueryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GraphQueryArgs
- 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 graphQueryResource = new AzureNative.ResourceGraph.GraphQuery("graphQueryResource", new()
{
Query = "string",
ResourceGroupName = "string",
Description = "string",
ResourceName = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := resourcegraph.NewGraphQuery(ctx, "graphQueryResource", &resourcegraph.GraphQueryArgs{
Query: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
Description: pulumi.String("string"),
ResourceName: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var graphQueryResource = new GraphQuery("graphQueryResource", GraphQueryArgs.builder()
.query("string")
.resourceGroupName("string")
.description("string")
.resourceName("string")
.tags(Map.of("string", "string"))
.build());
graph_query_resource = azure_native.resourcegraph.GraphQuery("graphQueryResource",
query="string",
resource_group_name="string",
description="string",
resource_name_="string",
tags={
"string": "string",
})
const graphQueryResource = new azure_native.resourcegraph.GraphQuery("graphQueryResource", {
query: "string",
resourceGroupName: "string",
description: "string",
resourceName: "string",
tags: {
string: "string",
},
});
type: azure-native:resourcegraph:GraphQuery
properties:
description: string
query: string
resourceGroupName: string
resourceName: string
tags:
string: string
GraphQuery Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The GraphQuery resource accepts the following input properties:
- Query string
- KQL query that will be graph.
- Resource
Group stringName - The name of the resource group.
- Description string
- The description of a graph query.
- Resource
Name string - The name of the Graph Query resource.
- Dictionary<string, string>
- Resource tags
- Query string
- KQL query that will be graph.
- Resource
Group stringName - The name of the resource group.
- Description string
- The description of a graph query.
- Resource
Name string - The name of the Graph Query resource.
- map[string]string
- Resource tags
- query String
- KQL query that will be graph.
- resource
Group StringName - The name of the resource group.
- description String
- The description of a graph query.
- resource
Name String - The name of the Graph Query resource.
- Map<String,String>
- Resource tags
- query string
- KQL query that will be graph.
- resource
Group stringName - The name of the resource group.
- description string
- The description of a graph query.
- resource
Name string - The name of the Graph Query resource.
- {[key: string]: string}
- Resource tags
- query str
- KQL query that will be graph.
- resource_
group_ strname - The name of the resource group.
- description str
- The description of a graph query.
- resource_
name str - The name of the Graph Query resource.
- Mapping[str, str]
- Resource tags
- query String
- KQL query that will be graph.
- resource
Group StringName - The name of the resource group.
- description String
- The description of a graph query.
- resource
Name String - The name of the Graph Query resource.
- Map<String>
- Resource tags
Outputs
All input properties are implicitly available as output properties. Additionally, the GraphQuery resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The location of the resource
- Name string
- Azure resource name. This is GUID value. The display name should be assigned within properties field.
- Result
Kind string - Enum indicating a type of graph query.
- System
Data Pulumi.Azure Native. Resource Graph. Outputs. System Data Response - Metadata pertaining to creation and last modification of the resource.
- Time
Modified string - Date and time in UTC of the last modification that was made to this graph query definition.
- Type string
- Azure resource type
- Etag string
- This will be used to handle Optimistic Concurrency.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The location of the resource
- Name string
- Azure resource name. This is GUID value. The display name should be assigned within properties field.
- Result
Kind string - Enum indicating a type of graph query.
- System
Data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- Time
Modified string - Date and time in UTC of the last modification that was made to this graph query definition.
- Type string
- Azure resource type
- Etag string
- This will be used to handle Optimistic Concurrency.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The location of the resource
- name String
- Azure resource name. This is GUID value. The display name should be assigned within properties field.
- result
Kind String - Enum indicating a type of graph query.
- system
Data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- time
Modified String - Date and time in UTC of the last modification that was made to this graph query definition.
- type String
- Azure resource type
- etag String
- This will be used to handle Optimistic Concurrency.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The location of the resource
- name string
- Azure resource name. This is GUID value. The display name should be assigned within properties field.
- result
Kind string - Enum indicating a type of graph query.
- system
Data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- time
Modified string - Date and time in UTC of the last modification that was made to this graph query definition.
- type string
- Azure resource type
- etag string
- This will be used to handle Optimistic Concurrency.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- The location of the resource
- name str
- Azure resource name. This is GUID value. The display name should be assigned within properties field.
- result_
kind str - Enum indicating a type of graph query.
- system_
data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- time_
modified str - Date and time in UTC of the last modification that was made to this graph query definition.
- type str
- Azure resource type
- etag str
- This will be used to handle Optimistic Concurrency.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The location of the resource
- name String
- Azure resource name. This is GUID value. The display name should be assigned within properties field.
- result
Kind String - Enum indicating a type of graph query.
- system
Data Property Map - Metadata pertaining to creation and last modification of the resource.
- time
Modified String - Date and time in UTC of the last modification that was made to this graph query definition.
- type String
- Azure resource type
- etag String
- This will be used to handle Optimistic Concurrency.
Supporting Types
SystemDataResponse, SystemDataResponseArgs
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The timestamp of resource last modification (UTC)
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - The type of identity that last modified the resource.
- created_
at str - The timestamp of resource creation (UTC).
- created_
by str - The identity that created the resource.
- created_
by_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The timestamp of resource last modification (UTC)
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:resourcegraph:GraphQuery MyDockerVMs /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0