1. Registry
  2. Packages
  3. Ibm Provider
  4. API Docs
  5. getCloudMonitoringApiToken
Viewing docs for ibm 2.9.0
published on Thursday, Nov 5, 2026 by ibm-cloud
ibm
Viewing docs for ibm 2.9.0
published on Thursday, Nov 5, 2026 by ibm-cloud

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const monitoring = new ibm.ResourceInstance("monitoring", {
        name: "my-monitoring",
        service: "sysdig-monitor",
        plan: "graduated-tier",
        location: "us-south",
    });
    const token = ibm.getCloudMonitoringApiTokenOutput({
        instanceId: monitoring.guid,
        region: "us-south",
    });
    export const cloudMonitoringApiToken = token.apply(token => token.value);
    
    import pulumi
    import pulumi_ibm as ibm
    
    monitoring = ibm.ResourceInstance("monitoring",
        name="my-monitoring",
        service="sysdig-monitor",
        plan="graduated-tier",
        location="us-south")
    token = ibm.get_cloud_monitoring_api_token_output(instance_id=monitoring.guid,
        region="us-south")
    pulumi.export("cloudMonitoringApiToken", token.value)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		monitoring, err := ibm.NewResourceInstance(ctx, "monitoring", &ibm.ResourceInstanceArgs{
    			Name:     pulumi.String("my-monitoring"),
    			Service:  pulumi.String("sysdig-monitor"),
    			Plan:     pulumi.String("graduated-tier"),
    			Location: pulumi.String("us-south"),
    		})
    		if err != nil {
    			return err
    		}
    		token := ibm.GetCloudMonitoringApiTokenOutput(ctx, ibm.GetCloudMonitoringApiTokenOutputArgs{
    			InstanceId: monitoring.Guid,
    			Region:     pulumi.String("us-south"),
    		}, nil)
    		ctx.Export("cloudMonitoringApiToken", token.ApplyT(func(token ibm.GetCloudMonitoringApiTokenResult) (*string, error) {
    			return &token.Value, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var monitoring = new Ibm.ResourceInstance("monitoring", new()
        {
            Name = "my-monitoring",
            Service = "sysdig-monitor",
            Plan = "graduated-tier",
            Location = "us-south",
        });
    
        var token = Ibm.GetCloudMonitoringApiToken.Invoke(new()
        {
            InstanceId = monitoring.Guid,
            Region = "us-south",
        });
    
        return new Dictionary<string, object?>
        {
            ["cloudMonitoringApiToken"] = token.Apply(getCloudMonitoringApiTokenResult => getCloudMonitoringApiTokenResult.Value),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.ResourceInstance;
    import com.pulumi.ibm.ResourceInstanceArgs;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetCloudMonitoringApiTokenArgs;
    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 monitoring = new ResourceInstance("monitoring", ResourceInstanceArgs.builder()
                .name("my-monitoring")
                .service("sysdig-monitor")
                .plan("graduated-tier")
                .location("us-south")
                .build());
    
            final var token = IbmFunctions.getCloudMonitoringApiToken(GetCloudMonitoringApiTokenArgs.builder()
                .instanceId(monitoring.guid())
                .region("us-south")
                .build());
    
            ctx.export("cloudMonitoringApiToken", token.applyValue(_token -> _token.value()));
        }
    }
    
    resources:
      monitoring:
        type: ibm:ResourceInstance
        properties:
          name: my-monitoring
          service: sysdig-monitor
          plan: graduated-tier
          location: us-south
    variables:
      token:
        fn::invoke:
          function: ibm:getCloudMonitoringApiToken
          arguments:
            instanceId: ${monitoring.guid}
            region: us-south
    outputs:
      cloudMonitoringApiToken: ${token.value}
    
    Example coming soon!
    

    Using getCloudMonitoringApiToken

    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 getCloudMonitoringApiToken(args: GetCloudMonitoringApiTokenArgs, opts?: InvokeOptions): Promise<GetCloudMonitoringApiTokenResult>
    function getCloudMonitoringApiTokenOutput(args: GetCloudMonitoringApiTokenOutputArgs, opts?: InvokeOutputOptions): Output<GetCloudMonitoringApiTokenResult>
    def get_cloud_monitoring_api_token(endpoint_type: Optional[str] = None,
                                       id: Optional[str] = None,
                                       instance_id: Optional[str] = None,
                                       region: Optional[str] = None,
                                       opts: Optional[InvokeOptions] = None) -> GetCloudMonitoringApiTokenResult
    def get_cloud_monitoring_api_token_output(endpoint_type: pulumi.Input[Optional[str]] = None,
                                       id: pulumi.Input[Optional[str]] = None,
                                       instance_id: pulumi.Input[Optional[str]] = None,
                                       region: pulumi.Input[Optional[str]] = None,
                                       opts: Optional[InvokeOutputOptions] = None) -> Output[GetCloudMonitoringApiTokenResult]
    func GetCloudMonitoringApiToken(ctx *Context, args *GetCloudMonitoringApiTokenArgs, opts ...InvokeOption) (*GetCloudMonitoringApiTokenResult, error)
    func GetCloudMonitoringApiTokenOutput(ctx *Context, args *GetCloudMonitoringApiTokenOutputArgs, opts ...InvokeOption) GetCloudMonitoringApiTokenResultOutput

    > Note: This function is named GetCloudMonitoringApiToken in the Go SDK.

    public static class GetCloudMonitoringApiToken 
    {
        public static Task<GetCloudMonitoringApiTokenResult> InvokeAsync(GetCloudMonitoringApiTokenArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudMonitoringApiTokenResult> Invoke(GetCloudMonitoringApiTokenInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudMonitoringApiTokenResult> Invoke(GetCloudMonitoringApiTokenInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetCloudMonitoringApiTokenResult> getCloudMonitoringApiToken(GetCloudMonitoringApiTokenArgs args, InvokeOptions options)
    public static Output<GetCloudMonitoringApiTokenResult> getCloudMonitoringApiToken(GetCloudMonitoringApiTokenArgs args, InvokeOptions options)
    public static Output<GetCloudMonitoringApiTokenResult> getCloudMonitoringApiToken(GetCloudMonitoringApiTokenArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: ibm:index/getCloudMonitoringApiToken:getCloudMonitoringApiToken
      arguments:
        # arguments dictionary
    data "ibm_get_cloud_monitoring_api_token" "name" {
        # arguments
    }

    The following arguments are supported:

    InstanceId string
    The GUID or the CRN of the IBM Cloud Monitoring instance. When you pass a CRN, the GUID is read from it.
    EndpointType string

    The type of IBM Cloud Monitoring endpoint to call. Allowed values are public and private. When not set, the endpoint follows the provider visibility setting, the same as other services.

    The data source uses the IBM Cloud Monitoring client that the provider builds from its configuration (region, visibility, endpoints file and IAM authentication). You can override the endpoint with the IBMCLOUD_MONITORING_API_ENDPOINT environment variable or the same key in the endpoints file, for example https://us-south.monitoring.cloud.ibm.com. For more information, see custom service endpoints. When the environment variable is set, it is used as is and region and endpoint_type do not change the URL.

    Id string
    (String) The GUID of the IBM Cloud Monitoring instance.
    Region string
    The region of the IBM Cloud Monitoring instance, for example us-south. Default value is the provider region.
    InstanceId string
    The GUID or the CRN of the IBM Cloud Monitoring instance. When you pass a CRN, the GUID is read from it.
    EndpointType string

    The type of IBM Cloud Monitoring endpoint to call. Allowed values are public and private. When not set, the endpoint follows the provider visibility setting, the same as other services.

    The data source uses the IBM Cloud Monitoring client that the provider builds from its configuration (region, visibility, endpoints file and IAM authentication). You can override the endpoint with the IBMCLOUD_MONITORING_API_ENDPOINT environment variable or the same key in the endpoints file, for example https://us-south.monitoring.cloud.ibm.com. For more information, see custom service endpoints. When the environment variable is set, it is used as is and region and endpoint_type do not change the URL.

    Id string
    (String) The GUID of the IBM Cloud Monitoring instance.
    Region string
    The region of the IBM Cloud Monitoring instance, for example us-south. Default value is the provider region.
    instance_id string
    The GUID or the CRN of the IBM Cloud Monitoring instance. When you pass a CRN, the GUID is read from it.
    endpoint_type string

    The type of IBM Cloud Monitoring endpoint to call. Allowed values are public and private. When not set, the endpoint follows the provider visibility setting, the same as other services.

    The data source uses the IBM Cloud Monitoring client that the provider builds from its configuration (region, visibility, endpoints file and IAM authentication). You can override the endpoint with the IBMCLOUD_MONITORING_API_ENDPOINT environment variable or the same key in the endpoints file, for example https://us-south.monitoring.cloud.ibm.com. For more information, see custom service endpoints. When the environment variable is set, it is used as is and region and endpoint_type do not change the URL.

    id string
    (String) The GUID of the IBM Cloud Monitoring instance.
    region string
    The region of the IBM Cloud Monitoring instance, for example us-south. Default value is the provider region.
    instanceId String
    The GUID or the CRN of the IBM Cloud Monitoring instance. When you pass a CRN, the GUID is read from it.
    endpointType String

    The type of IBM Cloud Monitoring endpoint to call. Allowed values are public and private. When not set, the endpoint follows the provider visibility setting, the same as other services.

    The data source uses the IBM Cloud Monitoring client that the provider builds from its configuration (region, visibility, endpoints file and IAM authentication). You can override the endpoint with the IBMCLOUD_MONITORING_API_ENDPOINT environment variable or the same key in the endpoints file, for example https://us-south.monitoring.cloud.ibm.com. For more information, see custom service endpoints. When the environment variable is set, it is used as is and region and endpoint_type do not change the URL.

    id String
    (String) The GUID of the IBM Cloud Monitoring instance.
    region String
    The region of the IBM Cloud Monitoring instance, for example us-south. Default value is the provider region.
    instanceId string
    The GUID or the CRN of the IBM Cloud Monitoring instance. When you pass a CRN, the GUID is read from it.
    endpointType string

    The type of IBM Cloud Monitoring endpoint to call. Allowed values are public and private. When not set, the endpoint follows the provider visibility setting, the same as other services.

    The data source uses the IBM Cloud Monitoring client that the provider builds from its configuration (region, visibility, endpoints file and IAM authentication). You can override the endpoint with the IBMCLOUD_MONITORING_API_ENDPOINT environment variable or the same key in the endpoints file, for example https://us-south.monitoring.cloud.ibm.com. For more information, see custom service endpoints. When the environment variable is set, it is used as is and region and endpoint_type do not change the URL.

    id string
    (String) The GUID of the IBM Cloud Monitoring instance.
    region string
    The region of the IBM Cloud Monitoring instance, for example us-south. Default value is the provider region.
    instance_id str
    The GUID or the CRN of the IBM Cloud Monitoring instance. When you pass a CRN, the GUID is read from it.
    endpoint_type str

    The type of IBM Cloud Monitoring endpoint to call. Allowed values are public and private. When not set, the endpoint follows the provider visibility setting, the same as other services.

    The data source uses the IBM Cloud Monitoring client that the provider builds from its configuration (region, visibility, endpoints file and IAM authentication). You can override the endpoint with the IBMCLOUD_MONITORING_API_ENDPOINT environment variable or the same key in the endpoints file, for example https://us-south.monitoring.cloud.ibm.com. For more information, see custom service endpoints. When the environment variable is set, it is used as is and region and endpoint_type do not change the URL.

    id str
    (String) The GUID of the IBM Cloud Monitoring instance.
    region str
    The region of the IBM Cloud Monitoring instance, for example us-south. Default value is the provider region.
    instanceId String
    The GUID or the CRN of the IBM Cloud Monitoring instance. When you pass a CRN, the GUID is read from it.
    endpointType String

    The type of IBM Cloud Monitoring endpoint to call. Allowed values are public and private. When not set, the endpoint follows the provider visibility setting, the same as other services.

    The data source uses the IBM Cloud Monitoring client that the provider builds from its configuration (region, visibility, endpoints file and IAM authentication). You can override the endpoint with the IBMCLOUD_MONITORING_API_ENDPOINT environment variable or the same key in the endpoints file, for example https://us-south.monitoring.cloud.ibm.com. For more information, see custom service endpoints. When the environment variable is set, it is used as is and region and endpoint_type do not change the URL.

    id String
    (String) The GUID of the IBM Cloud Monitoring instance.
    region String
    The region of the IBM Cloud Monitoring instance, for example us-south. Default value is the provider region.

    getCloudMonitoringApiToken Result

    The following output properties are available:

    Id string
    (String) The GUID of the IBM Cloud Monitoring instance.
    InstanceId string
    Region string
    Value string
    (String, Sensitive) The API token of the IBM Cloud Monitoring instance.
    EndpointType string
    Id string
    (String) The GUID of the IBM Cloud Monitoring instance.
    InstanceId string
    Region string
    Value string
    (String, Sensitive) The API token of the IBM Cloud Monitoring instance.
    EndpointType string
    id string
    (String) The GUID of the IBM Cloud Monitoring instance.
    instance_id string
    region string
    value string
    (String, Sensitive) The API token of the IBM Cloud Monitoring instance.
    endpoint_type string
    id String
    (String) The GUID of the IBM Cloud Monitoring instance.
    instanceId String
    region String
    value String
    (String, Sensitive) The API token of the IBM Cloud Monitoring instance.
    endpointType String
    id string
    (String) The GUID of the IBM Cloud Monitoring instance.
    instanceId string
    region string
    value string
    (String, Sensitive) The API token of the IBM Cloud Monitoring instance.
    endpointType string
    id str
    (String) The GUID of the IBM Cloud Monitoring instance.
    instance_id str
    region str
    value str
    (String, Sensitive) The API token of the IBM Cloud Monitoring instance.
    endpoint_type str
    id String
    (String) The GUID of the IBM Cloud Monitoring instance.
    instanceId String
    region String
    value String
    (String, Sensitive) The API token of the IBM Cloud Monitoring instance.
    endpointType String

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm
    Viewing docs for ibm 2.9.0
    published on Thursday, Nov 5, 2026 by ibm-cloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial