1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cms
  5. HybridMonitorFcTask
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.cms.HybridMonitorFcTask

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    Provides a Cloud Monitor Service Hybrid Monitor Fc Task resource.

    For information about Cloud Monitor Service Hybrid Monitor Fc Task and how to use it, see What is Hybrid Monitor Fc Task.

    NOTE: Available since v1.179.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") || "tf-example";
    const defaultAccount = alicloud.getAccount({});
    const defaultNamespace = new alicloud.cms.Namespace("defaultNamespace", {
        description: name,
        namespace: name,
        specification: "cms.s1.large",
    });
    const defaultHybridMonitorFcTask = new alicloud.cms.HybridMonitorFcTask("defaultHybridMonitorFcTask", {
        namespace: defaultNamespace.id,
        yarmConfig: `products:
    - namespace: acs_ecs_dashboard
      metric_info:
      - metric_list:
        - cpu_total
        - cpu_idle
        - diskusage_utilization
        - CPUUtilization
        - DiskReadBPS
        - InternetOut
        - IntranetOut
        - cpu_system
    - namespace: acs_rds_dashboard
      metric_info:
      - metric_list:
        - MySQL_QPS
        - MySQL_TPS
    `,
        targetUserId: defaultAccount.then(defaultAccount => defaultAccount.id),
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default_account = alicloud.get_account()
    default_namespace = alicloud.cms.Namespace("defaultNamespace",
        description=name,
        namespace=name,
        specification="cms.s1.large")
    default_hybrid_monitor_fc_task = alicloud.cms.HybridMonitorFcTask("defaultHybridMonitorFcTask",
        namespace=default_namespace.id,
        yarm_config="""products:
    - namespace: acs_ecs_dashboard
      metric_info:
      - metric_list:
        - cpu_total
        - cpu_idle
        - diskusage_utilization
        - CPUUtilization
        - DiskReadBPS
        - InternetOut
        - IntranetOut
        - cpu_system
    - namespace: acs_rds_dashboard
      metric_info:
      - metric_list:
        - MySQL_QPS
        - MySQL_TPS
    """,
        target_user_id=default_account.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
    	"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 := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultAccount, err := alicloud.GetAccount(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		defaultNamespace, err := cms.NewNamespace(ctx, "defaultNamespace", &cms.NamespaceArgs{
    			Description:   pulumi.String(name),
    			Namespace:     pulumi.String(name),
    			Specification: pulumi.String("cms.s1.large"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cms.NewHybridMonitorFcTask(ctx, "defaultHybridMonitorFcTask", &cms.HybridMonitorFcTaskArgs{
    			Namespace: defaultNamespace.ID(),
    			YarmConfig: pulumi.String(`products:
    - namespace: acs_ecs_dashboard
      metric_info:
      - metric_list:
        - cpu_total
        - cpu_idle
        - diskusage_utilization
        - CPUUtilization
        - DiskReadBPS
        - InternetOut
        - IntranetOut
        - cpu_system
    - namespace: acs_rds_dashboard
      metric_info:
      - metric_list:
        - MySQL_QPS
        - MySQL_TPS
    `),
    			TargetUserId: pulumi.String(defaultAccount.Id),
    		})
    		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") ?? "tf-example";
        var defaultAccount = AliCloud.GetAccount.Invoke();
    
        var defaultNamespace = new AliCloud.Cms.Namespace("defaultNamespace", new()
        {
            Description = name,
            NamespaceName = name,
            Specification = "cms.s1.large",
        });
    
        var defaultHybridMonitorFcTask = new AliCloud.Cms.HybridMonitorFcTask("defaultHybridMonitorFcTask", new()
        {
            Namespace = defaultNamespace.Id,
            YarmConfig = @"products:
    - namespace: acs_ecs_dashboard
      metric_info:
      - metric_list:
        - cpu_total
        - cpu_idle
        - diskusage_utilization
        - CPUUtilization
        - DiskReadBPS
        - InternetOut
        - IntranetOut
        - cpu_system
    - namespace: acs_rds_dashboard
      metric_info:
      - metric_list:
        - MySQL_QPS
        - MySQL_TPS
    ",
            TargetUserId = defaultAccount.Apply(getAccountResult => getAccountResult.Id),
        });
    
    });
    
    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.cms.Namespace;
    import com.pulumi.alicloud.cms.NamespaceArgs;
    import com.pulumi.alicloud.cms.HybridMonitorFcTask;
    import com.pulumi.alicloud.cms.HybridMonitorFcTaskArgs;
    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("tf-example");
            final var defaultAccount = AlicloudFunctions.getAccount();
    
            var defaultNamespace = new Namespace("defaultNamespace", NamespaceArgs.builder()        
                .description(name)
                .namespace(name)
                .specification("cms.s1.large")
                .build());
    
            var defaultHybridMonitorFcTask = new HybridMonitorFcTask("defaultHybridMonitorFcTask", HybridMonitorFcTaskArgs.builder()        
                .namespace(defaultNamespace.id())
                .yarmConfig("""
    products:
    - namespace: acs_ecs_dashboard
      metric_info:
      - metric_list:
        - cpu_total
        - cpu_idle
        - diskusage_utilization
        - CPUUtilization
        - DiskReadBPS
        - InternetOut
        - IntranetOut
        - cpu_system
    - namespace: acs_rds_dashboard
      metric_info:
      - metric_list:
        - MySQL_QPS
        - MySQL_TPS
                """)
                .targetUserId(defaultAccount.applyValue(getAccountResult -> getAccountResult.id()))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultNamespace:
        type: alicloud:cms:Namespace
        properties:
          description: ${name}
          namespace: ${name}
          specification: cms.s1.large
      defaultHybridMonitorFcTask:
        type: alicloud:cms:HybridMonitorFcTask
        properties:
          namespace: ${defaultNamespace.id}
          yarmConfig: |
            products:
            - namespace: acs_ecs_dashboard
              metric_info:
              - metric_list:
                - cpu_total
                - cpu_idle
                - diskusage_utilization
                - CPUUtilization
                - DiskReadBPS
                - InternetOut
                - IntranetOut
                - cpu_system
            - namespace: acs_rds_dashboard
              metric_info:
              - metric_list:
                - MySQL_QPS
                - MySQL_TPS        
          targetUserId: ${defaultAccount.id}
    variables:
      defaultAccount:
        fn::invoke:
          Function: alicloud:getAccount
          Arguments: {}
    

    Create HybridMonitorFcTask Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new HybridMonitorFcTask(name: string, args: HybridMonitorFcTaskArgs, opts?: CustomResourceOptions);
    @overload
    def HybridMonitorFcTask(resource_name: str,
                            args: HybridMonitorFcTaskArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def HybridMonitorFcTask(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            namespace: Optional[str] = None,
                            yarm_config: Optional[str] = None,
                            target_user_id: Optional[str] = None)
    func NewHybridMonitorFcTask(ctx *Context, name string, args HybridMonitorFcTaskArgs, opts ...ResourceOption) (*HybridMonitorFcTask, error)
    public HybridMonitorFcTask(string name, HybridMonitorFcTaskArgs args, CustomResourceOptions? opts = null)
    public HybridMonitorFcTask(String name, HybridMonitorFcTaskArgs args)
    public HybridMonitorFcTask(String name, HybridMonitorFcTaskArgs args, CustomResourceOptions options)
    
    type: alicloud:cms:HybridMonitorFcTask
    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 HybridMonitorFcTaskArgs
    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 HybridMonitorFcTaskArgs
    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 HybridMonitorFcTaskArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HybridMonitorFcTaskArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HybridMonitorFcTaskArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var hybridMonitorFcTaskResource = new AliCloud.Cms.HybridMonitorFcTask("hybridMonitorFcTaskResource", new()
    {
        Namespace = "string",
        YarmConfig = "string",
        TargetUserId = "string",
    });
    
    example, err := cms.NewHybridMonitorFcTask(ctx, "hybridMonitorFcTaskResource", &cms.HybridMonitorFcTaskArgs{
    	Namespace:    pulumi.String("string"),
    	YarmConfig:   pulumi.String("string"),
    	TargetUserId: pulumi.String("string"),
    })
    
    var hybridMonitorFcTaskResource = new HybridMonitorFcTask("hybridMonitorFcTaskResource", HybridMonitorFcTaskArgs.builder()        
        .namespace("string")
        .yarmConfig("string")
        .targetUserId("string")
        .build());
    
    hybrid_monitor_fc_task_resource = alicloud.cms.HybridMonitorFcTask("hybridMonitorFcTaskResource",
        namespace="string",
        yarm_config="string",
        target_user_id="string")
    
    const hybridMonitorFcTaskResource = new alicloud.cms.HybridMonitorFcTask("hybridMonitorFcTaskResource", {
        namespace: "string",
        yarmConfig: "string",
        targetUserId: "string",
    });
    
    type: alicloud:cms:HybridMonitorFcTask
    properties:
        namespace: string
        targetUserId: string
        yarmConfig: string
    

    HybridMonitorFcTask Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The HybridMonitorFcTask resource accepts the following input properties:

    Namespace string
    the namespace of the Alibaba Cloud service.
    YarmConfig string
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    TargetUserId string
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    Namespace string
    the namespace of the Alibaba Cloud service.
    YarmConfig string
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    TargetUserId string
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    namespace String
    the namespace of the Alibaba Cloud service.
    yarmConfig String
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    targetUserId String
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    namespace string
    the namespace of the Alibaba Cloud service.
    yarmConfig string
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    targetUserId string
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    namespace str
    the namespace of the Alibaba Cloud service.
    yarm_config str
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    target_user_id str
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    namespace String
    the namespace of the Alibaba Cloud service.
    yarmConfig String
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    targetUserId String
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the HybridMonitorFcTask resource produces the following output properties:

    HybridMonitorFcTaskId string
    The ID of the monitoring task.
    Id string
    The provider-assigned unique ID for this managed resource.
    HybridMonitorFcTaskId string
    The ID of the monitoring task.
    Id string
    The provider-assigned unique ID for this managed resource.
    hybridMonitorFcTaskId String
    The ID of the monitoring task.
    id String
    The provider-assigned unique ID for this managed resource.
    hybridMonitorFcTaskId string
    The ID of the monitoring task.
    id string
    The provider-assigned unique ID for this managed resource.
    hybrid_monitor_fc_task_id str
    The ID of the monitoring task.
    id str
    The provider-assigned unique ID for this managed resource.
    hybridMonitorFcTaskId String
    The ID of the monitoring task.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing HybridMonitorFcTask Resource

    Get an existing HybridMonitorFcTask 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?: HybridMonitorFcTaskState, opts?: CustomResourceOptions): HybridMonitorFcTask
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            hybrid_monitor_fc_task_id: Optional[str] = None,
            namespace: Optional[str] = None,
            target_user_id: Optional[str] = None,
            yarm_config: Optional[str] = None) -> HybridMonitorFcTask
    func GetHybridMonitorFcTask(ctx *Context, name string, id IDInput, state *HybridMonitorFcTaskState, opts ...ResourceOption) (*HybridMonitorFcTask, error)
    public static HybridMonitorFcTask Get(string name, Input<string> id, HybridMonitorFcTaskState? state, CustomResourceOptions? opts = null)
    public static HybridMonitorFcTask get(String name, Output<String> id, HybridMonitorFcTaskState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    HybridMonitorFcTaskId string
    The ID of the monitoring task.
    Namespace string
    the namespace of the Alibaba Cloud service.
    TargetUserId string
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    YarmConfig string
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    HybridMonitorFcTaskId string
    The ID of the monitoring task.
    Namespace string
    the namespace of the Alibaba Cloud service.
    TargetUserId string
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    YarmConfig string
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    hybridMonitorFcTaskId String
    The ID of the monitoring task.
    namespace String
    the namespace of the Alibaba Cloud service.
    targetUserId String
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    yarmConfig String
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    hybridMonitorFcTaskId string
    The ID of the monitoring task.
    namespace string
    the namespace of the Alibaba Cloud service.
    targetUserId string
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    yarmConfig string
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    hybrid_monitor_fc_task_id str
    The ID of the monitoring task.
    namespace str
    the namespace of the Alibaba Cloud service.
    target_user_id str
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    yarm_config str
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
    hybridMonitorFcTaskId String
    The ID of the monitoring task.
    namespace String
    the namespace of the Alibaba Cloud service.
    targetUserId String
    The ID of the member account. If you call API operations by using a management account, you can connect the Alibaba Cloud services that are activated for a member account in Resource Directory to Hybrid Cloud Monitoring. You can use Resource Directory to monitor Alibaba Cloud services across enterprise accounts.
    yarmConfig String
    The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.

    Import

    Cloud Monitor Service Hybrid Monitor Fc Task can be imported using the id, e.g.

    $ pulumi import alicloud:cms/hybridMonitorFcTask:HybridMonitorFcTask example <hybrid_monitor_fc_task_id>:<namespace>
    

    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.
    alicloud logo
    Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi