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
📚 Need more examples? VIEW MORE EXAMPLES
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:
- Group
Name string - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- Machine
Identify stringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- Machine
Lists 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.
- Project
Name string - The name of the project.
- Group
Attribute Pulumi.Ali Cloud. Sls. Inputs. Machine Group Group Attribute - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - Group
Type string - The type of the machine group. Set the value to an empty string.
- Group
Name string - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- Machine
Identify stringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- Machine
Lists []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.
- Project
Name string - The name of the project.
- Group
Attribute MachineGroup Group Attribute Args - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - Group
Type string - The type of the machine group. Set the value to an empty string.
- group
Name String - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- machine
Identify StringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- machine
Lists 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.
- project
Name String - The name of the project.
- group
Attribute MachineGroup Group Attribute - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - group
Type String - The type of the machine group. Set the value to an empty string.
- group
Name string - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- machine
Identify stringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- machine
Lists 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.
- project
Name string - The name of the project.
- group
Attribute MachineGroup Group Attribute - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - group
Type string - The type of the machine group. Set the value to an empty string.
- group_
name str - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- machine_
identify_ strtype - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- 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 - The name of the project.
- group_
attribute MachineGroup Group Attribute Args - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - group_
type str - The type of the machine group. Set the value to an empty string.
- group
Name String - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- machine
Identify StringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- machine
Lists 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.
- project
Name String - The name of the project.
- group
Attribute Property Map - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - group
Type String - The type of the machine group. Set the value to an empty string.
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) -> MachineGroupfunc 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.
- Group
Attribute Pulumi.Ali Cloud. Sls. Inputs. Machine Group Group Attribute - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - Group
Name string - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- Group
Type string - The type of the machine group. Set the value to an empty string.
- Machine
Identify stringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- Machine
Lists 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.
- Project
Name string - The name of the project.
- Group
Attribute MachineGroup Group Attribute Args - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - Group
Name string - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- Group
Type string - The type of the machine group. Set the value to an empty string.
- Machine
Identify stringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- Machine
Lists []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.
- Project
Name string - The name of the project.
- group
Attribute MachineGroup Group Attribute - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - group
Name String - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- group
Type String - The type of the machine group. Set the value to an empty string.
- machine
Identify StringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- machine
Lists 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.
- project
Name String - The name of the project.
- group
Attribute MachineGroup Group Attribute - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - group
Name string - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- group
Type string - The type of the machine group. Set the value to an empty string.
- machine
Identify stringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- machine
Lists 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.
- project
Name string - The name of the project.
- group_
attribute MachineGroup Group Attribute Args - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - group_
name str - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- group_
type str - The type of the machine group. Set the value to an empty string.
- machine_
identify_ strtype - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- 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 - The name of the project.
- group
Attribute Property Map - Properties of machine groups. For details, please refer to the groupAttribute parameter description in the following table. See
group_attributebelow. - group
Name String - The name of the machine group. The name must meet the following requirements:
- The name of each machine group in a project must be unique.
- It can contain only lowercase letters, digits, hyphens (-), and underscores (_).
- It must start and end with a lowercase letter or a digit.
- It must be 3 to 128 characters in length.
- group
Type String - The type of the machine group. Set the value to an empty string.
- machine
Identify StringType - The identifier type of the machine group. Valid values:
- ip: The machine group uses IP addresses as identifiers.
- userdefined: The machine group uses custom identifiers.
- machine
Lists 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.
- project
Name String - The name of the project.
Supporting Types
MachineGroupGroupAttribute, MachineGroupGroupAttributeArgs
- External
Name string - The identifier of the external management system on which the machine group depends. This parameter is empty by default.
- Group
Topic string - The log topic of the machine group.
- External
Name string - The identifier of the external management system on which the machine group depends. This parameter is empty by default.
- Group
Topic string - The log topic of the machine group.
- external
Name String - The identifier of the external management system on which the machine group depends. This parameter is empty by default.
- group
Topic String - The log topic of the machine group.
- external
Name string - The identifier of the external management system on which the machine group depends. This parameter is empty by default.
- group
Topic string - The log topic of the machine group.
- external_
name str - The identifier of the external management system on which the machine group depends. This parameter is empty by default.
- group_
topic str - The log topic of the machine group.
- external
Name String - The identifier of the external management system on which the machine group depends. This parameter is empty by default.
- group
Topic 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
alicloudTerraform Provider.
