1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. TcmPrometheusAttachment
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.TcmPrometheusAttachment

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a tcm prometheus_attachment

    NOTE: Instructions for use: 1. Use Tencent Cloud Prometheus to monitor TMP, please enter vpc_id, subnet_id, region or instance_id, it is recommended to use an existing tmp instance; 2. To use the third-party Prometheus service, please enter custom_prom; 3. tencentcloud.TcmPrometheusAttachment does not support modification; 4. If you use Tencent Cloud Prometheus to monitor TMP, enter vpc_id, subnet_id, region to create a new Prometheus monitoring instance, destroy will not destroy the Prometheus monitoring instance NOTE: If you use the config attribute prometheus in tencentcloud_tcm_mesh, do not use tencentcloud.TcmPrometheusAttachment

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const prometheusAttachment = new tencentcloud.TcmPrometheusAttachment("prometheusAttachment", {
        meshId: "mesh-rofjmxxx",
        prometheus: {
            instanceId: "",
            region: "ap-guangzhou",
            subnetId: "subnet-driddxxx",
            vpcId: "vpc-pewdpxxx",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    prometheus_attachment = tencentcloud.TcmPrometheusAttachment("prometheusAttachment",
        mesh_id="mesh-rofjmxxx",
        prometheus={
            "instance_id": "",
            "region": "ap-guangzhou",
            "subnet_id": "subnet-driddxxx",
            "vpc_id": "vpc-pewdpxxx",
        })
    
    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.NewTcmPrometheusAttachment(ctx, "prometheusAttachment", &tencentcloud.TcmPrometheusAttachmentArgs{
    			MeshId: pulumi.String("mesh-rofjmxxx"),
    			Prometheus: &tencentcloud.TcmPrometheusAttachmentPrometheusArgs{
    				InstanceId: pulumi.String(""),
    				Region:     pulumi.String("ap-guangzhou"),
    				SubnetId:   pulumi.String("subnet-driddxxx"),
    				VpcId:      pulumi.String("vpc-pewdpxxx"),
    			},
    		})
    		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 prometheusAttachment = new Tencentcloud.TcmPrometheusAttachment("prometheusAttachment", new()
        {
            MeshId = "mesh-rofjmxxx",
            Prometheus = new Tencentcloud.Inputs.TcmPrometheusAttachmentPrometheusArgs
            {
                InstanceId = "",
                Region = "ap-guangzhou",
                SubnetId = "subnet-driddxxx",
                VpcId = "vpc-pewdpxxx",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TcmPrometheusAttachment;
    import com.pulumi.tencentcloud.TcmPrometheusAttachmentArgs;
    import com.pulumi.tencentcloud.inputs.TcmPrometheusAttachmentPrometheusArgs;
    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 prometheusAttachment = new TcmPrometheusAttachment("prometheusAttachment", TcmPrometheusAttachmentArgs.builder()
                .meshId("mesh-rofjmxxx")
                .prometheus(TcmPrometheusAttachmentPrometheusArgs.builder()
                    .instanceId("")
                    .region("ap-guangzhou")
                    .subnetId("subnet-driddxxx")
                    .vpcId("vpc-pewdpxxx")
                    .build())
                .build());
    
        }
    }
    
    resources:
      prometheusAttachment:
        type: tencentcloud:TcmPrometheusAttachment
        properties:
          meshId: mesh-rofjmxxx
          prometheus:
            instanceId: ""
            region: ap-guangzhou
            subnetId: subnet-driddxxx
            vpcId: vpc-pewdpxxx
    

    Create TcmPrometheusAttachment Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TcmPrometheusAttachment(name: string, args: TcmPrometheusAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def TcmPrometheusAttachment(resource_name: str,
                                args: TcmPrometheusAttachmentArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def TcmPrometheusAttachment(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                mesh_id: Optional[str] = None,
                                prometheus: Optional[TcmPrometheusAttachmentPrometheusArgs] = None,
                                tcm_prometheus_attachment_id: Optional[str] = None)
    func NewTcmPrometheusAttachment(ctx *Context, name string, args TcmPrometheusAttachmentArgs, opts ...ResourceOption) (*TcmPrometheusAttachment, error)
    public TcmPrometheusAttachment(string name, TcmPrometheusAttachmentArgs args, CustomResourceOptions? opts = null)
    public TcmPrometheusAttachment(String name, TcmPrometheusAttachmentArgs args)
    public TcmPrometheusAttachment(String name, TcmPrometheusAttachmentArgs args, CustomResourceOptions options)
    
    type: tencentcloud:TcmPrometheusAttachment
    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 TcmPrometheusAttachmentArgs
    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 TcmPrometheusAttachmentArgs
    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 TcmPrometheusAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TcmPrometheusAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TcmPrometheusAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    TcmPrometheusAttachment 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 TcmPrometheusAttachment resource accepts the following input properties:

    MeshId string
    Mesh ID.
    Prometheus TcmPrometheusAttachmentPrometheus
    Prometheus configuration.
    TcmPrometheusAttachmentId string
    ID of the resource.
    MeshId string
    Mesh ID.
    Prometheus TcmPrometheusAttachmentPrometheusArgs
    Prometheus configuration.
    TcmPrometheusAttachmentId string
    ID of the resource.
    meshId String
    Mesh ID.
    prometheus TcmPrometheusAttachmentPrometheus
    Prometheus configuration.
    tcmPrometheusAttachmentId String
    ID of the resource.
    meshId string
    Mesh ID.
    prometheus TcmPrometheusAttachmentPrometheus
    Prometheus configuration.
    tcmPrometheusAttachmentId string
    ID of the resource.
    mesh_id str
    Mesh ID.
    prometheus TcmPrometheusAttachmentPrometheusArgs
    Prometheus configuration.
    tcm_prometheus_attachment_id str
    ID of the resource.
    meshId String
    Mesh ID.
    prometheus Property Map
    Prometheus configuration.
    tcmPrometheusAttachmentId String
    ID of the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TcmPrometheusAttachment resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing TcmPrometheusAttachment Resource

    Get an existing TcmPrometheusAttachment 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?: TcmPrometheusAttachmentState, opts?: CustomResourceOptions): TcmPrometheusAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            mesh_id: Optional[str] = None,
            prometheus: Optional[TcmPrometheusAttachmentPrometheusArgs] = None,
            tcm_prometheus_attachment_id: Optional[str] = None) -> TcmPrometheusAttachment
    func GetTcmPrometheusAttachment(ctx *Context, name string, id IDInput, state *TcmPrometheusAttachmentState, opts ...ResourceOption) (*TcmPrometheusAttachment, error)
    public static TcmPrometheusAttachment Get(string name, Input<string> id, TcmPrometheusAttachmentState? state, CustomResourceOptions? opts = null)
    public static TcmPrometheusAttachment get(String name, Output<String> id, TcmPrometheusAttachmentState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TcmPrometheusAttachment    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.
    The following state arguments are supported:
    MeshId string
    Mesh ID.
    Prometheus TcmPrometheusAttachmentPrometheus
    Prometheus configuration.
    TcmPrometheusAttachmentId string
    ID of the resource.
    MeshId string
    Mesh ID.
    Prometheus TcmPrometheusAttachmentPrometheusArgs
    Prometheus configuration.
    TcmPrometheusAttachmentId string
    ID of the resource.
    meshId String
    Mesh ID.
    prometheus TcmPrometheusAttachmentPrometheus
    Prometheus configuration.
    tcmPrometheusAttachmentId String
    ID of the resource.
    meshId string
    Mesh ID.
    prometheus TcmPrometheusAttachmentPrometheus
    Prometheus configuration.
    tcmPrometheusAttachmentId string
    ID of the resource.
    mesh_id str
    Mesh ID.
    prometheus TcmPrometheusAttachmentPrometheusArgs
    Prometheus configuration.
    tcm_prometheus_attachment_id str
    ID of the resource.
    meshId String
    Mesh ID.
    prometheus Property Map
    Prometheus configuration.
    tcmPrometheusAttachmentId String
    ID of the resource.

    Supporting Types

    TcmPrometheusAttachmentPrometheus, TcmPrometheusAttachmentPrometheusArgs

    CustomProm TcmPrometheusAttachmentPrometheusCustomProm
    Third party prometheus.
    InstanceId string
    Existed TMP id, auto create TMP if empty.
    Region string
    Region for TMP.
    SubnetId string
    Subnet id for TMP.
    VpcId string
    Vpc id for TMP.
    CustomProm TcmPrometheusAttachmentPrometheusCustomProm
    Third party prometheus.
    InstanceId string
    Existed TMP id, auto create TMP if empty.
    Region string
    Region for TMP.
    SubnetId string
    Subnet id for TMP.
    VpcId string
    Vpc id for TMP.
    customProm TcmPrometheusAttachmentPrometheusCustomProm
    Third party prometheus.
    instanceId String
    Existed TMP id, auto create TMP if empty.
    region String
    Region for TMP.
    subnetId String
    Subnet id for TMP.
    vpcId String
    Vpc id for TMP.
    customProm TcmPrometheusAttachmentPrometheusCustomProm
    Third party prometheus.
    instanceId string
    Existed TMP id, auto create TMP if empty.
    region string
    Region for TMP.
    subnetId string
    Subnet id for TMP.
    vpcId string
    Vpc id for TMP.
    custom_prom TcmPrometheusAttachmentPrometheusCustomProm
    Third party prometheus.
    instance_id str
    Existed TMP id, auto create TMP if empty.
    region str
    Region for TMP.
    subnet_id str
    Subnet id for TMP.
    vpc_id str
    Vpc id for TMP.
    customProm Property Map
    Third party prometheus.
    instanceId String
    Existed TMP id, auto create TMP if empty.
    region String
    Region for TMP.
    subnetId String
    Subnet id for TMP.
    vpcId String
    Vpc id for TMP.

    TcmPrometheusAttachmentPrometheusCustomProm, TcmPrometheusAttachmentPrometheusCustomPromArgs

    AuthType string
    Authentication type of the prometheus.
    Url string
    Url of the prometheus.
    IsPublicAddr bool
    Whether it is public address, default false.
    Password string
    Password of the prometheus, used in basic authentication type.
    Username string
    Username of the prometheus, used in basic authentication type.
    VpcId string
    Vpc id.
    AuthType string
    Authentication type of the prometheus.
    Url string
    Url of the prometheus.
    IsPublicAddr bool
    Whether it is public address, default false.
    Password string
    Password of the prometheus, used in basic authentication type.
    Username string
    Username of the prometheus, used in basic authentication type.
    VpcId string
    Vpc id.
    authType String
    Authentication type of the prometheus.
    url String
    Url of the prometheus.
    isPublicAddr Boolean
    Whether it is public address, default false.
    password String
    Password of the prometheus, used in basic authentication type.
    username String
    Username of the prometheus, used in basic authentication type.
    vpcId String
    Vpc id.
    authType string
    Authentication type of the prometheus.
    url string
    Url of the prometheus.
    isPublicAddr boolean
    Whether it is public address, default false.
    password string
    Password of the prometheus, used in basic authentication type.
    username string
    Username of the prometheus, used in basic authentication type.
    vpcId string
    Vpc id.
    auth_type str
    Authentication type of the prometheus.
    url str
    Url of the prometheus.
    is_public_addr bool
    Whether it is public address, default false.
    password str
    Password of the prometheus, used in basic authentication type.
    username str
    Username of the prometheus, used in basic authentication type.
    vpc_id str
    Vpc id.
    authType String
    Authentication type of the prometheus.
    url String
    Url of the prometheus.
    isPublicAddr Boolean
    Whether it is public address, default false.
    password String
    Password of the prometheus, used in basic authentication type.
    username String
    Username of the prometheus, used in basic authentication type.
    vpcId String
    Vpc id.

    Import

    tcm prometheus_attachment can be imported using the mesh_id, e.g.

    $ pulumi import tencentcloud:index/tcmPrometheusAttachment:TcmPrometheusAttachment prometheus_attachment mesh-rofjmxxx
    

    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 tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack