1. Packages
  2. Azure Native
  3. API Docs
  4. resourcegraph
  5. GraphQuery
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.73.0 published on Wednesday, Nov 20, 2024 by Pulumi

azure-native.resourcegraph.GraphQuery

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.73.0 published on Wednesday, Nov 20, 2024 by Pulumi

    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, 2024-04-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:              pulumi.StringMap{},
    		})
    		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

    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.
    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.
    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.
    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.
    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.
    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.
    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.
    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.
    ResultKind string
    Enum indicating a type of graph query.
    SystemData Pulumi.AzureNative.ResourceGraph.Outputs.SystemDataResponse
    Metadata pertaining to creation and last modification of the resource.
    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.
    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.
    ResultKind string
    Enum indicating a type of graph query.
    SystemData SystemDataResponse
    Metadata pertaining to creation and last modification of the resource.
    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.
    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.
    resultKind String
    Enum indicating a type of graph query.
    systemData SystemDataResponse
    Metadata pertaining to creation and last modification of the resource.
    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.
    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.
    resultKind string
    Enum indicating a type of graph query.
    systemData SystemDataResponse
    Metadata pertaining to creation and last modification of the resource.
    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.
    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 SystemDataResponse
    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.
    resultKind String
    Enum indicating a type of graph query.
    systemData Property Map
    Metadata pertaining to creation and last modification of the resource.
    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.

    Supporting Types

    SystemDataResponse, SystemDataResponseArgs

    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    The type of identity that last modified the resource.
    createdAt string
    The timestamp of resource creation (UTC).
    createdBy string
    The identity that created the resource.
    createdByType string
    The type of identity that created the resource.
    lastModifiedAt string
    The timestamp of resource last modification (UTC)
    lastModifiedBy string
    The identity that last modified the resource.
    lastModifiedByType string
    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_type str
    The type of identity that created the resource.
    last_modified_at str
    The timestamp of resource last modification (UTC)
    last_modified_by str
    The identity that last modified the resource.
    last_modified_by_type str
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    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
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.73.0 published on Wednesday, Nov 20, 2024 by Pulumi