import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a CloudWatch resource metrics configuration. Creating a configuration makes CloudWatch collect detailed metrics for the targeted AWS resource. * * Each AWS resource can have at most one resource metrics configuration. Detailed metrics incur charges, so limit collection with `metricSelection` when you only need a subset of metrics. See [Amazon CloudWatch pricing](https://aws.amazon.com/cloudwatch/pricing/) for details. * * > **Note:** Not every AWS resource type is eligible for detailed metrics. At the time of writing, only Amazon ElastiCache replication groups are supported. Targeting any other resource type, including ElastiCache serverless caches and cache clusters, returns a `ValidationError` with the message `Unsupported resource type`. * * ## Example Usage * * ### Basic Usage * * Omit `metricSelection` to collect every detailed metric that is available for the resource. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.elasticache.ReplicationGroup("example", { * replicationGroupId: "example", * description: "example", * engine: "valkey", * nodeType: "cache.t3.small", * numCacheClusters: 1, * }); * const exampleResourceMetricsConfiguration = new aws.cloudwatch.ResourceMetricsConfiguration("example", {resourceArn: example.arn}); * ``` * * ### Collect Selected Metrics * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudwatch.ResourceMetricsConfiguration("example", { * metricSelection: { * includeMetrics: [ * "valkey.memory.used", * "valkey.commands.processed", * ], * }, * resourceArn: exampleAwsElasticacheReplicationGroup.arn, * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * * `resourceArn` - ARN of the AWS resource that the resource metrics configuration applies to. * * Using `pulumi import`, import a CloudWatch resource metrics configuration using the `resourceArn`. For example: * * ```sh * $ pulumi import aws:cloudwatch/resourceMetricsConfiguration:ResourceMetricsConfiguration example arn:aws:elasticache:us-west-2:012345678901:replicationgroup:example * ``` */ export declare class ResourceMetricsConfiguration extends pulumi.CustomResource { /** * Get an existing ResourceMetricsConfiguration resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: ResourceMetricsConfigurationState, opts?: pulumi.CustomResourceOptions): ResourceMetricsConfiguration; /** * Check whether an existing ResourceMetricsConfiguration resource with the given ID exists. * * @param id The _unique_ provider ID of the resource to check. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static exists(id: pulumi.Input, state?: ResourceMetricsConfigurationState, opts?: pulumi.CustomResourceOptions): pulumi.Output; /** * Returns true if the given object is an instance of ResourceMetricsConfiguration. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ResourceMetricsConfiguration; /** * Configuration block that limits which metrics CloudWatch collects. At most one block is supported. When omitted, CloudWatch collects all available detailed metrics for the resource. See `metricSelection` below. */ readonly metricSelection: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * ARN of the AWS resource to enable detailed monitoring for. Changing this forces a new resource to be created. * * The following arguments are optional: */ readonly resourceArn: pulumi.Output; /** * Create a ResourceMetricsConfiguration resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ResourceMetricsConfigurationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ResourceMetricsConfiguration resources. */ export interface ResourceMetricsConfigurationState { /** * Configuration block that limits which metrics CloudWatch collects. At most one block is supported. When omitted, CloudWatch collects all available detailed metrics for the resource. See `metricSelection` below. */ metricSelection?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of the AWS resource to enable detailed monitoring for. Changing this forces a new resource to be created. * * The following arguments are optional: */ resourceArn?: pulumi.Input; } /** * The set of arguments for constructing a ResourceMetricsConfiguration resource. */ export interface ResourceMetricsConfigurationArgs { /** * Configuration block that limits which metrics CloudWatch collects. At most one block is supported. When omitted, CloudWatch collects all available detailed metrics for the resource. See `metricSelection` below. */ metricSelection?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of the AWS resource to enable detailed monitoring for. Changing this forces a new resource to be created. * * The following arguments are optional: */ resourceArn: pulumi.Input; } //# sourceMappingURL=resourceMetricsConfiguration.d.ts.map