1. Registry
  2. Packages
  3. AWS Cloud Control
  4. API Docs
  5. cloudwatch
  6. getMetricDataQueryDefinition

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.86.0
published on Wednesday, Nov 18, 2026 by Pulumi
aws-native logo aws-native logo AWS Cloud Control

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.86.0
published on Wednesday, Nov 18, 2026 by Pulumi

    Resource Type definition for AWS::CloudWatch::MetricDataQueryDefinition. A saved CloudWatch metric data query (PromQL, SQL, or Metric Math) with a path that is unique in the account and Region.

    Using getMetricDataQueryDefinition

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getMetricDataQueryDefinition(args: GetMetricDataQueryDefinitionArgs, opts?: InvokeOptions): Promise<GetMetricDataQueryDefinitionResult>
    function getMetricDataQueryDefinitionOutput(args: GetMetricDataQueryDefinitionOutputArgs, opts?: InvokeOutputOptions): Output<GetMetricDataQueryDefinitionResult>
    def get_metric_data_query_definition(arn: Optional[str] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetMetricDataQueryDefinitionResult
    def get_metric_data_query_definition_output(arn: pulumi.Input[Optional[str]] = None,
                                         opts: Optional[InvokeOutputOptions] = None) -> Output[GetMetricDataQueryDefinitionResult]
    func LookupMetricDataQueryDefinition(ctx *Context, args *LookupMetricDataQueryDefinitionArgs, opts ...InvokeOption) (*LookupMetricDataQueryDefinitionResult, error)
    func LookupMetricDataQueryDefinitionOutput(ctx *Context, args *LookupMetricDataQueryDefinitionOutputArgs, opts ...InvokeOption) LookupMetricDataQueryDefinitionResultOutput

    > Note: This function is named LookupMetricDataQueryDefinition in the Go SDK.

    public static class GetMetricDataQueryDefinition 
    {
        public static Task<GetMetricDataQueryDefinitionResult> InvokeAsync(GetMetricDataQueryDefinitionArgs args, InvokeOptions? opts = null)
        public static Output<GetMetricDataQueryDefinitionResult> Invoke(GetMetricDataQueryDefinitionInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetMetricDataQueryDefinitionResult> Invoke(GetMetricDataQueryDefinitionInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetMetricDataQueryDefinitionResult> getMetricDataQueryDefinition(GetMetricDataQueryDefinitionArgs args, InvokeOptions options)
    public static Output<GetMetricDataQueryDefinitionResult> getMetricDataQueryDefinition(GetMetricDataQueryDefinitionArgs args, InvokeOptions options)
    public static Output<GetMetricDataQueryDefinitionResult> getMetricDataQueryDefinition(GetMetricDataQueryDefinitionArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: aws-native:cloudwatch:getMetricDataQueryDefinition
      arguments:
        # arguments dictionary
    data "aws-native_cloudwatch_get_metric_data_query_definition" "name" {
        # arguments
    }

    The following arguments are supported:

    Arn string
    The Amazon Resource Name (ARN) of the metric data query definition.
    Arn string
    The Amazon Resource Name (ARN) of the metric data query definition.
    arn string
    The Amazon Resource Name (ARN) of the metric data query definition.
    arn String
    The Amazon Resource Name (ARN) of the metric data query definition.
    arn string
    The Amazon Resource Name (ARN) of the metric data query definition.
    arn str
    The Amazon Resource Name (ARN) of the metric data query definition.
    arn String
    The Amazon Resource Name (ARN) of the metric data query definition.

    getMetricDataQueryDefinition Result

    The following output properties are available:

    Arn string
    The Amazon Resource Name (ARN) of the metric data query definition.
    CreatedAt string
    The timestamp when the metric data query definition was created.
    Expression string
    The metric query. It is stored as-is and is not validated.
    Id string
    The ID of the metric data query definition, generated by the service.
    Path string
    The name of the metric data query definition. Use '/' to organize definitions into folders. Must be unique in the account and Region. Changing it renames the definition in place.
    Tags List<Pulumi.AwsNative.Outputs.Tag>
    An array of key-value pairs to apply to the metric data query definition.
    Type Pulumi.AwsNative.CloudWatch.MetricDataQueryDefinitionType
    The query language of Expression.
    UpdatedAt string
    The timestamp when the metric data query definition was last updated.
    Arn string
    The Amazon Resource Name (ARN) of the metric data query definition.
    CreatedAt string
    The timestamp when the metric data query definition was created.
    Expression string
    The metric query. It is stored as-is and is not validated.
    Id string
    The ID of the metric data query definition, generated by the service.
    Path string
    The name of the metric data query definition. Use '/' to organize definitions into folders. Must be unique in the account and Region. Changing it renames the definition in place.
    Tags Tag
    An array of key-value pairs to apply to the metric data query definition.
    Type MetricDataQueryDefinitionType
    The query language of Expression.
    UpdatedAt string
    The timestamp when the metric data query definition was last updated.
    arn string
    The Amazon Resource Name (ARN) of the metric data query definition.
    created_at string
    The timestamp when the metric data query definition was created.
    expression string
    The metric query. It is stored as-is and is not validated.
    id string
    The ID of the metric data query definition, generated by the service.
    path string
    The name of the metric data query definition. Use '/' to organize definitions into folders. Must be unique in the account and Region. Changing it renames the definition in place.
    tags list(object)
    An array of key-value pairs to apply to the metric data query definition.
    type "PROMQL" | "SQL" | "METRIC_MATH"
    The query language of Expression.
    updated_at string
    The timestamp when the metric data query definition was last updated.
    arn String
    The Amazon Resource Name (ARN) of the metric data query definition.
    createdAt String
    The timestamp when the metric data query definition was created.
    expression String
    The metric query. It is stored as-is and is not validated.
    id String
    The ID of the metric data query definition, generated by the service.
    path String
    The name of the metric data query definition. Use '/' to organize definitions into folders. Must be unique in the account and Region. Changing it renames the definition in place.
    tags List<Tag>
    An array of key-value pairs to apply to the metric data query definition.
    type MetricDataQueryDefinitionType
    The query language of Expression.
    updatedAt String
    The timestamp when the metric data query definition was last updated.
    arn string
    The Amazon Resource Name (ARN) of the metric data query definition.
    createdAt string
    The timestamp when the metric data query definition was created.
    expression string
    The metric query. It is stored as-is and is not validated.
    id string
    The ID of the metric data query definition, generated by the service.
    path string
    The name of the metric data query definition. Use '/' to organize definitions into folders. Must be unique in the account and Region. Changing it renames the definition in place.
    tags Tag[]
    An array of key-value pairs to apply to the metric data query definition.
    type MetricDataQueryDefinitionType
    The query language of Expression.
    updatedAt string
    The timestamp when the metric data query definition was last updated.
    arn str
    The Amazon Resource Name (ARN) of the metric data query definition.
    created_at str
    The timestamp when the metric data query definition was created.
    expression str
    The metric query. It is stored as-is and is not validated.
    id str
    The ID of the metric data query definition, generated by the service.
    path str
    The name of the metric data query definition. Use '/' to organize definitions into folders. Must be unique in the account and Region. Changing it renames the definition in place.
    tags Sequence[root_Tag]
    An array of key-value pairs to apply to the metric data query definition.
    type MetricDataQueryDefinitionType
    The query language of Expression.
    updated_at str
    The timestamp when the metric data query definition was last updated.
    arn String
    The Amazon Resource Name (ARN) of the metric data query definition.
    createdAt String
    The timestamp when the metric data query definition was created.
    expression String
    The metric query. It is stored as-is and is not validated.
    id String
    The ID of the metric data query definition, generated by the service.
    path String
    The name of the metric data query definition. Use '/' to organize definitions into folders. Must be unique in the account and Region. Changing it renames the definition in place.
    tags List<Property Map>
    An array of key-value pairs to apply to the metric data query definition.
    type "PROMQL" | "SQL" | "METRIC_MATH"
    The query language of Expression.
    updatedAt String
    The timestamp when the metric data query definition was last updated.

    Supporting Types

    MetricDataQueryDefinitionType

    NameValue
    PromqlPROMQL
    SqlSQL
    MetricMathMETRIC_MATH
    NameValue
    MetricDataQueryDefinitionTypePromqlPROMQL
    MetricDataQueryDefinitionTypeSqlSQL
    MetricDataQueryDefinitionTypeMetricMathMETRIC_MATH
    Value
    PROMQL
    SQL
    METRIC_MATH
    NameValue
    PromqlPROMQL
    SqlSQL
    MetricMathMETRIC_MATH
    NameValue
    PromqlPROMQL
    SqlSQL
    MetricMathMETRIC_MATH
    NameValue
    PROMQLPROMQL
    SQLSQL
    METRIC_MATHMETRIC_MATH
    Value
    PROMQL
    SQL
    METRIC_MATH

    Tag

    Key string
    The key name of the tag
    Value string
    The value of the tag
    Key string
    The key name of the tag
    Value string
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key str
    The key name of the tag
    value str
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo aws-native logo AWS Cloud Control

    We recommend new projects start with resources from the AWS provider.

    Viewing docs for AWS Cloud Control v1.86.0
    published on Wednesday, Nov 18, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial