ibm.ComputeMonitor
Explore with Pulumi AI
Create, update, or delete a monitor for your virtual server instance. With monitors, you can verify the health of your virtual server instance by sending ping requests to the instance and checking the responsiveness of your instance. For more information, about compute monitor resource, see viewing and managing monitors.
Note
For more information, see IBM Cloud Classic Infrastructure (SoftLayer) API docs.
Example Usage
In the following example, you can create a monitor:
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const testMonitor = new ibm.ComputeMonitor("testMonitor", {
guestId: ibm_compute_vm_instance.test_server.id,
ipAddress: ibm_compute_vm_instance.test_server.id.ipv4_address,
queryTypeId: 1,
responseActionId: 1,
waitCycles: 5,
notifiedUsers: [460547],
});
import pulumi
import pulumi_ibm as ibm
test_monitor = ibm.ComputeMonitor("testMonitor",
guest_id=ibm_compute_vm_instance["test_server"]["id"],
ip_address=ibm_compute_vm_instance["test_server"]["id"]["ipv4_address"],
query_type_id=1,
response_action_id=1,
wait_cycles=5,
notified_users=[460547])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.NewComputeMonitor(ctx, "testMonitor", &ibm.ComputeMonitorArgs{
GuestId: pulumi.Any(ibm_compute_vm_instance.Test_server.Id),
IpAddress: pulumi.Any(ibm_compute_vm_instance.Test_server.Id.Ipv4_address),
QueryTypeId: pulumi.Float64(1),
ResponseActionId: pulumi.Float64(1),
WaitCycles: pulumi.Float64(5),
NotifiedUsers: pulumi.Float64Array{
pulumi.Float64(460547),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var testMonitor = new Ibm.ComputeMonitor("testMonitor", new()
{
GuestId = ibm_compute_vm_instance.Test_server.Id,
IpAddress = ibm_compute_vm_instance.Test_server.Id.Ipv4_address,
QueryTypeId = 1,
ResponseActionId = 1,
WaitCycles = 5,
NotifiedUsers = new[]
{
460547,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.ComputeMonitor;
import com.pulumi.ibm.ComputeMonitorArgs;
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 testMonitor = new ComputeMonitor("testMonitor", ComputeMonitorArgs.builder()
.guestId(ibm_compute_vm_instance.test_server().id())
.ipAddress(ibm_compute_vm_instance.test_server().id().ipv4_address())
.queryTypeId(1)
.responseActionId(1)
.waitCycles(5)
.notifiedUsers(460547)
.build());
}
}
resources:
testMonitor:
type: ibm:ComputeMonitor
properties:
guestId: ${ibm_compute_vm_instance.test_server.id}
ipAddress: ${ibm_compute_vm_instance.test_server.id.ipv4_address}
queryTypeId: 1
responseActionId: 1
waitCycles: 5
notifiedUsers:
- 460547
Create ComputeMonitor Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ComputeMonitor(name: string, args: ComputeMonitorArgs, opts?: CustomResourceOptions);
@overload
def ComputeMonitor(resource_name: str,
args: ComputeMonitorArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ComputeMonitor(resource_name: str,
opts: Optional[ResourceOptions] = None,
guest_id: Optional[float] = None,
query_type_id: Optional[float] = None,
response_action_id: Optional[float] = None,
compute_monitor_id: Optional[str] = None,
ip_address: Optional[str] = None,
notified_users: Optional[Sequence[float]] = None,
tags: Optional[Sequence[str]] = None,
wait_cycles: Optional[float] = None)
func NewComputeMonitor(ctx *Context, name string, args ComputeMonitorArgs, opts ...ResourceOption) (*ComputeMonitor, error)
public ComputeMonitor(string name, ComputeMonitorArgs args, CustomResourceOptions? opts = null)
public ComputeMonitor(String name, ComputeMonitorArgs args)
public ComputeMonitor(String name, ComputeMonitorArgs args, CustomResourceOptions options)
type: ibm:ComputeMonitor
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 ComputeMonitorArgs
- 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 ComputeMonitorArgs
- 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 ComputeMonitorArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ComputeMonitorArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ComputeMonitorArgs
- 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 computeMonitorResource = new Ibm.ComputeMonitor("computeMonitorResource", new()
{
GuestId = 0,
QueryTypeId = 0,
ResponseActionId = 0,
ComputeMonitorId = "string",
IpAddress = "string",
NotifiedUsers = new[]
{
0,
},
Tags = new[]
{
"string",
},
WaitCycles = 0,
});
example, err := ibm.NewComputeMonitor(ctx, "computeMonitorResource", &ibm.ComputeMonitorArgs{
GuestId: pulumi.Float64(0),
QueryTypeId: pulumi.Float64(0),
ResponseActionId: pulumi.Float64(0),
ComputeMonitorId: pulumi.String("string"),
IpAddress: pulumi.String("string"),
NotifiedUsers: pulumi.Float64Array{
pulumi.Float64(0),
},
Tags: pulumi.StringArray{
pulumi.String("string"),
},
WaitCycles: pulumi.Float64(0),
})
var computeMonitorResource = new ComputeMonitor("computeMonitorResource", ComputeMonitorArgs.builder()
.guestId(0)
.queryTypeId(0)
.responseActionId(0)
.computeMonitorId("string")
.ipAddress("string")
.notifiedUsers(0)
.tags("string")
.waitCycles(0)
.build());
compute_monitor_resource = ibm.ComputeMonitor("computeMonitorResource",
guest_id=0,
query_type_id=0,
response_action_id=0,
compute_monitor_id="string",
ip_address="string",
notified_users=[0],
tags=["string"],
wait_cycles=0)
const computeMonitorResource = new ibm.ComputeMonitor("computeMonitorResource", {
guestId: 0,
queryTypeId: 0,
responseActionId: 0,
computeMonitorId: "string",
ipAddress: "string",
notifiedUsers: [0],
tags: ["string"],
waitCycles: 0,
});
type: ibm:ComputeMonitor
properties:
computeMonitorId: string
guestId: 0
ipAddress: string
notifiedUsers:
- 0
queryTypeId: 0
responseActionId: 0
tags:
- string
waitCycles: 0
ComputeMonitor 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 ComputeMonitor resource accepts the following input properties:
- Guest
Id double - The ID of the virtual guest that you want to monitor.
- Query
Type doubleId - The ID of the query type.
- Response
Action doubleId - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - Compute
Monitor stringId - (String) The unique identifier of the monitor.
- Ip
Address string - The IP address that you want to monitor.
- Notified
Users List<double> - The list of user IDs that is notified.
- List<string>
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - Wait
Cycles double - The number of 5-minute cycles to wait before the response action is taken.
- Guest
Id float64 - The ID of the virtual guest that you want to monitor.
- Query
Type float64Id - The ID of the query type.
- Response
Action float64Id - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - Compute
Monitor stringId - (String) The unique identifier of the monitor.
- Ip
Address string - The IP address that you want to monitor.
- Notified
Users []float64 - The list of user IDs that is notified.
- []string
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - Wait
Cycles float64 - The number of 5-minute cycles to wait before the response action is taken.
- guest
Id Double - The ID of the virtual guest that you want to monitor.
- query
Type DoubleId - The ID of the query type.
- response
Action DoubleId - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - compute
Monitor StringId - (String) The unique identifier of the monitor.
- ip
Address String - The IP address that you want to monitor.
- notified
Users List<Double> - The list of user IDs that is notified.
- List<String>
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - wait
Cycles Double - The number of 5-minute cycles to wait before the response action is taken.
- guest
Id number - The ID of the virtual guest that you want to monitor.
- query
Type numberId - The ID of the query type.
- response
Action numberId - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - compute
Monitor stringId - (String) The unique identifier of the monitor.
- ip
Address string - The IP address that you want to monitor.
- notified
Users number[] - The list of user IDs that is notified.
- string[]
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - wait
Cycles number - The number of 5-minute cycles to wait before the response action is taken.
- guest_
id float - The ID of the virtual guest that you want to monitor.
- query_
type_ floatid - The ID of the query type.
- response_
action_ floatid - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - compute_
monitor_ strid - (String) The unique identifier of the monitor.
- ip_
address str - The IP address that you want to monitor.
- notified_
users Sequence[float] - The list of user IDs that is notified.
- Sequence[str]
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - wait_
cycles float - The number of 5-minute cycles to wait before the response action is taken.
- guest
Id Number - The ID of the virtual guest that you want to monitor.
- query
Type NumberId - The ID of the query type.
- response
Action NumberId - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - compute
Monitor StringId - (String) The unique identifier of the monitor.
- ip
Address String - The IP address that you want to monitor.
- notified
Users List<Number> - The list of user IDs that is notified.
- List<String>
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - wait
Cycles Number - The number of 5-minute cycles to wait before the response action is taken.
Outputs
All input properties are implicitly available as output properties. Additionally, the ComputeMonitor resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ComputeMonitor Resource
Get an existing ComputeMonitor 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?: ComputeMonitorState, opts?: CustomResourceOptions): ComputeMonitor
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
compute_monitor_id: Optional[str] = None,
guest_id: Optional[float] = None,
ip_address: Optional[str] = None,
notified_users: Optional[Sequence[float]] = None,
query_type_id: Optional[float] = None,
response_action_id: Optional[float] = None,
tags: Optional[Sequence[str]] = None,
wait_cycles: Optional[float] = None) -> ComputeMonitor
func GetComputeMonitor(ctx *Context, name string, id IDInput, state *ComputeMonitorState, opts ...ResourceOption) (*ComputeMonitor, error)
public static ComputeMonitor Get(string name, Input<string> id, ComputeMonitorState? state, CustomResourceOptions? opts = null)
public static ComputeMonitor get(String name, Output<String> id, ComputeMonitorState state, CustomResourceOptions options)
resources: _: type: ibm:ComputeMonitor 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.
- Compute
Monitor stringId - (String) The unique identifier of the monitor.
- Guest
Id double - The ID of the virtual guest that you want to monitor.
- Ip
Address string - The IP address that you want to monitor.
- Notified
Users List<double> - The list of user IDs that is notified.
- Query
Type doubleId - The ID of the query type.
- Response
Action doubleId - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - List<string>
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - Wait
Cycles double - The number of 5-minute cycles to wait before the response action is taken.
- Compute
Monitor stringId - (String) The unique identifier of the monitor.
- Guest
Id float64 - The ID of the virtual guest that you want to monitor.
- Ip
Address string - The IP address that you want to monitor.
- Notified
Users []float64 - The list of user IDs that is notified.
- Query
Type float64Id - The ID of the query type.
- Response
Action float64Id - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - []string
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - Wait
Cycles float64 - The number of 5-minute cycles to wait before the response action is taken.
- compute
Monitor StringId - (String) The unique identifier of the monitor.
- guest
Id Double - The ID of the virtual guest that you want to monitor.
- ip
Address String - The IP address that you want to monitor.
- notified
Users List<Double> - The list of user IDs that is notified.
- query
Type DoubleId - The ID of the query type.
- response
Action DoubleId - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - List<String>
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - wait
Cycles Double - The number of 5-minute cycles to wait before the response action is taken.
- compute
Monitor stringId - (String) The unique identifier of the monitor.
- guest
Id number - The ID of the virtual guest that you want to monitor.
- ip
Address string - The IP address that you want to monitor.
- notified
Users number[] - The list of user IDs that is notified.
- query
Type numberId - The ID of the query type.
- response
Action numberId - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - string[]
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - wait
Cycles number - The number of 5-minute cycles to wait before the response action is taken.
- compute_
monitor_ strid - (String) The unique identifier of the monitor.
- guest_
id float - The ID of the virtual guest that you want to monitor.
- ip_
address str - The IP address that you want to monitor.
- notified_
users Sequence[float] - The list of user IDs that is notified.
- query_
type_ floatid - The ID of the query type.
- response_
action_ floatid - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - Sequence[str]
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - wait_
cycles float - The number of 5-minute cycles to wait before the response action is taken.
- compute
Monitor StringId - (String) The unique identifier of the monitor.
- guest
Id Number - The ID of the virtual guest that you want to monitor.
- ip
Address String - The IP address that you want to monitor.
- notified
Users List<Number> - The list of user IDs that is notified.
- query
Type NumberId - The ID of the query type.
- response
Action NumberId - The ID of the response action to take if the monitor fails. Accepted values are
1
or2
. - List<String>
- Tags associated with the monitoring instance. Note
Tags
are managed locally and not stored on the IBM Cloud Service Endpoint at this moment. - wait
Cycles Number - The number of 5-minute cycles to wait before the response action is taken.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.