1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. sls
  5. MachineGroup
Alibaba Cloud v3.86.1 published on Saturday, Sep 27, 2025 by Pulumi

alicloud.sls.MachineGroup

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.86.1 published on Saturday, Sep 27, 2025 by Pulumi

    Provides a Log Service (SLS) Machine Group resource.

    For information about Log Service (SLS) Machine Group and how to use it, see What is Machine Group.

    NOTE: Available since v1.259.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 projectName = config.get("projectName") || "project-for-machine-group-terraform";
    const defaultyJqrue = new alicloud.log.Project("defaultyJqrue", {
        description: "for terraform example",
        name: projectName,
    });
    const _default = new alicloud.sls.MachineGroup("default", {
        groupName: "group1",
        projectName: projectName,
        machineIdentifyType: "ip",
        groupAttribute: {
            groupTopic: "example",
            externalName: "example",
        },
        machineLists: ["192.168.1.1"],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    project_name = config.get("projectName")
    if project_name is None:
        project_name = "project-for-machine-group-terraform"
    defaulty_jqrue = alicloud.log.Project("defaultyJqrue",
        description="for terraform example",
        name=project_name)
    default = alicloud.sls.MachineGroup("default",
        group_name="group1",
        project_name=project_name,
        machine_identify_type="ip",
        group_attribute={
            "group_topic": "example",
            "external_name": "example",
        },
        machine_lists=["192.168.1.1"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/sls"
    	"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
    		}
    		projectName := "project-for-machine-group-terraform"
    		if param := cfg.Get("projectName"); param != "" {
    			projectName = param
    		}
    		_, err := log.NewProject(ctx, "defaultyJqrue", &log.ProjectArgs{
    			Description: pulumi.String("for terraform example"),
    			Name:        pulumi.String(projectName),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = sls.NewMachineGroup(ctx, "default", &sls.MachineGroupArgs{
    			GroupName:           pulumi.String("group1"),
    			ProjectName:         pulumi.String(projectName),
    			MachineIdentifyType: pulumi.String("ip"),
    			GroupAttribute: &sls.MachineGroupGroupAttributeArgs{
    				GroupTopic:   pulumi.String("example"),
    				ExternalName: pulumi.String("example"),
    			},
    			MachineLists: pulumi.StringArray{
    				pulumi.String("192.168.1.1"),
    			},
    		})
    		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 projectName = config.Get("projectName") ?? "project-for-machine-group-terraform";
        var defaultyJqrue = new AliCloud.Log.Project("defaultyJqrue", new()
        {
            Description = "for terraform example",
            Name = projectName,
        });
    
        var @default = new AliCloud.Sls.MachineGroup("default", new()
        {
            GroupName = "group1",
            ProjectName = projectName,
            MachineIdentifyType = "ip",
            GroupAttribute = new AliCloud.Sls.Inputs.MachineGroupGroupAttributeArgs
            {
                GroupTopic = "example",
                ExternalName = "example",
            },
            MachineLists = new[]
            {
                "192.168.1.1",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.log.Project;
    import com.pulumi.alicloud.log.ProjectArgs;
    import com.pulumi.alicloud.sls.MachineGroup;
    import com.pulumi.alicloud.sls.MachineGroupArgs;
    import com.pulumi.alicloud.sls.inputs.MachineGroupGroupAttributeArgs;
    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 projectName = config.get("projectName").orElse("project-for-machine-group-terraform");
            var defaultyJqrue = new Project("defaultyJqrue", ProjectArgs.builder()
                .description("for terraform example")
                .name(projectName)
                .build());
    
            var default_ = new MachineGroup("default", MachineGroupArgs.builder()
                .groupName("group1")
                .projectName(projectName)
                .machineIdentifyType("ip")
                .groupAttribute(MachineGroupGroupAttributeArgs.builder()
                    .groupTopic("example")
                    .externalName("example")
                    .build())
                .machineLists("192.168.1.1")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
      projectName:
        type: string
        default: project-for-machine-group-terraform
    resources:
      defaultyJqrue:
        type: alicloud:log:Project
        properties:
          description: for terraform example
          name: ${projectName}
      default:
        type: alicloud:sls:MachineGroup
        properties:
          groupName: group1
          projectName: ${projectName}
          machineIdentifyType: ip
          groupAttribute:
            groupTopic: example
            externalName: example
          machineLists:
            - 192.168.1.1
    

    Create MachineGroup Resource

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

    Constructor syntax

    new MachineGroup(name: string, args: MachineGroupArgs, opts?: CustomResourceOptions);
    @overload
    def MachineGroup(resource_name: str,
                     args: MachineGroupArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def MachineGroup(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     group_name: Optional[str] = None,
                     machine_identify_type: Optional[str] = None,
                     machine_lists: Optional[Sequence[str]] = None,
                     project_name: Optional[str] = None,
                     group_attribute: Optional[MachineGroupGroupAttributeArgs] = None,
                     group_type: Optional[str] = None)
    func NewMachineGroup(ctx *Context, name string, args MachineGroupArgs, opts ...ResourceOption) (*MachineGroup, error)
    public MachineGroup(string name, MachineGroupArgs args, CustomResourceOptions? opts = null)
    public MachineGroup(String name, MachineGroupArgs args)
    public MachineGroup(String name, MachineGroupArgs args, CustomResourceOptions options)
    
    type: alicloud:sls:MachineGroup
    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 MachineGroupArgs
    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 MachineGroupArgs
    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 MachineGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MachineGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MachineGroupArgs
    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 alicloudMachineGroupResource = new AliCloud.Sls.MachineGroup("alicloudMachineGroupResource", new()
    {
        GroupName = "string",
        MachineIdentifyType = "string",
        MachineLists = new[]
        {
            "string",
        },
        ProjectName = "string",
        GroupAttribute = new AliCloud.Sls.Inputs.MachineGroupGroupAttributeArgs
        {
            ExternalName = "string",
            GroupTopic = "string",
        },
        GroupType = "string",
    });
    
    example, err := sls.NewMachineGroup(ctx, "alicloudMachineGroupResource", &sls.MachineGroupArgs{
    	GroupName:           pulumi.String("string"),
    	MachineIdentifyType: pulumi.String("string"),
    	MachineLists: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ProjectName: pulumi.String("string"),
    	GroupAttribute: &sls.MachineGroupGroupAttributeArgs{
    		ExternalName: pulumi.String("string"),
    		GroupTopic:   pulumi.String("string"),
    	},
    	GroupType: pulumi.String("string"),
    })
    
    var alicloudMachineGroupResource = new com.pulumi.alicloud.sls.MachineGroup("alicloudMachineGroupResource", com.pulumi.alicloud.sls.MachineGroupArgs.builder()
        .groupName("string")
        .machineIdentifyType("string")
        .machineLists("string")
        .projectName("string")
        .groupAttribute(MachineGroupGroupAttributeArgs.builder()
            .externalName("string")
            .groupTopic("string")
            .build())
        .groupType("string")
        .build());
    
    alicloud_machine_group_resource = alicloud.sls.MachineGroup("alicloudMachineGroupResource",
        group_name="string",
        machine_identify_type="string",
        machine_lists=["string"],
        project_name="string",
        group_attribute={
            "external_name": "string",
            "group_topic": "string",
        },
        group_type="string")
    
    const alicloudMachineGroupResource = new alicloud.sls.MachineGroup("alicloudMachineGroupResource", {
        groupName: "string",
        machineIdentifyType: "string",
        machineLists: ["string"],
        projectName: "string",
        groupAttribute: {
            externalName: "string",
            groupTopic: "string",
        },
        groupType: "string",
    });
    
    type: alicloud:sls:MachineGroup
    properties:
        groupAttribute:
            externalName: string
            groupTopic: string
        groupName: string
        groupType: string
        machineIdentifyType: string
        machineLists:
            - string
        projectName: string
    

    MachineGroup 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 MachineGroup resource accepts the following input properties:

    GroupName string
    Machine Group name
    MachineIdentifyType string
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    MachineLists List<string>
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    ProjectName string
    Project name
    GroupAttribute Pulumi.AliCloud.Sls.Inputs.MachineGroupGroupAttribute
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    GroupType string
    Machine group type, optional value is empty.
    GroupName string
    Machine Group name
    MachineIdentifyType string
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    MachineLists []string
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    ProjectName string
    Project name
    GroupAttribute MachineGroupGroupAttributeArgs
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    GroupType string
    Machine group type, optional value is empty.
    groupName String
    Machine Group name
    machineIdentifyType String
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    machineLists List<String>
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    projectName String
    Project name
    groupAttribute MachineGroupGroupAttribute
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    groupType String
    Machine group type, optional value is empty.
    groupName string
    Machine Group name
    machineIdentifyType string
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    machineLists string[]
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    projectName string
    Project name
    groupAttribute MachineGroupGroupAttribute
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    groupType string
    Machine group type, optional value is empty.
    group_name str
    Machine Group name
    machine_identify_type str
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    machine_lists Sequence[str]
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    project_name str
    Project name
    group_attribute MachineGroupGroupAttributeArgs
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    group_type str
    Machine group type, optional value is empty.
    groupName String
    Machine Group name
    machineIdentifyType String
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    machineLists List<String>
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    projectName String
    Project name
    groupAttribute Property Map
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    groupType String
    Machine group type, optional value is empty.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MachineGroup 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 MachineGroup Resource

    Get an existing MachineGroup 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?: MachineGroupState, opts?: CustomResourceOptions): MachineGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group_attribute: Optional[MachineGroupGroupAttributeArgs] = None,
            group_name: Optional[str] = None,
            group_type: Optional[str] = None,
            machine_identify_type: Optional[str] = None,
            machine_lists: Optional[Sequence[str]] = None,
            project_name: Optional[str] = None) -> MachineGroup
    func GetMachineGroup(ctx *Context, name string, id IDInput, state *MachineGroupState, opts ...ResourceOption) (*MachineGroup, error)
    public static MachineGroup Get(string name, Input<string> id, MachineGroupState? state, CustomResourceOptions? opts = null)
    public static MachineGroup get(String name, Output<String> id, MachineGroupState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:sls:MachineGroup    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.
    The following state arguments are supported:
    GroupAttribute Pulumi.AliCloud.Sls.Inputs.MachineGroupGroupAttribute
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    GroupName string
    Machine Group name
    GroupType string
    Machine group type, optional value is empty.
    MachineIdentifyType string
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    MachineLists List<string>
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    ProjectName string
    Project name
    GroupAttribute MachineGroupGroupAttributeArgs
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    GroupName string
    Machine Group name
    GroupType string
    Machine group type, optional value is empty.
    MachineIdentifyType string
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    MachineLists []string
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    ProjectName string
    Project name
    groupAttribute MachineGroupGroupAttribute
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    groupName String
    Machine Group name
    groupType String
    Machine group type, optional value is empty.
    machineIdentifyType String
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    machineLists List<String>
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    projectName String
    Project name
    groupAttribute MachineGroupGroupAttribute
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    groupName string
    Machine Group name
    groupType string
    Machine group type, optional value is empty.
    machineIdentifyType string
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    machineLists string[]
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    projectName string
    Project name
    group_attribute MachineGroupGroupAttributeArgs
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    group_name str
    Machine Group name
    group_type str
    Machine group type, optional value is empty.
    machine_identify_type str
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    machine_lists Sequence[str]
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    project_name str
    Project name
    groupAttribute Property Map
    Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See group_attribute below.
    groupName String
    Machine Group name
    groupType String
    Machine group type, optional value is empty.
    machineIdentifyType String
    Machine identification type.

    • ip: ip address Machine Group.
    • userdefined: user-defined identity Machine Group.
    machineLists List<String>
    The identification information of the machine group.

    • If machineidentifiytype is configured to ip, enter the ip address of the server.
    • If machineidentifiytype is configured to userdefined, enter a custom identifier here.
    projectName String
    Project name

    Supporting Types

    MachineGroupGroupAttribute, MachineGroupGroupAttributeArgs

    ExternalName string
    The external management system identification on which the machine group depends.
    GroupTopic string
    The log topic of the machine group.
    ExternalName string
    The external management system identification on which the machine group depends.
    GroupTopic string
    The log topic of the machine group.
    externalName String
    The external management system identification on which the machine group depends.
    groupTopic String
    The log topic of the machine group.
    externalName string
    The external management system identification on which the machine group depends.
    groupTopic string
    The log topic of the machine group.
    external_name str
    The external management system identification on which the machine group depends.
    group_topic str
    The log topic of the machine group.
    externalName String
    The external management system identification on which the machine group depends.
    groupTopic String
    The log topic of the machine group.

    Import

    Log Service (SLS) Machine Group can be imported using the id, e.g.

    $ pulumi import alicloud:sls/machineGroup:MachineGroup example <project_name>:<group_name>
    

    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.86.1 published on Saturday, Sep 27, 2025 by Pulumi