Provides a resource to create a APM prometheus rule
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.ApmPrometheusRule("example", {
instanceId: "apm-lhqHyRBuA",
name: "tf-example",
serviceName: "java-market-service",
metricMatchType: 0,
metricNameRule: "task.duration",
status: 1,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.ApmPrometheusRule("example",
instance_id="apm-lhqHyRBuA",
name="tf-example",
service_name="java-market-service",
metric_match_type=0,
metric_name_rule="task.duration",
status=1)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewApmPrometheusRule(ctx, "example", &tencentcloud.ApmPrometheusRuleArgs{
InstanceId: pulumi.String("apm-lhqHyRBuA"),
Name: pulumi.String("tf-example"),
ServiceName: pulumi.String("java-market-service"),
MetricMatchType: pulumi.Float64(0),
MetricNameRule: pulumi.String("task.duration"),
Status: pulumi.Float64(1),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.ApmPrometheusRule("example", new()
{
InstanceId = "apm-lhqHyRBuA",
Name = "tf-example",
ServiceName = "java-market-service",
MetricMatchType = 0,
MetricNameRule = "task.duration",
Status = 1,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ApmPrometheusRule;
import com.pulumi.tencentcloud.ApmPrometheusRuleArgs;
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 example = new ApmPrometheusRule("example", ApmPrometheusRuleArgs.builder()
.instanceId("apm-lhqHyRBuA")
.name("tf-example")
.serviceName("java-market-service")
.metricMatchType(0.0)
.metricNameRule("task.duration")
.status(1.0)
.build());
}
}
resources:
example:
type: tencentcloud:ApmPrometheusRule
properties:
instanceId: apm-lhqHyRBuA
name: tf-example
serviceName: java-market-service
metricMatchType: 0
metricNameRule: task.duration
status: 1
Create ApmPrometheusRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApmPrometheusRule(name: string, args: ApmPrometheusRuleArgs, opts?: CustomResourceOptions);@overload
def ApmPrometheusRule(resource_name: str,
args: ApmPrometheusRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApmPrometheusRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
metric_match_type: Optional[float] = None,
metric_name_rule: Optional[str] = None,
service_name: Optional[str] = None,
apm_prometheus_rule_id: Optional[str] = None,
name: Optional[str] = None,
status: Optional[float] = None)func NewApmPrometheusRule(ctx *Context, name string, args ApmPrometheusRuleArgs, opts ...ResourceOption) (*ApmPrometheusRule, error)public ApmPrometheusRule(string name, ApmPrometheusRuleArgs args, CustomResourceOptions? opts = null)
public ApmPrometheusRule(String name, ApmPrometheusRuleArgs args)
public ApmPrometheusRule(String name, ApmPrometheusRuleArgs args, CustomResourceOptions options)
type: tencentcloud:ApmPrometheusRule
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 ApmPrometheusRuleArgs
- 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 ApmPrometheusRuleArgs
- 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 ApmPrometheusRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApmPrometheusRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApmPrometheusRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ApmPrometheusRule 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 ApmPrometheusRule resource accepts the following input properties:
- Instance
Id string - Business system ID.
- Metric
Match doubleType - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- Metric
Name stringRule - Specifies the rule for customer-defined metric names with cache hit.
- Service
Name string - Applications where the rule takes effect. input an empty string for all applications.
- Apm
Prometheus stringRule Id - ID of the resource.
- Name string
- Metric match rule name.
- Status double
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- Instance
Id string - Business system ID.
- Metric
Match float64Type - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- Metric
Name stringRule - Specifies the rule for customer-defined metric names with cache hit.
- Service
Name string - Applications where the rule takes effect. input an empty string for all applications.
- Apm
Prometheus stringRule Id - ID of the resource.
- Name string
- Metric match rule name.
- Status float64
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- instance
Id String - Business system ID.
- metric
Match DoubleType - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- metric
Name StringRule - Specifies the rule for customer-defined metric names with cache hit.
- service
Name String - Applications where the rule takes effect. input an empty string for all applications.
- apm
Prometheus StringRule Id - ID of the resource.
- name String
- Metric match rule name.
- status Double
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- instance
Id string - Business system ID.
- metric
Match numberType - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- metric
Name stringRule - Specifies the rule for customer-defined metric names with cache hit.
- service
Name string - Applications where the rule takes effect. input an empty string for all applications.
- apm
Prometheus stringRule Id - ID of the resource.
- name string
- Metric match rule name.
- status number
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- instance_
id str - Business system ID.
- metric_
match_ floattype - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- metric_
name_ strrule - Specifies the rule for customer-defined metric names with cache hit.
- service_
name str - Applications where the rule takes effect. input an empty string for all applications.
- apm_
prometheus_ strrule_ id - ID of the resource.
- name str
- Metric match rule name.
- status float
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- instance
Id String - Business system ID.
- metric
Match NumberType - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- metric
Name StringRule - Specifies the rule for customer-defined metric names with cache hit.
- service
Name String - Applications where the rule takes effect. input an empty string for all applications.
- apm
Prometheus StringRule Id - ID of the resource.
- name String
- Metric match rule name.
- status Number
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApmPrometheusRule resource produces the following output properties:
Look up Existing ApmPrometheusRule Resource
Get an existing ApmPrometheusRule 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>, state?: ApmPrometheusRuleState, opts?: CustomResourceOptions): ApmPrometheusRule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
apm_prometheus_rule_id: Optional[str] = None,
instance_id: Optional[str] = None,
metric_match_type: Optional[float] = None,
metric_name_rule: Optional[str] = None,
name: Optional[str] = None,
rule_id: Optional[float] = None,
service_name: Optional[str] = None,
status: Optional[float] = None) -> ApmPrometheusRulefunc GetApmPrometheusRule(ctx *Context, name string, id IDInput, state *ApmPrometheusRuleState, opts ...ResourceOption) (*ApmPrometheusRule, error)public static ApmPrometheusRule Get(string name, Input<string> id, ApmPrometheusRuleState? state, CustomResourceOptions? opts = null)public static ApmPrometheusRule get(String name, Output<String> id, ApmPrometheusRuleState state, CustomResourceOptions options)resources: _: type: tencentcloud:ApmPrometheusRule get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Apm
Prometheus stringRule Id - ID of the resource.
- Instance
Id string - Business system ID.
- Metric
Match doubleType - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- Metric
Name stringRule - Specifies the rule for customer-defined metric names with cache hit.
- Name string
- Metric match rule name.
- Rule
Id double - ID of the indicator matching rule.
- Service
Name string - Applications where the rule takes effect. input an empty string for all applications.
- Status double
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- Apm
Prometheus stringRule Id - ID of the resource.
- Instance
Id string - Business system ID.
- Metric
Match float64Type - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- Metric
Name stringRule - Specifies the rule for customer-defined metric names with cache hit.
- Name string
- Metric match rule name.
- Rule
Id float64 - ID of the indicator matching rule.
- Service
Name string - Applications where the rule takes effect. input an empty string for all applications.
- Status float64
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- apm
Prometheus StringRule Id - ID of the resource.
- instance
Id String - Business system ID.
- metric
Match DoubleType - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- metric
Name StringRule - Specifies the rule for customer-defined metric names with cache hit.
- name String
- Metric match rule name.
- rule
Id Double - ID of the indicator matching rule.
- service
Name String - Applications where the rule takes effect. input an empty string for all applications.
- status Double
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- apm
Prometheus stringRule Id - ID of the resource.
- instance
Id string - Business system ID.
- metric
Match numberType - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- metric
Name stringRule - Specifies the rule for customer-defined metric names with cache hit.
- name string
- Metric match rule name.
- rule
Id number - ID of the indicator matching rule.
- service
Name string - Applications where the rule takes effect. input an empty string for all applications.
- status number
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- apm_
prometheus_ strrule_ id - ID of the resource.
- instance_
id str - Business system ID.
- metric_
match_ floattype - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- metric_
name_ strrule - Specifies the rule for customer-defined metric names with cache hit.
- name str
- Metric match rule name.
- rule_
id float - ID of the indicator matching rule.
- service_
name str - Applications where the rule takes effect. input an empty string for all applications.
- status float
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
- apm
Prometheus StringRule Id - ID of the resource.
- instance
Id String - Business system ID.
- metric
Match NumberType - Match type: 0 - precision match, 1 - prefix match, 2 - suffix match.
- metric
Name StringRule - Specifies the rule for customer-defined metric names with cache hit.
- name String
- Metric match rule name.
- rule
Id Number - ID of the indicator matching rule.
- service
Name String - Applications where the rule takes effect. input an empty string for all applications.
- status Number
- Rule status. 1 - enabled, 2 - disabled. Default value: 1.
Import
APM prometheus rule can be imported using the instanceId#ruleId, e.g.
$ pulumi import tencentcloud:index/apmPrometheusRule:ApmPrometheusRule example apm-lhqHyRBuA#140
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
