1. Packages
  2. Selectel Provider
  3. API Docs
  4. DbaasPrometheusMetricTokenV1
selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel

selectel.DbaasPrometheusMetricTokenV1

Explore with Pulumi AI

selectel logo
selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel

    Creates and manages tokens required to get access to the metrics in the Prometheus format using public API v1. For more information about export of Prometheus metrics, see the official Selectel documentation for PostgreSQL, PostgreSQL for 1C, PostgreSQL TimescaleDB, MySQL semi-sync, MySQL sync, Redis and Kafka.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const token1 = new selectel.DbaasPrometheusMetricTokenV1("token1", {
        projectId: selectel_vpc_project_v2.project_1.id,
        region: "ru-3",
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    token1 = selectel.DbaasPrometheusMetricTokenV1("token1",
        project_id=selectel_vpc_project_v2["project_1"]["id"],
        region="ru-3")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v6/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := selectel.NewDbaasPrometheusMetricTokenV1(ctx, "token1", &selectel.DbaasPrometheusMetricTokenV1Args{
    			ProjectId: pulumi.Any(selectel_vpc_project_v2.Project_1.Id),
    			Region:    pulumi.String("ru-3"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        var token1 = new Selectel.DbaasPrometheusMetricTokenV1("token1", new()
        {
            ProjectId = selectel_vpc_project_v2.Project_1.Id,
            Region = "ru-3",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.DbaasPrometheusMetricTokenV1;
    import com.pulumi.selectel.DbaasPrometheusMetricTokenV1Args;
    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 token1 = new DbaasPrometheusMetricTokenV1("token1", DbaasPrometheusMetricTokenV1Args.builder()
                .projectId(selectel_vpc_project_v2.project_1().id())
                .region("ru-3")
                .build());
    
        }
    }
    
    resources:
      token1:
        type: selectel:DbaasPrometheusMetricTokenV1
        properties:
          projectId: ${selectel_vpc_project_v2.project_1.id}
          region: ru-3
    

    Create DbaasPrometheusMetricTokenV1 Resource

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

    Constructor syntax

    new DbaasPrometheusMetricTokenV1(name: string, args: DbaasPrometheusMetricTokenV1Args, opts?: CustomResourceOptions);
    @overload
    def DbaasPrometheusMetricTokenV1(resource_name: str,
                                     args: DbaasPrometheusMetricTokenV1Args,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def DbaasPrometheusMetricTokenV1(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     project_id: Optional[str] = None,
                                     region: Optional[str] = None,
                                     dbaas_prometheus_metric_token_v1_id: Optional[str] = None,
                                     name: Optional[str] = None,
                                     timeouts: Optional[DbaasPrometheusMetricTokenV1TimeoutsArgs] = None)
    func NewDbaasPrometheusMetricTokenV1(ctx *Context, name string, args DbaasPrometheusMetricTokenV1Args, opts ...ResourceOption) (*DbaasPrometheusMetricTokenV1, error)
    public DbaasPrometheusMetricTokenV1(string name, DbaasPrometheusMetricTokenV1Args args, CustomResourceOptions? opts = null)
    public DbaasPrometheusMetricTokenV1(String name, DbaasPrometheusMetricTokenV1Args args)
    public DbaasPrometheusMetricTokenV1(String name, DbaasPrometheusMetricTokenV1Args args, CustomResourceOptions options)
    
    type: selectel:DbaasPrometheusMetricTokenV1
    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 DbaasPrometheusMetricTokenV1Args
    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 DbaasPrometheusMetricTokenV1Args
    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 DbaasPrometheusMetricTokenV1Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DbaasPrometheusMetricTokenV1Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DbaasPrometheusMetricTokenV1Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var dbaasPrometheusMetricTokenV1Resource = new Selectel.DbaasPrometheusMetricTokenV1("dbaasPrometheusMetricTokenV1Resource", new()
    {
        ProjectId = "string",
        Region = "string",
        DbaasPrometheusMetricTokenV1Id = "string",
        Name = "string",
        Timeouts = new Selectel.Inputs.DbaasPrometheusMetricTokenV1TimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := selectel.NewDbaasPrometheusMetricTokenV1(ctx, "dbaasPrometheusMetricTokenV1Resource", &selectel.DbaasPrometheusMetricTokenV1Args{
    	ProjectId:                      pulumi.String("string"),
    	Region:                         pulumi.String("string"),
    	DbaasPrometheusMetricTokenV1Id: pulumi.String("string"),
    	Name:                           pulumi.String("string"),
    	Timeouts: &selectel.DbaasPrometheusMetricTokenV1TimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    var dbaasPrometheusMetricTokenV1Resource = new DbaasPrometheusMetricTokenV1("dbaasPrometheusMetricTokenV1Resource", DbaasPrometheusMetricTokenV1Args.builder()
        .projectId("string")
        .region("string")
        .dbaasPrometheusMetricTokenV1Id("string")
        .name("string")
        .timeouts(DbaasPrometheusMetricTokenV1TimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    dbaas_prometheus_metric_token_v1_resource = selectel.DbaasPrometheusMetricTokenV1("dbaasPrometheusMetricTokenV1Resource",
        project_id="string",
        region="string",
        dbaas_prometheus_metric_token_v1_id="string",
        name="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        })
    
    const dbaasPrometheusMetricTokenV1Resource = new selectel.DbaasPrometheusMetricTokenV1("dbaasPrometheusMetricTokenV1Resource", {
        projectId: "string",
        region: "string",
        dbaasPrometheusMetricTokenV1Id: "string",
        name: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: selectel:DbaasPrometheusMetricTokenV1
    properties:
        dbaasPrometheusMetricTokenV1Id: string
        name: string
        projectId: string
        region: string
        timeouts:
            create: string
            delete: string
            update: string
    

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

    ProjectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    DbaasPrometheusMetricTokenV1Id string
    Name string
    Token name. Changing this creates a new token.
    Timeouts DbaasPrometheusMetricTokenV1Timeouts
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    DbaasPrometheusMetricTokenV1Id string
    Name string
    Token name. Changing this creates a new token.
    Timeouts DbaasPrometheusMetricTokenV1TimeoutsArgs
    projectId String
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    dbaasPrometheusMetricTokenV1Id String
    name String
    Token name. Changing this creates a new token.
    timeouts DbaasPrometheusMetricTokenV1Timeouts
    projectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region string
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    dbaasPrometheusMetricTokenV1Id string
    name string
    Token name. Changing this creates a new token.
    timeouts DbaasPrometheusMetricTokenV1Timeouts
    project_id str
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region str
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    dbaas_prometheus_metric_token_v1_id str
    name str
    Token name. Changing this creates a new token.
    timeouts DbaasPrometheusMetricTokenV1TimeoutsArgs
    projectId String
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    dbaasPrometheusMetricTokenV1Id String
    name String
    Token name. Changing this creates a new token.
    timeouts Property Map

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Value string
    (Sensitive) - Token value.
    Id string
    The provider-assigned unique ID for this managed resource.
    Value string
    (Sensitive) - Token value.
    id String
    The provider-assigned unique ID for this managed resource.
    value String
    (Sensitive) - Token value.
    id string
    The provider-assigned unique ID for this managed resource.
    value string
    (Sensitive) - Token value.
    id str
    The provider-assigned unique ID for this managed resource.
    value str
    (Sensitive) - Token value.
    id String
    The provider-assigned unique ID for this managed resource.
    value String
    (Sensitive) - Token value.

    Look up Existing DbaasPrometheusMetricTokenV1 Resource

    Get an existing DbaasPrometheusMetricTokenV1 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?: DbaasPrometheusMetricTokenV1State, opts?: CustomResourceOptions): DbaasPrometheusMetricTokenV1
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dbaas_prometheus_metric_token_v1_id: Optional[str] = None,
            name: Optional[str] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            timeouts: Optional[DbaasPrometheusMetricTokenV1TimeoutsArgs] = None,
            value: Optional[str] = None) -> DbaasPrometheusMetricTokenV1
    func GetDbaasPrometheusMetricTokenV1(ctx *Context, name string, id IDInput, state *DbaasPrometheusMetricTokenV1State, opts ...ResourceOption) (*DbaasPrometheusMetricTokenV1, error)
    public static DbaasPrometheusMetricTokenV1 Get(string name, Input<string> id, DbaasPrometheusMetricTokenV1State? state, CustomResourceOptions? opts = null)
    public static DbaasPrometheusMetricTokenV1 get(String name, Output<String> id, DbaasPrometheusMetricTokenV1State state, CustomResourceOptions options)
    resources:  _:    type: selectel:DbaasPrometheusMetricTokenV1    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:
    DbaasPrometheusMetricTokenV1Id string
    Name string
    Token name. Changing this creates a new token.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    Timeouts DbaasPrometheusMetricTokenV1Timeouts
    Value string
    (Sensitive) - Token value.
    DbaasPrometheusMetricTokenV1Id string
    Name string
    Token name. Changing this creates a new token.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    Timeouts DbaasPrometheusMetricTokenV1TimeoutsArgs
    Value string
    (Sensitive) - Token value.
    dbaasPrometheusMetricTokenV1Id String
    name String
    Token name. Changing this creates a new token.
    projectId String
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    timeouts DbaasPrometheusMetricTokenV1Timeouts
    value String
    (Sensitive) - Token value.
    dbaasPrometheusMetricTokenV1Id string
    name string
    Token name. Changing this creates a new token.
    projectId string
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region string
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    timeouts DbaasPrometheusMetricTokenV1Timeouts
    value string
    (Sensitive) - Token value.
    dbaas_prometheus_metric_token_v1_id str
    name str
    Token name. Changing this creates a new token.
    project_id str
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region str
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    timeouts DbaasPrometheusMetricTokenV1TimeoutsArgs
    value str
    (Sensitive) - Token value.
    dbaasPrometheusMetricTokenV1Id String
    name String
    Token name. Changing this creates a new token.
    projectId String
    Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.
    timeouts Property Map
    value String
    (Sensitive) - Token value.

    Supporting Types

    DbaasPrometheusMetricTokenV1Timeouts, DbaasPrometheusMetricTokenV1TimeoutsArgs

    Create string
    Delete string
    Update string
    Create string
    Delete string
    Update string
    create String
    delete String
    update String
    create string
    delete string
    update string
    create str
    delete str
    update str
    create String
    delete String
    update String

    Import

    You can import a token:

    export OS_DOMAIN_NAME=<account_id>

    export OS_USERNAME=

    export OS_PASSWORD=

    export INFRA_PROJECT_ID=<selectel_project_id>

    export INFRA_REGION=<selectel_pool>

    $ pulumi import selectel:index/dbaasPrometheusMetricTokenV1:DbaasPrometheusMetricTokenV1 token_1 <token_id>
    

    where:

    • <account_id> — Selectel account ID. The account ID is in the top right corner of the Control panel. Learn more about Registration.

    • <username> — Name of the service user. To get the name, in the Control panel, go to Identity & Access ManagementUser management ⟶ the Service users tab ⟶ copy the name of the required user. Learn more about Service users.

    • <password> — Password of the service user.

    • <selectel_project_id> — Unique identifier of the associated project. To get the ID, in the Control panel, go to Cloud Platform ⟶ project name ⟶ copy the ID of the required project. Learn more about Projects.

    • <selectel_pool> — Pool where the cluster is located, for example, ru-3. To get information about the pool, in the Control panel, go to Cloud PlatformManaged Databases. The pool is in the Pool column.

    • <token_id> — Unique identifier of the token, for example, b311ce58-2658-46b5-b733-7a0f418703f2. To get the token ID in the Control panel, go to Cloud PlatformManaged Databases ⟶ the cluster page ⟶ Monitoring tab ⟶ Metrics in the Prometheus format section ⟶ Manage tokens.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    selectel selectel/terraform-provider-selectel
    License
    Notes
    This Pulumi package is based on the selectel Terraform Provider.
    selectel logo
    selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel