1. Packages
  2. Nutanix
  3. API Docs
  4. ServiceGroup
Nutanix v0.5.0 published on Monday, Nov 4, 2024 by Piers Karsenbarg

nutanix.ServiceGroup

Explore with Pulumi AI

nutanix logo
Nutanix v0.5.0 published on Monday, Nov 4, 2024 by Piers Karsenbarg

    Provides a resource to create a service group based on the input parameters.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nutanix from "@pierskarsenbarg/nutanix";
    
    const test = new nutanix.ServiceGroup("test", {
        description: "this is service group",
        serviceLists: [{
            protocol: "TCP",
            tcpPortRangeLists: [
                {
                    endPort: 22,
                    startPort: 22,
                },
                {
                    endPort: 2222,
                    startPort: 2222,
                },
            ],
        }],
    });
    
    import pulumi
    import pulumi_nutanix as nutanix
    
    test = nutanix.ServiceGroup("test",
        description="this is service group",
        service_lists=[{
            "protocol": "TCP",
            "tcp_port_range_lists": [
                {
                    "end_port": 22,
                    "start_port": 22,
                },
                {
                    "end_port": 2222,
                    "start_port": 2222,
                },
            ],
        }])
    
    package main
    
    import (
    	"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nutanix.NewServiceGroup(ctx, "test", &nutanix.ServiceGroupArgs{
    			Description: pulumi.String("this is service group"),
    			ServiceLists: nutanix.ServiceGroupServiceListArray{
    				&nutanix.ServiceGroupServiceListArgs{
    					Protocol: pulumi.String("TCP"),
    					TcpPortRangeLists: nutanix.ServiceGroupServiceListTcpPortRangeListArray{
    						&nutanix.ServiceGroupServiceListTcpPortRangeListArgs{
    							EndPort:   pulumi.Int(22),
    							StartPort: pulumi.Int(22),
    						},
    						&nutanix.ServiceGroupServiceListTcpPortRangeListArgs{
    							EndPort:   pulumi.Int(2222),
    							StartPort: pulumi.Int(2222),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nutanix = PiersKarsenbarg.Nutanix;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Nutanix.ServiceGroup("test", new()
        {
            Description = "this is service group",
            ServiceLists = new[]
            {
                new Nutanix.Inputs.ServiceGroupServiceListArgs
                {
                    Protocol = "TCP",
                    TcpPortRangeLists = new[]
                    {
                        new Nutanix.Inputs.ServiceGroupServiceListTcpPortRangeListArgs
                        {
                            EndPort = 22,
                            StartPort = 22,
                        },
                        new Nutanix.Inputs.ServiceGroupServiceListTcpPortRangeListArgs
                        {
                            EndPort = 2222,
                            StartPort = 2222,
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nutanix.ServiceGroup;
    import com.pulumi.nutanix.ServiceGroupArgs;
    import com.pulumi.nutanix.inputs.ServiceGroupServiceListArgs;
    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 test = new ServiceGroup("test", ServiceGroupArgs.builder()
                .description("this is service group")
                .serviceLists(ServiceGroupServiceListArgs.builder()
                    .protocol("TCP")
                    .tcpPortRangeLists(                
                        ServiceGroupServiceListTcpPortRangeListArgs.builder()
                            .endPort(22)
                            .startPort(22)
                            .build(),
                        ServiceGroupServiceListTcpPortRangeListArgs.builder()
                            .endPort(2222)
                            .startPort(2222)
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      test:
        type: nutanix:ServiceGroup
        properties:
          description: this is service group
          serviceLists:
            - protocol: TCP
              tcpPortRangeLists:
                - endPort: 22
                  startPort: 22
                - endPort: 2222
                  startPort: 2222
    

    Create ServiceGroup Resource

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

    Constructor syntax

    new ServiceGroup(name: string, args: ServiceGroupArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceGroup(resource_name: str,
                     args: ServiceGroupArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceGroup(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     service_lists: Optional[Sequence[ServiceGroupServiceListArgs]] = None,
                     description: Optional[str] = None,
                     name: Optional[str] = None)
    func NewServiceGroup(ctx *Context, name string, args ServiceGroupArgs, opts ...ResourceOption) (*ServiceGroup, error)
    public ServiceGroup(string name, ServiceGroupArgs args, CustomResourceOptions? opts = null)
    public ServiceGroup(String name, ServiceGroupArgs args)
    public ServiceGroup(String name, ServiceGroupArgs args, CustomResourceOptions options)
    
    type: nutanix:ServiceGroup
    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 ServiceGroupArgs
    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 ServiceGroupArgs
    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 ServiceGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceGroupArgs
    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 serviceGroupResource = new Nutanix.ServiceGroup("serviceGroupResource", new()
    {
        ServiceLists = new[]
        {
            new Nutanix.Inputs.ServiceGroupServiceListArgs
            {
                IcmpTypeCodeLists = new[]
                {
                    new Nutanix.Inputs.ServiceGroupServiceListIcmpTypeCodeListArgs
                    {
                        Code = "string",
                        Type = "string",
                    },
                },
                Protocol = "string",
                TcpPortRangeLists = new[]
                {
                    new Nutanix.Inputs.ServiceGroupServiceListTcpPortRangeListArgs
                    {
                        EndPort = 0,
                        StartPort = 0,
                    },
                },
                UdpPortRangeLists = new[]
                {
                    new Nutanix.Inputs.ServiceGroupServiceListUdpPortRangeListArgs
                    {
                        EndPort = 0,
                        StartPort = 0,
                    },
                },
            },
        },
        Description = "string",
        Name = "string",
    });
    
    example, err := nutanix.NewServiceGroup(ctx, "serviceGroupResource", &nutanix.ServiceGroupArgs{
    	ServiceLists: nutanix.ServiceGroupServiceListArray{
    		&nutanix.ServiceGroupServiceListArgs{
    			IcmpTypeCodeLists: nutanix.ServiceGroupServiceListIcmpTypeCodeListArray{
    				&nutanix.ServiceGroupServiceListIcmpTypeCodeListArgs{
    					Code: pulumi.String("string"),
    					Type: pulumi.String("string"),
    				},
    			},
    			Protocol: pulumi.String("string"),
    			TcpPortRangeLists: nutanix.ServiceGroupServiceListTcpPortRangeListArray{
    				&nutanix.ServiceGroupServiceListTcpPortRangeListArgs{
    					EndPort:   pulumi.Int(0),
    					StartPort: pulumi.Int(0),
    				},
    			},
    			UdpPortRangeLists: nutanix.ServiceGroupServiceListUdpPortRangeListArray{
    				&nutanix.ServiceGroupServiceListUdpPortRangeListArgs{
    					EndPort:   pulumi.Int(0),
    					StartPort: pulumi.Int(0),
    				},
    			},
    		},
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var serviceGroupResource = new ServiceGroup("serviceGroupResource", ServiceGroupArgs.builder()
        .serviceLists(ServiceGroupServiceListArgs.builder()
            .icmpTypeCodeLists(ServiceGroupServiceListIcmpTypeCodeListArgs.builder()
                .code("string")
                .type("string")
                .build())
            .protocol("string")
            .tcpPortRangeLists(ServiceGroupServiceListTcpPortRangeListArgs.builder()
                .endPort(0)
                .startPort(0)
                .build())
            .udpPortRangeLists(ServiceGroupServiceListUdpPortRangeListArgs.builder()
                .endPort(0)
                .startPort(0)
                .build())
            .build())
        .description("string")
        .name("string")
        .build());
    
    service_group_resource = nutanix.ServiceGroup("serviceGroupResource",
        service_lists=[{
            "icmp_type_code_lists": [{
                "code": "string",
                "type": "string",
            }],
            "protocol": "string",
            "tcp_port_range_lists": [{
                "end_port": 0,
                "start_port": 0,
            }],
            "udp_port_range_lists": [{
                "end_port": 0,
                "start_port": 0,
            }],
        }],
        description="string",
        name="string")
    
    const serviceGroupResource = new nutanix.ServiceGroup("serviceGroupResource", {
        serviceLists: [{
            icmpTypeCodeLists: [{
                code: "string",
                type: "string",
            }],
            protocol: "string",
            tcpPortRangeLists: [{
                endPort: 0,
                startPort: 0,
            }],
            udpPortRangeLists: [{
                endPort: 0,
                startPort: 0,
            }],
        }],
        description: "string",
        name: "string",
    });
    
    type: nutanix:ServiceGroup
    properties:
        description: string
        name: string
        serviceLists:
            - icmpTypeCodeLists:
                - code: string
                  type: string
              protocol: string
              tcpPortRangeLists:
                - endPort: 0
                  startPort: 0
              udpPortRangeLists:
                - endPort: 0
                  startPort: 0
    

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

    ServiceLists List<PiersKarsenbarg.Nutanix.Inputs.ServiceGroupServiceList>
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    Description string
    • (Optional) Description of the service group
    Name string
    • (Required) Name of the service group
    ServiceLists []ServiceGroupServiceListArgs
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    Description string
    • (Optional) Description of the service group
    Name string
    • (Required) Name of the service group
    serviceLists List<ServiceGroupServiceList>
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    description String
    • (Optional) Description of the service group
    name String
    • (Required) Name of the service group
    serviceLists ServiceGroupServiceList[]
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    description string
    • (Optional) Description of the service group
    name string
    • (Required) Name of the service group
    service_lists Sequence[ServiceGroupServiceListArgs]
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    description str
    • (Optional) Description of the service group
    name str
    • (Required) Name of the service group
    serviceLists List<Property Map>
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    description String
    • (Optional) Description of the service group
    name String
    • (Required) Name of the service group

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    SystemDefined bool
    • (ReadOnly) boolean value to denote if the service group is system defined
    Id string
    The provider-assigned unique ID for this managed resource.
    SystemDefined bool
    • (ReadOnly) boolean value to denote if the service group is system defined
    id String
    The provider-assigned unique ID for this managed resource.
    systemDefined Boolean
    • (ReadOnly) boolean value to denote if the service group is system defined
    id string
    The provider-assigned unique ID for this managed resource.
    systemDefined boolean
    • (ReadOnly) boolean value to denote if the service group is system defined
    id str
    The provider-assigned unique ID for this managed resource.
    system_defined bool
    • (ReadOnly) boolean value to denote if the service group is system defined
    id String
    The provider-assigned unique ID for this managed resource.
    systemDefined Boolean
    • (ReadOnly) boolean value to denote if the service group is system defined

    Look up Existing ServiceGroup Resource

    Get an existing ServiceGroup 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?: ServiceGroupState, opts?: CustomResourceOptions): ServiceGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            service_lists: Optional[Sequence[ServiceGroupServiceListArgs]] = None,
            system_defined: Optional[bool] = None) -> ServiceGroup
    func GetServiceGroup(ctx *Context, name string, id IDInput, state *ServiceGroupState, opts ...ResourceOption) (*ServiceGroup, error)
    public static ServiceGroup Get(string name, Input<string> id, ServiceGroupState? state, CustomResourceOptions? opts = null)
    public static ServiceGroup get(String name, Output<String> id, ServiceGroupState 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:
    Description string
    • (Optional) Description of the service group
    Name string
    • (Required) Name of the service group
    ServiceLists List<PiersKarsenbarg.Nutanix.Inputs.ServiceGroupServiceList>
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    SystemDefined bool
    • (ReadOnly) boolean value to denote if the service group is system defined
    Description string
    • (Optional) Description of the service group
    Name string
    • (Required) Name of the service group
    ServiceLists []ServiceGroupServiceListArgs
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    SystemDefined bool
    • (ReadOnly) boolean value to denote if the service group is system defined
    description String
    • (Optional) Description of the service group
    name String
    • (Required) Name of the service group
    serviceLists List<ServiceGroupServiceList>
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    systemDefined Boolean
    • (ReadOnly) boolean value to denote if the service group is system defined
    description string
    • (Optional) Description of the service group
    name string
    • (Required) Name of the service group
    serviceLists ServiceGroupServiceList[]
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    systemDefined boolean
    • (ReadOnly) boolean value to denote if the service group is system defined
    description str
    • (Optional) Description of the service group
    name str
    • (Required) Name of the service group
    service_lists Sequence[ServiceGroupServiceListArgs]
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    system_defined bool
    • (ReadOnly) boolean value to denote if the service group is system defined
    description String
    • (Optional) Description of the service group
    name String
    • (Required) Name of the service group
    serviceLists List<Property Map>
    • (Required) list of services which have protocol (TCP / UDP / ICMP) along with port details
    systemDefined Boolean
    • (ReadOnly) boolean value to denote if the service group is system defined

    Supporting Types

    ServiceGroupServiceList, ServiceGroupServiceListArgs

    IcmpTypeCodeLists []ServiceGroupServiceListIcmpTypeCodeList
    • (Optional) ICMP type code list
    Protocol string
    • (Optional) The UserPrincipalName of the user from the directory service.
    TcpPortRangeLists []ServiceGroupServiceListTcpPortRangeList
    • (Optional) TCP Port range list
    UdpPortRangeLists []ServiceGroupServiceListUdpPortRangeList
    • (Optional) UDP port range list
    icmpTypeCodeLists List<ServiceGroupServiceListIcmpTypeCodeList>
    • (Optional) ICMP type code list
    protocol String
    • (Optional) The UserPrincipalName of the user from the directory service.
    tcpPortRangeLists List<ServiceGroupServiceListTcpPortRangeList>
    • (Optional) TCP Port range list
    udpPortRangeLists List<ServiceGroupServiceListUdpPortRangeList>
    • (Optional) UDP port range list
    icmpTypeCodeLists ServiceGroupServiceListIcmpTypeCodeList[]
    • (Optional) ICMP type code list
    protocol string
    • (Optional) The UserPrincipalName of the user from the directory service.
    tcpPortRangeLists ServiceGroupServiceListTcpPortRangeList[]
    • (Optional) TCP Port range list
    udpPortRangeLists ServiceGroupServiceListUdpPortRangeList[]
    • (Optional) UDP port range list
    icmp_type_code_lists Sequence[ServiceGroupServiceListIcmpTypeCodeList]
    • (Optional) ICMP type code list
    protocol str
    • (Optional) The UserPrincipalName of the user from the directory service.
    tcp_port_range_lists Sequence[ServiceGroupServiceListTcpPortRangeList]
    • (Optional) TCP Port range list
    udp_port_range_lists Sequence[ServiceGroupServiceListUdpPortRangeList]
    • (Optional) UDP port range list
    icmpTypeCodeLists List<Property Map>
    • (Optional) ICMP type code list
    protocol String
    • (Optional) The UserPrincipalName of the user from the directory service.
    tcpPortRangeLists List<Property Map>
    • (Optional) TCP Port range list
    udpPortRangeLists List<Property Map>
    • (Optional) UDP port range list

    ServiceGroupServiceListIcmpTypeCodeList, ServiceGroupServiceListIcmpTypeCodeListArgs

    Code string
    • (Optional) Code as text
    Type string
    • (Optional) Type as text
    Code string
    • (Optional) Code as text
    Type string
    • (Optional) Type as text
    code String
    • (Optional) Code as text
    type String
    • (Optional) Type as text
    code string
    • (Optional) Code as text
    type string
    • (Optional) Type as text
    code str
    • (Optional) Code as text
    type str
    • (Optional) Type as text
    code String
    • (Optional) Code as text
    type String
    • (Optional) Type as text

    ServiceGroupServiceListTcpPortRangeList, ServiceGroupServiceListTcpPortRangeListArgs

    endPort Integer
    startPort Integer
    endPort number
    startPort number
    endPort Number
    startPort Number

    ServiceGroupServiceListUdpPortRangeList, ServiceGroupServiceListUdpPortRangeListArgs

    endPort Integer
    startPort Integer
    endPort number
    startPort number
    endPort Number
    startPort Number

    Package Details

    Repository
    nutanix pierskarsenbarg/pulumi-nutanix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nutanix Terraform Provider.
    nutanix logo
    Nutanix v0.5.0 published on Monday, Nov 4, 2024 by Piers Karsenbarg