Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi
alicloud.arms.getEnvServiceMonitors
Explore with Pulumi AI
This data source provides the ARMS Env Service Monitors of the current Alibaba Cloud user.
NOTE: Available since v1.258.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
import * as std from "@pulumi/std";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const defaultInteger = new random.index.Integer("default", {
min: 10000,
max: 99999,
});
const enhanced = alicloud.vpc.getEnhancedNatAvailableZones({});
const vpc = new alicloud.vpc.Network("vpc", {
description: "api-resource-test1-hz",
cidrBlock: "192.168.0.0/16",
vpcName: `${name}-${defaultInteger.result}`,
});
const vswitch = new alicloud.vpc.Switch("vswitch", {
description: "api-resource-test1-hz",
vpcId: vpc.id,
vswitchName: `${name}-${defaultInteger.result}`,
zoneId: enhanced.then(enhanced => enhanced.zones?.[0]?.zoneId),
cidrBlock: vpc.cidrBlock.apply(cidrBlock => std.cidrsubnetOutput({
input: cidrBlock,
newbits: 8,
netnum: 8,
})).apply(invoke => invoke.result),
});
const defaultSnapshotPolicy = new alicloud.ecs.SnapshotPolicy("default", {
name: `${name}-${defaultInteger.result}`,
repeatWeekdays: [
"1",
"2",
"3",
],
retentionDays: -1,
timePoints: [
"1",
"22",
"23",
],
});
const _default = vswitch.zoneId.apply(zoneId => alicloud.ecs.getInstanceTypesOutput({
availabilityZone: zoneId,
cpuCoreCount: 2,
memorySize: 4,
kubernetesNodeRole: "Worker",
instanceTypeFamily: "ecs.sn1ne",
}));
const defaultManagedKubernetes = new alicloud.cs.ManagedKubernetes("default", {
name: `${name}-${defaultInteger.result}`,
clusterSpec: "ack.pro.small",
version: "1.24.6-aliyun.1",
newNatGateway: true,
nodeCidrMask: 26,
proxyMode: "ipvs",
serviceCidr: "172.23.0.0/16",
podCidr: "10.95.0.0/16",
workerVswitchIds: [vswitch.id],
});
const defaultKeyPair = new alicloud.ecs.KeyPair("default", {keyPairName: `${name}-${defaultInteger.result}`});
const defaultNodePool = new alicloud.cs.NodePool("default", {
name: "desired_size",
clusterId: defaultManagedKubernetes.id,
vswitchIds: [vswitch.id],
instanceTypes: [_default.apply(_default => _default.instanceTypes?.[0]?.id)],
systemDiskCategory: "cloud_efficiency",
systemDiskSize: 40,
keyName: defaultKeyPair.keyPairName,
desiredSize: "2",
});
const defaultEnvironment = new alicloud.arms.Environment("default", {
environmentType: "CS",
environmentName: `${name}-${defaultInteger.result}`,
bindResourceId: defaultNodePool.clusterId,
environmentSubType: "ManagedKubernetes",
});
const defaultEnvServiceMonitor = new alicloud.arms.EnvServiceMonitor("default", {
aliyunLang: "en",
environmentId: defaultEnvironment.id,
configYaml: `apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: arms-admin1
namespace: arms-prom
annotations:
arms.prometheus.io/discovery: 'true'
o11y.aliyun.com/addon-name: mysql
o11y.aliyun.com/addon-version: 1.0.1
o11y.aliyun.com/release-name: mysql1
spec:
endpoints:
- interval: 30s
port: operator
path: /metrics
- interval: 10s
port: operator1
path: /metrics
namespaceSelector:
any: true
selector:
matchLabels:
app: arms-prometheus-ack-arms-prometheus
`,
});
const ids = alicloud.arms.getEnvServiceMonitorsOutput({
environmentId: defaultEnvServiceMonitor.environmentId,
ids: [defaultEnvServiceMonitor.id],
});
export const armsEnvServiceMonitorsId0 = ids.apply(ids => ids.monitors?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
import pulumi_std as std
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default_integer = random.index.Integer("default",
min=10000,
max=99999)
enhanced = alicloud.vpc.get_enhanced_nat_available_zones()
vpc = alicloud.vpc.Network("vpc",
description="api-resource-test1-hz",
cidr_block="192.168.0.0/16",
vpc_name=f"{name}-{default_integer['result']}")
vswitch = alicloud.vpc.Switch("vswitch",
description="api-resource-test1-hz",
vpc_id=vpc.id,
vswitch_name=f"{name}-{default_integer['result']}",
zone_id=enhanced.zones[0].zone_id,
cidr_block=vpc.cidr_block.apply(lambda cidr_block: std.cidrsubnet_output(input=cidr_block,
newbits=8,
netnum=8)).apply(lambda invoke: invoke.result))
default_snapshot_policy = alicloud.ecs.SnapshotPolicy("default",
name=f"{name}-{default_integer['result']}",
repeat_weekdays=[
"1",
"2",
"3",
],
retention_days=-1,
time_points=[
"1",
"22",
"23",
])
default = vswitch.zone_id.apply(lambda zone_id: alicloud.ecs.get_instance_types_output(availability_zone=zone_id,
cpu_core_count=2,
memory_size=4,
kubernetes_node_role="Worker",
instance_type_family="ecs.sn1ne"))
default_managed_kubernetes = alicloud.cs.ManagedKubernetes("default",
name=f"{name}-{default_integer['result']}",
cluster_spec="ack.pro.small",
version="1.24.6-aliyun.1",
new_nat_gateway=True,
node_cidr_mask=26,
proxy_mode="ipvs",
service_cidr="172.23.0.0/16",
pod_cidr="10.95.0.0/16",
worker_vswitch_ids=[vswitch.id])
default_key_pair = alicloud.ecs.KeyPair("default", key_pair_name=f"{name}-{default_integer['result']}")
default_node_pool = alicloud.cs.NodePool("default",
name="desired_size",
cluster_id=default_managed_kubernetes.id,
vswitch_ids=[vswitch.id],
instance_types=[default.instance_types[0].id],
system_disk_category="cloud_efficiency",
system_disk_size=40,
key_name=default_key_pair.key_pair_name,
desired_size="2")
default_environment = alicloud.arms.Environment("default",
environment_type="CS",
environment_name=f"{name}-{default_integer['result']}",
bind_resource_id=default_node_pool.cluster_id,
environment_sub_type="ManagedKubernetes")
default_env_service_monitor = alicloud.arms.EnvServiceMonitor("default",
aliyun_lang="en",
environment_id=default_environment.id,
config_yaml="""apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: arms-admin1
namespace: arms-prom
annotations:
arms.prometheus.io/discovery: 'true'
o11y.aliyun.com/addon-name: mysql
o11y.aliyun.com/addon-version: 1.0.1
o11y.aliyun.com/release-name: mysql1
spec:
endpoints:
- interval: 30s
port: operator
path: /metrics
- interval: 10s
port: operator1
path: /metrics
namespaceSelector:
any: true
selector:
matchLabels:
app: arms-prometheus-ack-arms-prometheus
""")
ids = alicloud.arms.get_env_service_monitors_output(environment_id=default_env_service_monitor.environment_id,
ids=[default_env_service_monitor.id])
pulumi.export("armsEnvServiceMonitorsId0", ids.monitors[0].id)
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/arms"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi-std/sdk/go/std"
"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
}
defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 10000,
Max: 99999,
})
if err != nil {
return err
}
enhanced, err := vpc.GetEnhancedNatAvailableZones(ctx, &vpc.GetEnhancedNatAvailableZonesArgs{
}, nil);
if err != nil {
return err
}
vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
Description: pulumi.String("api-resource-test1-hz"),
CidrBlock: pulumi.String("192.168.0.0/16"),
VpcName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
})
if err != nil {
return err
}
vswitch, err := vpc.NewSwitch(ctx, "vswitch", &vpc.SwitchArgs{
Description: pulumi.String("api-resource-test1-hz"),
VpcId: vpc.ID(),
VswitchName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
ZoneId: pulumi.String(enhanced.Zones[0].ZoneId),
CidrBlock: pulumi.String(vpc.CidrBlock.ApplyT(func(cidrBlock string) (std.CidrsubnetResult, error) {
return std.CidrsubnetResult(interface{}(std.CidrsubnetOutput(ctx, std.CidrsubnetOutputArgs{
Input: cidrBlock,
Newbits: 8,
Netnum: 8,
}, nil))), nil
}).(std.CidrsubnetResultOutput).ApplyT(func(invoke std.CidrsubnetResult) (*string, error) {
return invoke.Result, nil
}).(pulumi.StringPtrOutput)),
})
if err != nil {
return err
}
_, err = ecs.NewSnapshotPolicy(ctx, "default", &ecs.SnapshotPolicyArgs{
Name: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
RepeatWeekdays: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("2"),
pulumi.String("3"),
},
RetentionDays: pulumi.Int(-1),
TimePoints: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("22"),
pulumi.String("23"),
},
})
if err != nil {
return err
}
_default := vswitch.ZoneId.ApplyT(func(zoneId string) (ecs.GetInstanceTypesResult, error) {
return ecs.GetInstanceTypesResult(interface{}(ecs.GetInstanceTypesOutput(ctx, ecs.GetInstanceTypesOutputArgs{
AvailabilityZone: zoneId,
CpuCoreCount: 2,
MemorySize: 4,
KubernetesNodeRole: "Worker",
InstanceTypeFamily: "ecs.sn1ne",
}, nil))), nil
}).(ecs.GetInstanceTypesResultOutput)
defaultManagedKubernetes, err := cs.NewManagedKubernetes(ctx, "default", &cs.ManagedKubernetesArgs{
Name: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
ClusterSpec: pulumi.String("ack.pro.small"),
Version: pulumi.String("1.24.6-aliyun.1"),
NewNatGateway: pulumi.Bool(true),
NodeCidrMask: pulumi.Int(26),
ProxyMode: pulumi.String("ipvs"),
ServiceCidr: pulumi.String("172.23.0.0/16"),
PodCidr: pulumi.String("10.95.0.0/16"),
WorkerVswitchIds: pulumi.StringArray{
vswitch.ID(),
},
})
if err != nil {
return err
}
defaultKeyPair, err := ecs.NewKeyPair(ctx, "default", &ecs.KeyPairArgs{
KeyPairName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
})
if err != nil {
return err
}
defaultNodePool, err := cs.NewNodePool(ctx, "default", &cs.NodePoolArgs{
Name: pulumi.String("desired_size"),
ClusterId: defaultManagedKubernetes.ID(),
VswitchIds: pulumi.StringArray{
vswitch.ID(),
},
InstanceTypes: pulumi.StringArray{
pulumi.String(_default.ApplyT(func(_default ecs.GetInstanceTypesResult) (*string, error) {
return &default.InstanceTypes[0].Id, nil
}).(pulumi.StringPtrOutput)),
},
SystemDiskCategory: pulumi.String("cloud_efficiency"),
SystemDiskSize: pulumi.Int(40),
KeyName: defaultKeyPair.KeyPairName,
DesiredSize: pulumi.String("2"),
})
if err != nil {
return err
}
defaultEnvironment, err := arms.NewEnvironment(ctx, "default", &arms.EnvironmentArgs{
EnvironmentType: pulumi.String("CS"),
EnvironmentName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
BindResourceId: defaultNodePool.ClusterId,
EnvironmentSubType: pulumi.String("ManagedKubernetes"),
})
if err != nil {
return err
}
defaultEnvServiceMonitor, err := arms.NewEnvServiceMonitor(ctx, "default", &arms.EnvServiceMonitorArgs{
AliyunLang: pulumi.String("en"),
EnvironmentId: defaultEnvironment.ID(),
ConfigYaml: pulumi.String(`apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: arms-admin1
namespace: arms-prom
annotations:
arms.prometheus.io/discovery: 'true'
o11y.aliyun.com/addon-name: mysql
o11y.aliyun.com/addon-version: 1.0.1
o11y.aliyun.com/release-name: mysql1
spec:
endpoints:
- interval: 30s
port: operator
path: /metrics
- interval: 10s
port: operator1
path: /metrics
namespaceSelector:
any: true
selector:
matchLabels:
app: arms-prometheus-ack-arms-prometheus
`),
})
if err != nil {
return err
}
ids := arms.GetEnvServiceMonitorsOutput(ctx, arms.GetEnvServiceMonitorsOutputArgs{
EnvironmentId: defaultEnvServiceMonitor.EnvironmentId,
Ids: pulumi.StringArray{
defaultEnvServiceMonitor.ID(),
},
}, nil);
ctx.Export("armsEnvServiceMonitorsId0", ids.ApplyT(func(ids arms.GetEnvServiceMonitorsResult) (*string, error) {
return &ids.Monitors[0].Id, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var defaultInteger = new Random.Index.Integer("default", new()
{
Min = 10000,
Max = 99999,
});
var enhanced = AliCloud.Vpc.GetEnhancedNatAvailableZones.Invoke();
var vpc = new AliCloud.Vpc.Network("vpc", new()
{
Description = "api-resource-test1-hz",
CidrBlock = "192.168.0.0/16",
VpcName = $"{name}-{defaultInteger.Result}",
});
var vswitch = new AliCloud.Vpc.Switch("vswitch", new()
{
Description = "api-resource-test1-hz",
VpcId = vpc.Id,
VswitchName = $"{name}-{defaultInteger.Result}",
ZoneId = enhanced.Apply(getEnhancedNatAvailableZonesResult => getEnhancedNatAvailableZonesResult.Zones[0]?.ZoneId),
CidrBlock = vpc.CidrBlock.Apply(cidrBlock => Std.Cidrsubnet.Invoke(new()
{
Input = cidrBlock,
Newbits = 8,
Netnum = 8,
})).Apply(invoke => invoke.Result),
});
var defaultSnapshotPolicy = new AliCloud.Ecs.SnapshotPolicy("default", new()
{
Name = $"{name}-{defaultInteger.Result}",
RepeatWeekdays = new[]
{
"1",
"2",
"3",
},
RetentionDays = -1,
TimePoints = new[]
{
"1",
"22",
"23",
},
});
var @default = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
{
AvailabilityZone = vswitch.ZoneId,
CpuCoreCount = 2,
MemorySize = 4,
KubernetesNodeRole = "Worker",
InstanceTypeFamily = "ecs.sn1ne",
});
var defaultManagedKubernetes = new AliCloud.CS.ManagedKubernetes("default", new()
{
Name = $"{name}-{defaultInteger.Result}",
ClusterSpec = "ack.pro.small",
Version = "1.24.6-aliyun.1",
NewNatGateway = true,
NodeCidrMask = 26,
ProxyMode = "ipvs",
ServiceCidr = "172.23.0.0/16",
PodCidr = "10.95.0.0/16",
WorkerVswitchIds = new[]
{
vswitch.Id,
},
});
var defaultKeyPair = new AliCloud.Ecs.KeyPair("default", new()
{
KeyPairName = $"{name}-{defaultInteger.Result}",
});
var defaultNodePool = new AliCloud.CS.NodePool("default", new()
{
Name = "desired_size",
ClusterId = defaultManagedKubernetes.Id,
VswitchIds = new[]
{
vswitch.Id,
},
InstanceTypes = new[]
{
@default.Apply(@default => @default.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id)),
},
SystemDiskCategory = "cloud_efficiency",
SystemDiskSize = 40,
KeyName = defaultKeyPair.KeyPairName,
DesiredSize = "2",
});
var defaultEnvironment = new AliCloud.Arms.Environment("default", new()
{
EnvironmentType = "CS",
EnvironmentName = $"{name}-{defaultInteger.Result}",
BindResourceId = defaultNodePool.ClusterId,
EnvironmentSubType = "ManagedKubernetes",
});
var defaultEnvServiceMonitor = new AliCloud.Arms.EnvServiceMonitor("default", new()
{
AliyunLang = "en",
EnvironmentId = defaultEnvironment.Id,
ConfigYaml = @"apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: arms-admin1
namespace: arms-prom
annotations:
arms.prometheus.io/discovery: 'true'
o11y.aliyun.com/addon-name: mysql
o11y.aliyun.com/addon-version: 1.0.1
o11y.aliyun.com/release-name: mysql1
spec:
endpoints:
- interval: 30s
port: operator
path: /metrics
- interval: 10s
port: operator1
path: /metrics
namespaceSelector:
any: true
selector:
matchLabels:
app: arms-prometheus-ack-arms-prometheus
",
});
var ids = AliCloud.Arms.GetEnvServiceMonitors.Invoke(new()
{
EnvironmentId = defaultEnvServiceMonitor.EnvironmentId,
Ids = new[]
{
defaultEnvServiceMonitor.Id,
},
});
return new Dictionary<string, object?>
{
["armsEnvServiceMonitorsId0"] = ids.Apply(getEnvServiceMonitorsResult => getEnvServiceMonitorsResult.Monitors[0]?.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.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetEnhancedNatAvailableZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.CidrsubnetArgs;
import com.pulumi.alicloud.ecs.SnapshotPolicy;
import com.pulumi.alicloud.ecs.SnapshotPolicyArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.cs.ManagedKubernetes;
import com.pulumi.alicloud.cs.ManagedKubernetesArgs;
import com.pulumi.alicloud.ecs.KeyPair;
import com.pulumi.alicloud.ecs.KeyPairArgs;
import com.pulumi.alicloud.cs.NodePool;
import com.pulumi.alicloud.cs.NodePoolArgs;
import com.pulumi.alicloud.arms.Environment;
import com.pulumi.alicloud.arms.EnvironmentArgs;
import com.pulumi.alicloud.arms.EnvServiceMonitor;
import com.pulumi.alicloud.arms.EnvServiceMonitorArgs;
import com.pulumi.alicloud.arms.ArmsFunctions;
import com.pulumi.alicloud.arms.inputs.GetEnvServiceMonitorsArgs;
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 defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
.min(10000)
.max(99999)
.build());
final var enhanced = VpcFunctions.getEnhancedNatAvailableZones(GetEnhancedNatAvailableZonesArgs.builder()
.build());
var vpc = new Network("vpc", NetworkArgs.builder()
.description("api-resource-test1-hz")
.cidrBlock("192.168.0.0/16")
.vpcName(String.format("%s-%s", name,defaultInteger.result()))
.build());
var vswitch = new Switch("vswitch", SwitchArgs.builder()
.description("api-resource-test1-hz")
.vpcId(vpc.id())
.vswitchName(String.format("%s-%s", name,defaultInteger.result()))
.zoneId(enhanced.zones()[0].zoneId())
.cidrBlock(vpc.cidrBlock().applyValue(_cidrBlock -> StdFunctions.cidrsubnet(CidrsubnetArgs.builder()
.input(_cidrBlock)
.newbits(8)
.netnum(8)
.build())).applyValue(_invoke -> _invoke.result()))
.build());
var defaultSnapshotPolicy = new SnapshotPolicy("defaultSnapshotPolicy", SnapshotPolicyArgs.builder()
.name(String.format("%s-%s", name,defaultInteger.result()))
.repeatWeekdays(
"1",
"2",
"3")
.retentionDays(-1)
.timePoints(
"1",
"22",
"23")
.build());
final var default = vswitch.zoneId().applyValue(_zoneId -> EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.availabilityZone(_zoneId)
.cpuCoreCount(2)
.memorySize(4)
.kubernetesNodeRole("Worker")
.instanceTypeFamily("ecs.sn1ne")
.build()));
var defaultManagedKubernetes = new ManagedKubernetes("defaultManagedKubernetes", ManagedKubernetesArgs.builder()
.name(String.format("%s-%s", name,defaultInteger.result()))
.clusterSpec("ack.pro.small")
.version("1.24.6-aliyun.1")
.newNatGateway(true)
.nodeCidrMask(26)
.proxyMode("ipvs")
.serviceCidr("172.23.0.0/16")
.podCidr("10.95.0.0/16")
.workerVswitchIds(vswitch.id())
.build());
var defaultKeyPair = new KeyPair("defaultKeyPair", KeyPairArgs.builder()
.keyPairName(String.format("%s-%s", name,defaultInteger.result()))
.build());
var defaultNodePool = new NodePool("defaultNodePool", NodePoolArgs.builder()
.name("desired_size")
.clusterId(defaultManagedKubernetes.id())
.vswitchIds(vswitch.id())
.instanceTypes(default_.applyValue(_default_ -> _default_.instanceTypes()[0].id()))
.systemDiskCategory("cloud_efficiency")
.systemDiskSize(40)
.keyName(defaultKeyPair.keyPairName())
.desiredSize("2")
.build());
var defaultEnvironment = new Environment("defaultEnvironment", EnvironmentArgs.builder()
.environmentType("CS")
.environmentName(String.format("%s-%s", name,defaultInteger.result()))
.bindResourceId(defaultNodePool.clusterId())
.environmentSubType("ManagedKubernetes")
.build());
var defaultEnvServiceMonitor = new EnvServiceMonitor("defaultEnvServiceMonitor", EnvServiceMonitorArgs.builder()
.aliyunLang("en")
.environmentId(defaultEnvironment.id())
.configYaml("""
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: arms-admin1
namespace: arms-prom
annotations:
arms.prometheus.io/discovery: 'true'
o11y.aliyun.com/addon-name: mysql
o11y.aliyun.com/addon-version: 1.0.1
o11y.aliyun.com/release-name: mysql1
spec:
endpoints:
- interval: 30s
port: operator
path: /metrics
- interval: 10s
port: operator1
path: /metrics
namespaceSelector:
any: true
selector:
matchLabels:
app: arms-prometheus-ack-arms-prometheus
""")
.build());
final var ids = ArmsFunctions.getEnvServiceMonitors(GetEnvServiceMonitorsArgs.builder()
.environmentId(defaultEnvServiceMonitor.environmentId())
.ids(defaultEnvServiceMonitor.id())
.build());
ctx.export("armsEnvServiceMonitorsId0", ids.applyValue(_ids -> _ids.monitors()[0].id()));
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultInteger:
type: random:Integer
name: default
properties:
min: 10000
max: 99999
vpc:
type: alicloud:vpc:Network
properties:
description: api-resource-test1-hz
cidrBlock: 192.168.0.0/16
vpcName: ${name}-${defaultInteger.result}
vswitch:
type: alicloud:vpc:Switch
properties:
description: api-resource-test1-hz
vpcId: ${vpc.id}
vswitchName: ${name}-${defaultInteger.result}
zoneId: ${enhanced.zones[0].zoneId}
cidrBlock:
fn::invoke:
function: std:cidrsubnet
arguments:
input: ${vpc.cidrBlock}
newbits: 8
netnum: 8
return: result
defaultSnapshotPolicy:
type: alicloud:ecs:SnapshotPolicy
name: default
properties:
name: ${name}-${defaultInteger.result}
repeatWeekdays:
- '1'
- '2'
- '3'
retentionDays: -1
timePoints:
- '1'
- '22'
- '23'
defaultManagedKubernetes:
type: alicloud:cs:ManagedKubernetes
name: default
properties:
name: ${name}-${defaultInteger.result}
clusterSpec: ack.pro.small
version: 1.24.6-aliyun.1
newNatGateway: true
nodeCidrMask: 26
proxyMode: ipvs
serviceCidr: 172.23.0.0/16
podCidr: 10.95.0.0/16
workerVswitchIds:
- ${vswitch.id}
defaultKeyPair:
type: alicloud:ecs:KeyPair
name: default
properties:
keyPairName: ${name}-${defaultInteger.result}
defaultNodePool:
type: alicloud:cs:NodePool
name: default
properties:
name: desired_size
clusterId: ${defaultManagedKubernetes.id}
vswitchIds:
- ${vswitch.id}
instanceTypes:
- ${default.instanceTypes[0].id}
systemDiskCategory: cloud_efficiency
systemDiskSize: 40
keyName: ${defaultKeyPair.keyPairName}
desiredSize: 2
defaultEnvironment:
type: alicloud:arms:Environment
name: default
properties:
environmentType: CS
environmentName: ${name}-${defaultInteger.result}
bindResourceId: ${defaultNodePool.clusterId}
environmentSubType: ManagedKubernetes
defaultEnvServiceMonitor:
type: alicloud:arms:EnvServiceMonitor
name: default
properties:
aliyunLang: en
environmentId: ${defaultEnvironment.id}
configYaml: |
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: arms-admin1
namespace: arms-prom
annotations:
arms.prometheus.io/discovery: 'true'
o11y.aliyun.com/addon-name: mysql
o11y.aliyun.com/addon-version: 1.0.1
o11y.aliyun.com/release-name: mysql1
spec:
endpoints:
- interval: 30s
port: operator
path: /metrics
- interval: 10s
port: operator1
path: /metrics
namespaceSelector:
any: true
selector:
matchLabels:
app: arms-prometheus-ack-arms-prometheus
variables:
enhanced:
fn::invoke:
function: alicloud:vpc:getEnhancedNatAvailableZones
arguments: {}
default:
fn::invoke:
function: alicloud:ecs:getInstanceTypes
arguments:
availabilityZone: ${vswitch.zoneId}
cpuCoreCount: 2
memorySize: 4
kubernetesNodeRole: Worker
instanceTypeFamily: ecs.sn1ne
ids:
fn::invoke:
function: alicloud:arms:getEnvServiceMonitors
arguments:
environmentId: ${defaultEnvServiceMonitor.environmentId}
ids:
- ${defaultEnvServiceMonitor.id}
outputs:
armsEnvServiceMonitorsId0: ${ids.monitors[0].id}
Using getEnvServiceMonitors
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getEnvServiceMonitors(args: GetEnvServiceMonitorsArgs, opts?: InvokeOptions): Promise<GetEnvServiceMonitorsResult>
function getEnvServiceMonitorsOutput(args: GetEnvServiceMonitorsOutputArgs, opts?: InvokeOptions): Output<GetEnvServiceMonitorsResult>
def get_env_service_monitors(environment_id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetEnvServiceMonitorsResult
def get_env_service_monitors_output(environment_id: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetEnvServiceMonitorsResult]
func GetEnvServiceMonitors(ctx *Context, args *GetEnvServiceMonitorsArgs, opts ...InvokeOption) (*GetEnvServiceMonitorsResult, error)
func GetEnvServiceMonitorsOutput(ctx *Context, args *GetEnvServiceMonitorsOutputArgs, opts ...InvokeOption) GetEnvServiceMonitorsResultOutput
> Note: This function is named GetEnvServiceMonitors
in the Go SDK.
public static class GetEnvServiceMonitors
{
public static Task<GetEnvServiceMonitorsResult> InvokeAsync(GetEnvServiceMonitorsArgs args, InvokeOptions? opts = null)
public static Output<GetEnvServiceMonitorsResult> Invoke(GetEnvServiceMonitorsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetEnvServiceMonitorsResult> getEnvServiceMonitors(GetEnvServiceMonitorsArgs args, InvokeOptions options)
public static Output<GetEnvServiceMonitorsResult> getEnvServiceMonitors(GetEnvServiceMonitorsArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:arms/getEnvServiceMonitors:getEnvServiceMonitors
arguments:
# arguments dictionary
The following arguments are supported:
- Environment
Id string - The environment ID.
- Ids List<string>
- A list of ARMS Env Service Monitor IDs.
- Name
Regex string - A regex string to filter results by ARMS Env Service Monitor name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Environment
Id string - The environment ID.
- Ids []string
- A list of ARMS Env Service Monitor IDs.
- Name
Regex string - A regex string to filter results by ARMS Env Service Monitor name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- environment
Id String - The environment ID.
- ids List<String>
- A list of ARMS Env Service Monitor IDs.
- name
Regex String - A regex string to filter results by ARMS Env Service Monitor name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- environment
Id string - The environment ID.
- ids string[]
- A list of ARMS Env Service Monitor IDs.
- name
Regex string - A regex string to filter results by ARMS Env Service Monitor name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- environment_
id str - The environment ID.
- ids Sequence[str]
- A list of ARMS Env Service Monitor IDs.
- name_
regex str - A regex string to filter results by ARMS Env Service Monitor name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- environment
Id String - The environment ID.
- ids List<String>
- A list of ARMS Env Service Monitor IDs.
- name
Regex String - A regex string to filter results by ARMS Env Service Monitor name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getEnvServiceMonitors Result
The following output properties are available:
- Environment
Id string - The environment ID.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Monitors
List<Pulumi.
Ali Cloud. Arms. Outputs. Get Env Service Monitors Monitor> - A list of ARMS Env Service Monitors. Each element contains the following attributes:
- Names List<string>
- A list of ARMS Env Service Monitor names.
- Name
Regex string - Output
File string
- Environment
Id string - The environment ID.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Monitors
[]Get
Env Service Monitors Monitor - A list of ARMS Env Service Monitors. Each element contains the following attributes:
- Names []string
- A list of ARMS Env Service Monitor names.
- Name
Regex string - Output
File string
- environment
Id String - The environment ID.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- monitors
List<Get
Env Service Monitors Monitor> - A list of ARMS Env Service Monitors. Each element contains the following attributes:
- names List<String>
- A list of ARMS Env Service Monitor names.
- name
Regex String - output
File String
- environment
Id string - The environment ID.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- monitors
Get
Env Service Monitors Monitor[] - A list of ARMS Env Service Monitors. Each element contains the following attributes:
- names string[]
- A list of ARMS Env Service Monitor names.
- name
Regex string - output
File string
- environment_
id str - The environment ID.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- monitors
Sequence[Get
Env Service Monitors Monitor] - A list of ARMS Env Service Monitors. Each element contains the following attributes:
- names Sequence[str]
- A list of ARMS Env Service Monitor names.
- name_
regex str - output_
file str
- environment
Id String - The environment ID.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- monitors List<Property Map>
- A list of ARMS Env Service Monitors. Each element contains the following attributes:
- names List<String>
- A list of ARMS Env Service Monitor names.
- name
Regex String - output
File String
Supporting Types
GetEnvServiceMonitorsMonitor
- Config
Yaml string - The YAML configuration string.
- Env
Service stringMonitor Name - The name of the ServiceMonitor.
- Environment
Id string - The environment ID.
- Id string
- The ID of the ServiceMonitor. It formats as
<environment_id>:<namespace>:<env_service_monitor_name>
. - Namespace string
- The namespace.
- Region
Id string - The region ID.
- Status string
- The status of the ServiceMonitor.
- Config
Yaml string - The YAML configuration string.
- Env
Service stringMonitor Name - The name of the ServiceMonitor.
- Environment
Id string - The environment ID.
- Id string
- The ID of the ServiceMonitor. It formats as
<environment_id>:<namespace>:<env_service_monitor_name>
. - Namespace string
- The namespace.
- Region
Id string - The region ID.
- Status string
- The status of the ServiceMonitor.
- config
Yaml String - The YAML configuration string.
- env
Service StringMonitor Name - The name of the ServiceMonitor.
- environment
Id String - The environment ID.
- id String
- The ID of the ServiceMonitor. It formats as
<environment_id>:<namespace>:<env_service_monitor_name>
. - namespace String
- The namespace.
- region
Id String - The region ID.
- status String
- The status of the ServiceMonitor.
- config
Yaml string - The YAML configuration string.
- env
Service stringMonitor Name - The name of the ServiceMonitor.
- environment
Id string - The environment ID.
- id string
- The ID of the ServiceMonitor. It formats as
<environment_id>:<namespace>:<env_service_monitor_name>
. - namespace string
- The namespace.
- region
Id string - The region ID.
- status string
- The status of the ServiceMonitor.
- config_
yaml str - The YAML configuration string.
- env_
service_ strmonitor_ name - The name of the ServiceMonitor.
- environment_
id str - The environment ID.
- id str
- The ID of the ServiceMonitor. It formats as
<environment_id>:<namespace>:<env_service_monitor_name>
. - namespace str
- The namespace.
- region_
id str - The region ID.
- status str
- The status of the ServiceMonitor.
- config
Yaml String - The YAML configuration string.
- env
Service StringMonitor Name - The name of the ServiceMonitor.
- environment
Id String - The environment ID.
- id String
- The ID of the ServiceMonitor. It formats as
<environment_id>:<namespace>:<env_service_monitor_name>
. - namespace String
- The namespace.
- region
Id String - The region ID.
- status String
- The status of the ServiceMonitor.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.