alicloud.cloudmonitor.ServiceMonitoringAgentProcess
Explore with Pulumi AI
Provides a Cloud Monitor Service Monitoring Agent Process resource.
For information about Cloud Monitor Service Monitoring Agent Process and how to use it, see What is Monitoring Agent Process.
NOTE: Available since v1.212.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = alicloud.getZones({
availableDiskCategory: "cloud_efficiency",
availableResourceCreation: "VSwitch",
});
const defaultGetInstanceTypes = _default.then(_default => alicloud.ecs.getInstanceTypes({
availabilityZone: _default.zones?.[0]?.id,
instanceTypeFamily: "ecs.sn1ne",
}));
const defaultGetImages = alicloud.ecs.getImages({
nameRegex: "^ubuntu_18.*64",
mostRecent: true,
owners: "system",
});
const defaultNetwork = new alicloud.vpc.Network("default", {
vpcName: name,
cidrBlock: "172.16.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
vpcId: defaultNetwork.id,
cidrBlock: "172.16.0.0/24",
zoneId: _default.then(_default => _default.zones?.[0]?.id),
vswitchName: name,
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
name: name,
vpcId: defaultSwitch.vpcId,
});
const defaultInstance = new alicloud.ecs.Instance("default", {
imageId: defaultGetImages.then(defaultGetImages => defaultGetImages.images?.[0]?.id),
instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.id),
instanceName: name,
securityGroups: [defaultSecurityGroup].map(__item => __item.id),
internetChargeType: "PayByTraffic",
internetMaxBandwidthOut: 10,
availabilityZone: _default.then(_default => _default.zones?.[0]?.id),
instanceChargeType: "PostPaid",
systemDiskCategory: "cloud_efficiency",
vswitchId: defaultSwitch.id,
});
const defaultServiceMonitoringAgentProcess = new alicloud.cloudmonitor.ServiceMonitoringAgentProcess("default", {
instanceId: defaultInstance.id,
processName: name,
processUser: "root",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.get_zones(available_disk_category="cloud_efficiency",
available_resource_creation="VSwitch")
default_get_instance_types = alicloud.ecs.get_instance_types(availability_zone=default.zones[0].id,
instance_type_family="ecs.sn1ne")
default_get_images = alicloud.ecs.get_images(name_regex="^ubuntu_18.*64",
most_recent=True,
owners="system")
default_network = alicloud.vpc.Network("default",
vpc_name=name,
cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("default",
vpc_id=default_network.id,
cidr_block="172.16.0.0/24",
zone_id=default.zones[0].id,
vswitch_name=name)
default_security_group = alicloud.ecs.SecurityGroup("default",
name=name,
vpc_id=default_switch.vpc_id)
default_instance = alicloud.ecs.Instance("default",
image_id=default_get_images.images[0].id,
instance_type=default_get_instance_types.instance_types[0].id,
instance_name=name,
security_groups=[__item.id for __item in [default_security_group]],
internet_charge_type="PayByTraffic",
internet_max_bandwidth_out=10,
availability_zone=default.zones[0].id,
instance_charge_type="PostPaid",
system_disk_category="cloud_efficiency",
vswitch_id=default_switch.id)
default_service_monitoring_agent_process = alicloud.cloudmonitor.ServiceMonitoringAgentProcess("default",
instance_id=default_instance.id,
process_name=name,
process_user="root")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudmonitor"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"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 := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableDiskCategory: pulumi.StringRef("cloud_efficiency"),
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil);
if err != nil {
return err
}
defaultGetInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
AvailabilityZone: pulumi.StringRef(_default.Zones[0].Id),
InstanceTypeFamily: pulumi.StringRef("ecs.sn1ne"),
}, nil);
if err != nil {
return err
}
defaultGetImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
NameRegex: pulumi.StringRef("^ubuntu_18.*64"),
MostRecent: pulumi.BoolRef(true),
Owners: pulumi.StringRef("system"),
}, nil);
if err != nil {
return err
}
defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("172.16.0.0/16"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VpcId: defaultNetwork.ID(),
CidrBlock: pulumi.String("172.16.0.0/24"),
ZoneId: pulumi.String(_default.Zones[0].Id),
VswitchName: pulumi.String(name),
})
if err != nil {
return err
}
defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
Name: pulumi.String(name),
VpcId: defaultSwitch.VpcId,
})
if err != nil {
return err
}
var splat0 pulumi.StringArray
for _, val0 := range %!v(PANIC=Format method: fatal: An assertion has failed: tok: ) {
splat0 = append(splat0, val0.ID())
}
defaultInstance, err := ecs.NewInstance(ctx, "default", &ecs.InstanceArgs{
ImageId: pulumi.String(defaultGetImages.Images[0].Id),
InstanceType: pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].Id),
InstanceName: pulumi.String(name),
SecurityGroups: splat0,
InternetChargeType: pulumi.String("PayByTraffic"),
InternetMaxBandwidthOut: pulumi.Int(10),
AvailabilityZone: pulumi.String(_default.Zones[0].Id),
InstanceChargeType: pulumi.String("PostPaid"),
SystemDiskCategory: pulumi.String("cloud_efficiency"),
VswitchId: defaultSwitch.ID(),
})
if err != nil {
return err
}
_, err = cloudmonitor.NewServiceMonitoringAgentProcess(ctx, "default", &cloudmonitor.ServiceMonitoringAgentProcessArgs{
InstanceId: defaultInstance.ID(),
ProcessName: pulumi.String(name),
ProcessUser: pulumi.String("root"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = AliCloud.GetZones.Invoke(new()
{
AvailableDiskCategory = "cloud_efficiency",
AvailableResourceCreation = "VSwitch",
});
var defaultGetInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
{
AvailabilityZone = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
InstanceTypeFamily = "ecs.sn1ne",
});
var defaultGetImages = AliCloud.Ecs.GetImages.Invoke(new()
{
NameRegex = "^ubuntu_18.*64",
MostRecent = true,
Owners = "system",
});
var defaultNetwork = new AliCloud.Vpc.Network("default", new()
{
VpcName = name,
CidrBlock = "172.16.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
VpcId = defaultNetwork.Id,
CidrBlock = "172.16.0.0/24",
ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
VswitchName = name,
});
var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
{
Name = name,
VpcId = defaultSwitch.VpcId,
});
var defaultInstance = new AliCloud.Ecs.Instance("default", new()
{
ImageId = defaultGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
InstanceName = name,
SecurityGroups = new[]
{
defaultSecurityGroup,
}.Select(__item => __item.Id).ToList(),
InternetChargeType = "PayByTraffic",
InternetMaxBandwidthOut = 10,
AvailabilityZone = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
InstanceChargeType = "PostPaid",
SystemDiskCategory = "cloud_efficiency",
VswitchId = defaultSwitch.Id,
});
var defaultServiceMonitoringAgentProcess = new AliCloud.CloudMonitor.ServiceMonitoringAgentProcess("default", new()
{
InstanceId = defaultInstance.Id,
ProcessName = name,
ProcessUser = "root",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
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.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import com.pulumi.alicloud.cloudmonitor.ServiceMonitoringAgentProcess;
import com.pulumi.alicloud.cloudmonitor.ServiceMonitoringAgentProcessArgs;
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");
final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableDiskCategory("cloud_efficiency")
.availableResourceCreation("VSwitch")
.build());
final var defaultGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.availabilityZone(default_.zones()[0].id())
.instanceTypeFamily("ecs.sn1ne")
.build());
final var defaultGetImages = EcsFunctions.getImages(GetImagesArgs.builder()
.nameRegex("^ubuntu_18.*64")
.mostRecent(true)
.owners("system")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("172.16.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vpcId(defaultNetwork.id())
.cidrBlock("172.16.0.0/24")
.zoneId(default_.zones()[0].id())
.vswitchName(name)
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.name(name)
.vpcId(defaultSwitch.vpcId())
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
.instanceName(name)
.securityGroups(defaultSecurityGroup.stream().map(element -> element.id()).collect(toList()))
.internetChargeType("PayByTraffic")
.internetMaxBandwidthOut("10")
.availabilityZone(default_.zones()[0].id())
.instanceChargeType("PostPaid")
.systemDiskCategory("cloud_efficiency")
.vswitchId(defaultSwitch.id())
.build());
var defaultServiceMonitoringAgentProcess = new ServiceMonitoringAgentProcess("defaultServiceMonitoringAgentProcess", ServiceMonitoringAgentProcessArgs.builder()
.instanceId(defaultInstance.id())
.processName(name)
.processUser("root")
.build());
}
}
Coming soon!
Create ServiceMonitoringAgentProcess Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServiceMonitoringAgentProcess(name: string, args: ServiceMonitoringAgentProcessArgs, opts?: CustomResourceOptions);
@overload
def ServiceMonitoringAgentProcess(resource_name: str,
args: ServiceMonitoringAgentProcessArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServiceMonitoringAgentProcess(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
process_name: Optional[str] = None,
process_user: Optional[str] = None)
func NewServiceMonitoringAgentProcess(ctx *Context, name string, args ServiceMonitoringAgentProcessArgs, opts ...ResourceOption) (*ServiceMonitoringAgentProcess, error)
public ServiceMonitoringAgentProcess(string name, ServiceMonitoringAgentProcessArgs args, CustomResourceOptions? opts = null)
public ServiceMonitoringAgentProcess(String name, ServiceMonitoringAgentProcessArgs args)
public ServiceMonitoringAgentProcess(String name, ServiceMonitoringAgentProcessArgs args, CustomResourceOptions options)
type: alicloud:cloudmonitor:ServiceMonitoringAgentProcess
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name
This property is required. string - The unique name of the resource.
- args
This property is required. ServiceMonitoringAgentProcessArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name
This property is required. str - The unique name of the resource.
- args
This property is required. ServiceMonitoringAgentProcessArgs - The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name
This property is required. string - The unique name of the resource.
- args
This property is required. ServiceMonitoringAgentProcessArgs - The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name
This property is required. string - The unique name of the resource.
- args
This property is required. ServiceMonitoringAgentProcessArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name
This property is required. String - The unique name of the resource.
- args
This property is required. ServiceMonitoringAgentProcessArgs - 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 serviceMonitoringAgentProcessResource = new AliCloud.CloudMonitor.ServiceMonitoringAgentProcess("serviceMonitoringAgentProcessResource", new()
{
InstanceId = "string",
ProcessName = "string",
ProcessUser = "string",
});
example, err := cloudmonitor.NewServiceMonitoringAgentProcess(ctx, "serviceMonitoringAgentProcessResource", &cloudmonitor.ServiceMonitoringAgentProcessArgs{
InstanceId: pulumi.String("string"),
ProcessName: pulumi.String("string"),
ProcessUser: pulumi.String("string"),
})
var serviceMonitoringAgentProcessResource = new ServiceMonitoringAgentProcess("serviceMonitoringAgentProcessResource", ServiceMonitoringAgentProcessArgs.builder()
.instanceId("string")
.processName("string")
.processUser("string")
.build());
service_monitoring_agent_process_resource = alicloud.cloudmonitor.ServiceMonitoringAgentProcess("serviceMonitoringAgentProcessResource",
instance_id="string",
process_name="string",
process_user="string")
const serviceMonitoringAgentProcessResource = new alicloud.cloudmonitor.ServiceMonitoringAgentProcess("serviceMonitoringAgentProcessResource", {
instanceId: "string",
processName: "string",
processUser: "string",
});
type: alicloud:cloudmonitor:ServiceMonitoringAgentProcess
properties:
instanceId: string
processName: string
processUser: string
ServiceMonitoringAgentProcess 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 ServiceMonitoringAgentProcess resource accepts the following input properties:
- Instance
Id This property is required. Changes to this property will trigger replacement.
- The ID of the instance.
- Process
Name This property is required. Changes to this property will trigger replacement.
- The name of the process.
- Process
User Changes to this property will trigger replacement.
- The user who launches the process.
- Instance
Id This property is required. Changes to this property will trigger replacement.
- The ID of the instance.
- Process
Name This property is required. Changes to this property will trigger replacement.
- The name of the process.
- Process
User Changes to this property will trigger replacement.
- The user who launches the process.
- instance
Id This property is required. Changes to this property will trigger replacement.
- The ID of the instance.
- process
Name This property is required. Changes to this property will trigger replacement.
- The name of the process.
- process
User Changes to this property will trigger replacement.
- The user who launches the process.
- instance
Id This property is required. Changes to this property will trigger replacement.
- The ID of the instance.
- process
Name This property is required. Changes to this property will trigger replacement.
- The name of the process.
- process
User Changes to this property will trigger replacement.
- The user who launches the process.
- instance_
id This property is required. Changes to this property will trigger replacement.
- The ID of the instance.
- process_
name This property is required. Changes to this property will trigger replacement.
- The name of the process.
- process_
user Changes to this property will trigger replacement.
- The user who launches the process.
- instance
Id This property is required. Changes to this property will trigger replacement.
- The ID of the instance.
- process
Name This property is required. Changes to this property will trigger replacement.
- The name of the process.
- process
User Changes to this property will trigger replacement.
- The user who launches the process.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServiceMonitoringAgentProcess resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- process_
id str - The ID of the process.
Look up Existing ServiceMonitoringAgentProcess Resource
Get an existing ServiceMonitoringAgentProcess 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?: ServiceMonitoringAgentProcessState, opts?: CustomResourceOptions): ServiceMonitoringAgentProcess
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
process_id: Optional[str] = None,
process_name: Optional[str] = None,
process_user: Optional[str] = None) -> ServiceMonitoringAgentProcess
func GetServiceMonitoringAgentProcess(ctx *Context, name string, id IDInput, state *ServiceMonitoringAgentProcessState, opts ...ResourceOption) (*ServiceMonitoringAgentProcess, error)
public static ServiceMonitoringAgentProcess Get(string name, Input<string> id, ServiceMonitoringAgentProcessState? state, CustomResourceOptions? opts = null)
public static ServiceMonitoringAgentProcess get(String name, Output<String> id, ServiceMonitoringAgentProcessState state, CustomResourceOptions options)
resources: _: type: alicloud:cloudmonitor:ServiceMonitoringAgentProcess get: id: ${id}
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - The unique provider ID of the resource to lookup.
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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.
- Instance
Id Changes to this property will trigger replacement.
- The ID of the instance.
- Process
Id string - The ID of the process.
- Process
Name Changes to this property will trigger replacement.
- The name of the process.
- Process
User Changes to this property will trigger replacement.
- The user who launches the process.
- Instance
Id Changes to this property will trigger replacement.
- The ID of the instance.
- Process
Id string - The ID of the process.
- Process
Name Changes to this property will trigger replacement.
- The name of the process.
- Process
User Changes to this property will trigger replacement.
- The user who launches the process.
- instance
Id Changes to this property will trigger replacement.
- The ID of the instance.
- process
Id String - The ID of the process.
- process
Name Changes to this property will trigger replacement.
- The name of the process.
- process
User Changes to this property will trigger replacement.
- The user who launches the process.
- instance
Id Changes to this property will trigger replacement.
- The ID of the instance.
- process
Id string - The ID of the process.
- process
Name Changes to this property will trigger replacement.
- The name of the process.
- process
User Changes to this property will trigger replacement.
- The user who launches the process.
- instance_
id Changes to this property will trigger replacement.
- The ID of the instance.
- process_
id str - The ID of the process.
- process_
name Changes to this property will trigger replacement.
- The name of the process.
- process_
user Changes to this property will trigger replacement.
- The user who launches the process.
- instance
Id Changes to this property will trigger replacement.
- The ID of the instance.
- process
Id String - The ID of the process.
- process
Name Changes to this property will trigger replacement.
- The name of the process.
- process
User Changes to this property will trigger replacement.
- The user who launches the process.
Import
Cloud Monitor Service Monitoring Agent Process can be imported using the id, e.g.
$ pulumi import alicloud:cloudmonitor/serviceMonitoringAgentProcess:ServiceMonitoringAgentProcess example <instance_id>:<process_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
alicloud
Terraform Provider.