We recommend new projects start with resources from the AWS provider.
published on Wednesday, Nov 18, 2026 by Pulumi
We recommend new projects start with resources from the AWS provider.
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.
Create MetricDataQueryDefinition Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MetricDataQueryDefinition(name: string, args: MetricDataQueryDefinitionArgs, opts?: CustomResourceOptions);@overload
def MetricDataQueryDefinition(resource_name: str,
args: MetricDataQueryDefinitionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MetricDataQueryDefinition(resource_name: str,
opts: Optional[ResourceOptions] = None,
expression: Optional[str] = None,
path: Optional[str] = None,
type: Optional[MetricDataQueryDefinitionType] = None,
tags: Optional[Sequence[_root_inputs.TagArgs]] = None)func NewMetricDataQueryDefinition(ctx *Context, name string, args MetricDataQueryDefinitionArgs, opts ...ResourceOption) (*MetricDataQueryDefinition, error)public MetricDataQueryDefinition(string name, MetricDataQueryDefinitionArgs args, CustomResourceOptions? opts = null)
public MetricDataQueryDefinition(String name, MetricDataQueryDefinitionArgs args)
public MetricDataQueryDefinition(String name, MetricDataQueryDefinitionArgs args, CustomResourceOptions options)
type: aws-native:cloudwatch:MetricDataQueryDefinition
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "aws-native_cloudwatch_metric_data_query_definition" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args MetricDataQueryDefinitionArgs
- 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 MetricDataQueryDefinitionArgs
- 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 MetricDataQueryDefinitionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MetricDataQueryDefinitionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MetricDataQueryDefinitionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
MetricDataQueryDefinition 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 MetricDataQueryDefinition resource accepts the following input properties:
- Expression string
- The metric query. It is stored as-is and is not validated.
- 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.
- Type
Pulumi.
Aws Native. Cloud Watch. Metric Data Query Definition Type - The query language of Expression.
-
List<Pulumi.
Aws Native. Inputs. Tag> - An array of key-value pairs to apply to the metric data query definition.
- Expression string
- The metric query. It is stored as-is and is not validated.
- 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.
- Type
Metric
Data Query Definition Type - The query language of Expression.
-
Tag
Args - An array of key-value pairs to apply to the metric data query definition.
- expression string
- The metric query. It is stored as-is and is not validated.
- 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.
- type "PROMQL" | "SQL" | "METRIC_MATH"
- The query language of Expression.
- list(object)
- An array of key-value pairs to apply to the metric data query definition.
- expression String
- The metric query. It is stored as-is and is not validated.
- 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.
- type
Metric
Data Query Definition Type - The query language of Expression.
- List<Tag>
- An array of key-value pairs to apply to the metric data query definition.
- expression string
- The metric query. It is stored as-is and is not validated.
- 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.
- type
Metric
Data Query Definition Type - The query language of Expression.
- Tag[]
- An array of key-value pairs to apply to the metric data query definition.
- expression str
- The metric query. It is stored as-is and is not validated.
- 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.
- type
Metric
Data Query Definition Type - The query language of Expression.
-
Sequence[Tag
Args] - An array of key-value pairs to apply to the metric data query definition.
- expression String
- The metric query. It is stored as-is and is not validated.
- 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.
- type "PROMQL" | "SQL" | "METRIC_MATH"
- The query language of Expression.
- List<Property Map>
- An array of key-value pairs to apply to the metric data query definition.
Outputs
All input properties are implicitly available as output properties. Additionally, the MetricDataQueryDefinition resource produces the following output properties:
- Arn string
- The Amazon Resource Name (ARN) of the metric data query definition.
- Aws
Id string - The ID of the metric data query definition, generated by the service.
- Created
At string - The timestamp when the metric data query definition was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- 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.
- Aws
Id string - The ID of the metric data query definition, generated by the service.
- Created
At string - The timestamp when the metric data query definition was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- 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.
- aws_
id string - The ID of the metric data query definition, generated by the service.
- created_
at string - The timestamp when the metric data query definition was created.
- id string
- The provider-assigned unique ID for this managed resource.
- 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.
- aws
Id String - The ID of the metric data query definition, generated by the service.
- created
At String - The timestamp when the metric data query definition was created.
- id String
- The provider-assigned unique ID for this managed resource.
- 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.
- aws
Id string - The ID of the metric data query definition, generated by the service.
- created
At string - The timestamp when the metric data query definition was created.
- id string
- The provider-assigned unique ID for this managed resource.
- updated
At 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.
- aws_
id str - The ID of the metric data query definition, generated by the service.
- created_
at str - The timestamp when the metric data query definition was created.
- id str
- The provider-assigned unique ID for this managed resource.
- 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.
- aws
Id String - The ID of the metric data query definition, generated by the service.
- created
At String - The timestamp when the metric data query definition was created.
- id String
- The provider-assigned unique ID for this managed resource.
- updated
At String - The timestamp when the metric data query definition was last updated.
Look up Existing MetricDataQueryDefinition Resource
Get an existing MetricDataQueryDefinition 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>, opts?: CustomResourceOptions): MetricDataQueryDefinition@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None) -> MetricDataQueryDefinitionfunc GetMetricDataQueryDefinition(ctx *Context, name string, id IDInput, state *MetricDataQueryDefinitionState, opts ...ResourceOption) (*MetricDataQueryDefinition, error)public static MetricDataQueryDefinition Get(string name, Input<string> id, CustomResourceOptions? opts = null)public static MetricDataQueryDefinition get(String name, Output<String> id, CustomResourceOptions options)resources: existingMetricDataQueryDefinition: type: aws-native:cloudwatch:MetricDataQueryDefinition get: id: ${id}import {
to = aws-native_cloudwatch_metric_data_query_definition.example
id = "${id}"
}
- name string
- The unique name of the resulting resource.
- id Input<ID>
- The unique provider ID of the resource to look up.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resulting resource.
- id str
- The unique provider ID of the resource to look up.
- 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 resulting resource.
- id IDInput
- The unique provider ID of the resource to look up.
- state MetricDataQueryDefinitionState
- Pass nil. This resource has no state arguments.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resulting resource.
- id Input<string>
- The unique provider ID of the resource to look up.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resulting resource.
- id Output<String>
- The unique provider ID of the resource to look up.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Supporting Types
MetricDataQueryDefinitionType
The query language of Expression.
| Name | Value |
|---|---|
| Promql | PROMQL |
| Sql | SQL |
| Metric | METRIC_MATH |
| Name | Value |
|---|---|
| Metric | PROMQL |
| Metric | SQL |
| Metric | METRIC_MATH |
| Value |
|---|
PROMQL |
SQL |
METRIC_MATH |
| Name | Value |
|---|---|
| Promql | PROMQL |
| Sql | SQL |
| Metric | METRIC_MATH |
| Name | Value |
|---|---|
| Promql | PROMQL |
| Sql | SQL |
| Metric | METRIC_MATH |
| Name | Value |
|---|---|
| PROMQL | PROMQL |
| SQL | SQL |
| METRIC_MATH | METRIC_MATH |
| Value |
|---|
PROMQL |
SQL |
METRIC_MATH |
Tag, TagArgs
A set of tags to apply to the resource.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.
published on Wednesday, Nov 18, 2026 by Pulumi