published on Tuesday, Apr 28, 2026 by Pulumi
published on Tuesday, Apr 28, 2026 by Pulumi
Provides a Cms Prometheus Instance resource.
For information about Cms Prometheus Instance and how to use it, see What is Prometheus Instance.
NOTE: Available since v1.277.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new random.index.Integer("default", {
min: 10000,
max: 99999,
});
const defaultProject = new alicloud.log.Project("default", {projectName: `${name}-${_default.result}`});
const defaultWorkspace = new alicloud.cms.Workspace("default", {
workspaceName: name,
slsProject: defaultProject.projectName,
});
const defaultPrometheusInstance = new alicloud.cms.PrometheusInstance("default", {
prometheusInstanceName: name,
workspace: defaultWorkspace.id,
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = random.Integer("default",
min=10000,
max=99999)
default_project = alicloud.log.Project("default", project_name=f"{name}-{default['result']}")
default_workspace = alicloud.cms.Workspace("default",
workspace_name=name,
sls_project=default_project.project_name)
default_prometheus_instance = alicloud.cms.PrometheusInstance("default",
prometheus_instance_name=name,
workspace=default_workspace.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 10000,
Max: 99999,
})
if err != nil {
return err
}
defaultProject, err := log.NewProject(ctx, "default", &log.ProjectArgs{
ProjectName: pulumi.Sprintf("%v-%v", name, _default.Result),
})
if err != nil {
return err
}
defaultWorkspace, err := cms.NewWorkspace(ctx, "default", &cms.WorkspaceArgs{
WorkspaceName: pulumi.String(pulumi.String(name)),
SlsProject: defaultProject.ProjectName,
})
if err != nil {
return err
}
_, err = cms.NewPrometheusInstance(ctx, "default", &cms.PrometheusInstanceArgs{
PrometheusInstanceName: pulumi.String(pulumi.String(name)),
Workspace: defaultWorkspace.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = new Random.Index.Integer("default", new()
{
Min = 10000,
Max = 99999,
});
var defaultProject = new AliCloud.Log.Project("default", new()
{
ProjectName = $"{name}-{@default.Result}",
});
var defaultWorkspace = new AliCloud.Cms.Workspace("default", new()
{
WorkspaceName = name,
SlsProject = defaultProject.ProjectName,
});
var defaultPrometheusInstance = new AliCloud.Cms.PrometheusInstance("default", new()
{
PrometheusInstanceName = name,
Workspace = defaultWorkspace.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.Integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.cms.Workspace;
import com.pulumi.alicloud.cms.WorkspaceArgs;
import com.pulumi.alicloud.cms.PrometheusInstance;
import com.pulumi.alicloud.cms.PrometheusInstanceArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var default_ = new Integer("default", IntegerArgs.builder()
.min(10000)
.max(99999)
.build());
var defaultProject = new Project("defaultProject", ProjectArgs.builder()
.projectName(String.format("%s-%s", name,default_.result()))
.build());
var defaultWorkspace = new Workspace("defaultWorkspace", WorkspaceArgs.builder()
.workspaceName(name)
.slsProject(defaultProject.projectName())
.build());
var defaultPrometheusInstance = new PrometheusInstance("defaultPrometheusInstance", PrometheusInstanceArgs.builder()
.prometheusInstanceName(name)
.workspace(defaultWorkspace.id())
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: random:Integer
properties:
min: 10000
max: 99999
defaultProject:
type: alicloud:log:Project
name: default
properties:
projectName: ${name}-${default.result}
defaultWorkspace:
type: alicloud:cms:Workspace
name: default
properties:
workspaceName: ${name}
slsProject: ${defaultProject.projectName}
defaultPrometheusInstance:
type: alicloud:cms:PrometheusInstance
name: default
properties:
prometheusInstanceName: ${name}
workspace: ${defaultWorkspace.id}
📚 Need more examples? VIEW MORE EXAMPLES
Create PrometheusInstance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PrometheusInstance(name: string, args: PrometheusInstanceArgs, opts?: CustomResourceOptions);@overload
def PrometheusInstance(resource_name: str,
args: PrometheusInstanceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PrometheusInstance(resource_name: str,
opts: Optional[ResourceOptions] = None,
prometheus_instance_name: Optional[str] = None,
workspace: Optional[str] = None,
archive_duration: Optional[int] = None,
auth_free_read_policy: Optional[str] = None,
auth_free_write_policy: Optional[str] = None,
enable_auth_free_read: Optional[bool] = None,
enable_auth_free_write: Optional[bool] = None,
storage_duration: Optional[int] = None)func NewPrometheusInstance(ctx *Context, name string, args PrometheusInstanceArgs, opts ...ResourceOption) (*PrometheusInstance, error)public PrometheusInstance(string name, PrometheusInstanceArgs args, CustomResourceOptions? opts = null)
public PrometheusInstance(String name, PrometheusInstanceArgs args)
public PrometheusInstance(String name, PrometheusInstanceArgs args, CustomResourceOptions options)
type: alicloud:cms:PrometheusInstance
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 PrometheusInstanceArgs
- 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 PrometheusInstanceArgs
- 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 PrometheusInstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrometheusInstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrometheusInstanceArgs
- 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 prometheusInstanceResource = new AliCloud.Cms.PrometheusInstance("prometheusInstanceResource", new()
{
PrometheusInstanceName = "string",
Workspace = "string",
ArchiveDuration = 0,
AuthFreeReadPolicy = "string",
AuthFreeWritePolicy = "string",
EnableAuthFreeRead = false,
EnableAuthFreeWrite = false,
StorageDuration = 0,
});
example, err := cms.NewPrometheusInstance(ctx, "prometheusInstanceResource", &cms.PrometheusInstanceArgs{
PrometheusInstanceName: pulumi.String("string"),
Workspace: pulumi.String("string"),
ArchiveDuration: pulumi.Int(0),
AuthFreeReadPolicy: pulumi.String("string"),
AuthFreeWritePolicy: pulumi.String("string"),
EnableAuthFreeRead: pulumi.Bool(false),
EnableAuthFreeWrite: pulumi.Bool(false),
StorageDuration: pulumi.Int(0),
})
var prometheusInstanceResource = new PrometheusInstance("prometheusInstanceResource", PrometheusInstanceArgs.builder()
.prometheusInstanceName("string")
.workspace("string")
.archiveDuration(0)
.authFreeReadPolicy("string")
.authFreeWritePolicy("string")
.enableAuthFreeRead(false)
.enableAuthFreeWrite(false)
.storageDuration(0)
.build());
prometheus_instance_resource = alicloud.cms.PrometheusInstance("prometheusInstanceResource",
prometheus_instance_name="string",
workspace="string",
archive_duration=0,
auth_free_read_policy="string",
auth_free_write_policy="string",
enable_auth_free_read=False,
enable_auth_free_write=False,
storage_duration=0)
const prometheusInstanceResource = new alicloud.cms.PrometheusInstance("prometheusInstanceResource", {
prometheusInstanceName: "string",
workspace: "string",
archiveDuration: 0,
authFreeReadPolicy: "string",
authFreeWritePolicy: "string",
enableAuthFreeRead: false,
enableAuthFreeWrite: false,
storageDuration: 0,
});
type: alicloud:cms:PrometheusInstance
properties:
archiveDuration: 0
authFreeReadPolicy: string
authFreeWritePolicy: string
enableAuthFreeRead: false
enableAuthFreeWrite: false
prometheusInstanceName: string
storageDuration: 0
workspace: string
PrometheusInstance 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 PrometheusInstance resource accepts the following input properties:
- Prometheus
Instance stringName - The name of the instance.
- Workspace string
- The workspace to which the instance belongs.
- Archive
Duration int - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - Auth
Free stringRead Policy - The policy for password-free read access.
- Auth
Free stringWrite Policy - The policy for password-free write access.
- Enable
Auth boolFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - Enable
Auth boolFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - Storage
Duration int - The storage duration of the instance in days.
- Prometheus
Instance stringName - The name of the instance.
- Workspace string
- The workspace to which the instance belongs.
- Archive
Duration int - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - Auth
Free stringRead Policy - The policy for password-free read access.
- Auth
Free stringWrite Policy - The policy for password-free write access.
- Enable
Auth boolFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - Enable
Auth boolFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - Storage
Duration int - The storage duration of the instance in days.
- prometheus
Instance StringName - The name of the instance.
- workspace String
- The workspace to which the instance belongs.
- archive
Duration Integer - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - auth
Free StringRead Policy - The policy for password-free read access.
- auth
Free StringWrite Policy - The policy for password-free write access.
- enable
Auth BooleanFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - enable
Auth BooleanFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - storage
Duration Integer - The storage duration of the instance in days.
- prometheus
Instance stringName - The name of the instance.
- workspace string
- The workspace to which the instance belongs.
- archive
Duration number - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - auth
Free stringRead Policy - The policy for password-free read access.
- auth
Free stringWrite Policy - The policy for password-free write access.
- enable
Auth booleanFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - enable
Auth booleanFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - storage
Duration number - The storage duration of the instance in days.
- prometheus_
instance_ strname - The name of the instance.
- workspace str
- The workspace to which the instance belongs.
- archive_
duration int - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - auth_
free_ strread_ policy - The policy for password-free read access.
- auth_
free_ strwrite_ policy - The policy for password-free write access.
- enable_
auth_ boolfree_ read - Specifies whether to enable password-free read access. Valid values:
true,false. - enable_
auth_ boolfree_ write - Specifies whether to enable password-free write access. Valid values:
true,false. - storage_
duration int - The storage duration of the instance in days.
- prometheus
Instance StringName - The name of the instance.
- workspace String
- The workspace to which the instance belongs.
- archive
Duration Number - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - auth
Free StringRead Policy - The policy for password-free read access.
- auth
Free StringWrite Policy - The policy for password-free write access.
- enable
Auth BooleanFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - enable
Auth BooleanFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - storage
Duration Number - The storage duration of the instance in days.
Outputs
All input properties are implicitly available as output properties. Additionally, the PrometheusInstance resource produces the following output properties:
- Create
Time string - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- Id string
- The provider-assigned unique ID for this managed resource.
- Payment
Type string - Payment Type.
- Region
Id string - The region ID of the resource.
- Create
Time string - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- Id string
- The provider-assigned unique ID for this managed resource.
- Payment
Type string - Payment Type.
- Region
Id string - The region ID of the resource.
- create
Time String - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- id String
- The provider-assigned unique ID for this managed resource.
- payment
Type String - Payment Type.
- region
Id String - The region ID of the resource.
- create
Time string - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- id string
- The provider-assigned unique ID for this managed resource.
- payment
Type string - Payment Type.
- region
Id string - The region ID of the resource.
- create_
time str - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- id str
- The provider-assigned unique ID for this managed resource.
- payment_
type str - Payment Type.
- region_
id str - The region ID of the resource.
- create
Time String - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- id String
- The provider-assigned unique ID for this managed resource.
- payment
Type String - Payment Type.
- region
Id String - The region ID of the resource.
Look up Existing PrometheusInstance Resource
Get an existing PrometheusInstance 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?: PrometheusInstanceState, opts?: CustomResourceOptions): PrometheusInstance@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
archive_duration: Optional[int] = None,
auth_free_read_policy: Optional[str] = None,
auth_free_write_policy: Optional[str] = None,
create_time: Optional[str] = None,
enable_auth_free_read: Optional[bool] = None,
enable_auth_free_write: Optional[bool] = None,
payment_type: Optional[str] = None,
prometheus_instance_name: Optional[str] = None,
region_id: Optional[str] = None,
storage_duration: Optional[int] = None,
workspace: Optional[str] = None) -> PrometheusInstancefunc GetPrometheusInstance(ctx *Context, name string, id IDInput, state *PrometheusInstanceState, opts ...ResourceOption) (*PrometheusInstance, error)public static PrometheusInstance Get(string name, Input<string> id, PrometheusInstanceState? state, CustomResourceOptions? opts = null)public static PrometheusInstance get(String name, Output<String> id, PrometheusInstanceState state, CustomResourceOptions options)resources: _: type: alicloud:cms:PrometheusInstance 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.
- Archive
Duration int - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - Auth
Free stringRead Policy - The policy for password-free read access.
- Auth
Free stringWrite Policy - The policy for password-free write access.
- Create
Time string - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- Enable
Auth boolFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - Enable
Auth boolFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - Payment
Type string - Payment Type.
- Prometheus
Instance stringName - The name of the instance.
- Region
Id string - The region ID of the resource.
- Storage
Duration int - The storage duration of the instance in days.
- Workspace string
- The workspace to which the instance belongs.
- Archive
Duration int - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - Auth
Free stringRead Policy - The policy for password-free read access.
- Auth
Free stringWrite Policy - The policy for password-free write access.
- Create
Time string - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- Enable
Auth boolFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - Enable
Auth boolFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - Payment
Type string - Payment Type.
- Prometheus
Instance stringName - The name of the instance.
- Region
Id string - The region ID of the resource.
- Storage
Duration int - The storage duration of the instance in days.
- Workspace string
- The workspace to which the instance belongs.
- archive
Duration Integer - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - auth
Free StringRead Policy - The policy for password-free read access.
- auth
Free StringWrite Policy - The policy for password-free write access.
- create
Time String - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- enable
Auth BooleanFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - enable
Auth BooleanFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - payment
Type String - Payment Type.
- prometheus
Instance StringName - The name of the instance.
- region
Id String - The region ID of the resource.
- storage
Duration Integer - The storage duration of the instance in days.
- workspace String
- The workspace to which the instance belongs.
- archive
Duration number - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - auth
Free stringRead Policy - The policy for password-free read access.
- auth
Free stringWrite Policy - The policy for password-free write access.
- create
Time string - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- enable
Auth booleanFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - enable
Auth booleanFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - payment
Type string - Payment Type.
- prometheus
Instance stringName - The name of the instance.
- region
Id string - The region ID of the resource.
- storage
Duration number - The storage duration of the instance in days.
- workspace string
- The workspace to which the instance belongs.
- archive_
duration int - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - auth_
free_ strread_ policy - The policy for password-free read access.
- auth_
free_ strwrite_ policy - The policy for password-free write access.
- create_
time str - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- enable_
auth_ boolfree_ read - Specifies whether to enable password-free read access. Valid values:
true,false. - enable_
auth_ boolfree_ write - Specifies whether to enable password-free write access. Valid values:
true,false. - payment_
type str - Payment Type.
- prometheus_
instance_ strname - The name of the instance.
- region_
id str - The region ID of the resource.
- storage_
duration int - The storage duration of the instance in days.
- workspace str
- The workspace to which the instance belongs.
- archive
Duration Number - The number of days that data is automatically archived after the storage duration expires. Valid values:
60to3650. - auth
Free StringRead Policy - The policy for password-free read access.
- auth
Free StringWrite Policy - The policy for password-free write access.
- create
Time String - Instance creation time, using UTC +0 time, in the format of yyyy-MM-ddTHH:mmZ.
- enable
Auth BooleanFree Read - Specifies whether to enable password-free read access. Valid values:
true,false. - enable
Auth BooleanFree Write - Specifies whether to enable password-free write access. Valid values:
true,false. - payment
Type String - Payment Type.
- prometheus
Instance StringName - The name of the instance.
- region
Id String - The region ID of the resource.
- storage
Duration Number - The storage duration of the instance in days.
- workspace String
- The workspace to which the instance belongs.
Import
Cms Prometheus Instance can be imported using the id, e.g.
$ pulumi import alicloud:cms/prometheusInstance:PrometheusInstance example <id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
published on Tuesday, Apr 28, 2026 by Pulumi
