1. Packages
  2. Azure Native v1
  3. API Docs
  4. resourcegraph
  5. GraphQuery
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

azure-native.resourcegraph.GraphQuery

Explore with Pulumi AI

azure-native-v1 logo
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

    Graph Query entity definition. API Version: 2018-09-01-preview.

    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"
    	"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,
                   location: 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",
        Location = "string",
        ResourceName = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := resourcegraph.NewGraphQuery(ctx, "graphQueryResource", &resourcegraph.GraphQueryArgs{
    	Query:             "string",
    	ResourceGroupName: "string",
    	Description:       "string",
    	Location:          "string",
    	ResourceName:      "string",
    	Tags: map[string]interface{}{
    		"string": "string",
    	},
    })
    
    var graphQueryResource = new GraphQuery("graphQueryResource", GraphQueryArgs.builder()
        .query("string")
        .resourceGroupName("string")
        .description("string")
        .location("string")
        .resourceName("string")
        .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
        .build());
    
    graph_query_resource = azure_native.resourcegraph.GraphQuery("graphQueryResource",
        query=string,
        resource_group_name=string,
        description=string,
        location=string,
        resource_name_=string,
        tags={
            string: string,
        })
    
    const graphQueryResource = new azure_native.resourcegraph.GraphQuery("graphQueryResource", {
        query: "string",
        resourceGroupName: "string",
        description: "string",
        location: "string",
        resourceName: "string",
        tags: {
            string: "string",
        },
    });
    
    type: azure-native:resourcegraph:GraphQuery
    properties:
        description: string
        location: 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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The GraphQuery resource accepts the following input properties:

    Query string
    KQL query that will be graph.
    ResourceGroupName string
    The name of the resource group.
    Description string
    The description of a graph query.
    Location string
    The location of the resource
    ResourceName string
    The name of the Graph Query resource.
    Tags Dictionary<string, string>
    Resource tags
    Query string
    KQL query that will be graph.
    ResourceGroupName string
    The name of the resource group.
    Description string
    The description of a graph query.
    Location string
    The location of the resource
    ResourceName string
    The name of the Graph Query resource.
    Tags map[string]string
    Resource tags
    query String
    KQL query that will be graph.
    resourceGroupName String
    The name of the resource group.
    description String
    The description of a graph query.
    location String
    The location of the resource
    resourceName String
    The name of the Graph Query resource.
    tags Map<String,String>
    Resource tags
    query string
    KQL query that will be graph.
    resourceGroupName string
    The name of the resource group.
    description string
    The description of a graph query.
    location string
    The location of the resource
    resourceName string
    The name of the Graph Query resource.
    tags {[key: string]: string}
    Resource tags
    query str
    KQL query that will be graph.
    resource_group_name str
    The name of the resource group.
    description str
    The description of a graph query.
    location str
    The location of the resource
    resource_name str
    The name of the Graph Query resource.
    tags Mapping[str, str]
    Resource tags
    query String
    KQL query that will be graph.
    resourceGroupName String
    The name of the resource group.
    description String
    The description of a graph query.
    location String
    The location of the resource
    resourceName String
    The name of the Graph Query resource.
    tags 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.
    Name string
    Azure resource name. This is GUID value. The display name should be assigned within properties field.
    ResultKind string
    Enum indicating a type of graph query.
    TimeModified 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. If not present, it will always overwrite the existing resource without checking conflict.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Azure resource name. This is GUID value. The display name should be assigned within properties field.
    ResultKind string
    Enum indicating a type of graph query.
    TimeModified 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. If not present, it will always overwrite the existing resource without checking conflict.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Azure resource name. This is GUID value. The display name should be assigned within properties field.
    resultKind String
    Enum indicating a type of graph query.
    timeModified 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. If not present, it will always overwrite the existing resource without checking conflict.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Azure resource name. This is GUID value. The display name should be assigned within properties field.
    resultKind string
    Enum indicating a type of graph query.
    timeModified 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. If not present, it will always overwrite the existing resource without checking conflict.
    id str
    The provider-assigned unique ID for this managed 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.
    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. If not present, it will always overwrite the existing resource without checking conflict.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Azure resource name. This is GUID value. The display name should be assigned within properties field.
    resultKind String
    Enum indicating a type of graph query.
    timeModified 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. If not present, it will always overwrite the existing resource without checking conflict.

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:resourcegraph:GraphQuery MyDockerVMs  /subscriptions/024e2271-06fa-46b6-9079-f1ed3c7b070e/resources/my-resource-group/providers/Microsoft.ResourceGraph/queries/MyDockerVMs 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    azure-native-v1 pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native-v1 logo
    These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
    Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi