1. Packages
  2. Nutanix
  3. API Docs
  4. getAddressGroup
Nutanix v0.5.1 published on Monday, Nov 25, 2024 by Piers Karsenbarg

nutanix.getAddressGroup

Explore with Pulumi AI

nutanix logo
Nutanix v0.5.1 published on Monday, Nov 25, 2024 by Piers Karsenbarg

    Provides a datasource to retrieve a address group.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nutanix from "@pierskarsenbarg/nutanix";
    import * as nutanix from "@pulumi/nutanix";
    
    const testAddress = new nutanix.AddressGroup("testAddress", {
        description: "test address groups resource",
        ipAddressBlockLists: [{
            ip: "10.0.0.0",
            prefixLength: 24,
        }],
    });
    const addrGroup = nutanix.getAddressGroupOutput({
        uuid: testAddress.id,
    });
    
    import pulumi
    import pulumi_nutanix as nutanix
    
    test_address = nutanix.AddressGroup("testAddress",
        description="test address groups resource",
        ip_address_block_lists=[{
            "ip": "10.0.0.0",
            "prefix_length": 24,
        }])
    addr_group = nutanix.get_address_group_output(uuid=test_address.id)
    
    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 {
    		testAddress, err := nutanix.NewAddressGroup(ctx, "testAddress", &nutanix.AddressGroupArgs{
    			Description: pulumi.String("test address groups resource"),
    			IpAddressBlockLists: nutanix.AddressGroupIpAddressBlockListArray{
    				&nutanix.AddressGroupIpAddressBlockListArgs{
    					Ip:           pulumi.String("10.0.0.0"),
    					PrefixLength: pulumi.Int(24),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_ = nutanix.LookupAddressGroupOutput(ctx, nutanix.GetAddressGroupOutputArgs{
    			Uuid: testAddress.ID(),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nutanix = PiersKarsenbarg.Nutanix;
    using Nutanix = Pulumi.Nutanix;
    
    return await Deployment.RunAsync(() => 
    {
        var testAddress = new Nutanix.AddressGroup("testAddress", new()
        {
            Description = "test address groups resource",
            IpAddressBlockLists = new[]
            {
                new Nutanix.Inputs.AddressGroupIpAddressBlockListArgs
                {
                    Ip = "10.0.0.0",
                    PrefixLength = 24,
                },
            },
        });
    
        var addrGroup = Nutanix.GetAddressGroup.Invoke(new()
        {
            Uuid = testAddress.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nutanix.AddressGroup;
    import com.pulumi.nutanix.AddressGroupArgs;
    import com.pulumi.nutanix.inputs.AddressGroupIpAddressBlockListArgs;
    import com.pulumi.nutanix.NutanixFunctions;
    import com.pulumi.nutanix.inputs.GetAddressGroupArgs;
    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 testAddress = new AddressGroup("testAddress", AddressGroupArgs.builder()
                .description("test address groups resource")
                .ipAddressBlockLists(AddressGroupIpAddressBlockListArgs.builder()
                    .ip("10.0.0.0")
                    .prefixLength(24)
                    .build())
                .build());
    
            final var addrGroup = NutanixFunctions.getAddressGroup(GetAddressGroupArgs.builder()
                .uuid(testAddress.id())
                .build());
    
        }
    }
    
    resources:
      testAddress:
        type: nutanix:AddressGroup
        properties:
          description: test address groups resource
          ipAddressBlockLists:
            - ip: 10.0.0.0
              prefixLength: 24
    variables:
      addrGroup:
        fn::invoke:
          Function: nutanix:getAddressGroup
          Arguments:
            uuid: ${testAddress.id}
    

    Using getAddressGroup

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getAddressGroup(args: GetAddressGroupArgs, opts?: InvokeOptions): Promise<GetAddressGroupResult>
    function getAddressGroupOutput(args: GetAddressGroupOutputArgs, opts?: InvokeOptions): Output<GetAddressGroupResult>
    def get_address_group(uuid: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetAddressGroupResult
    def get_address_group_output(uuid: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetAddressGroupResult]
    func LookupAddressGroup(ctx *Context, args *LookupAddressGroupArgs, opts ...InvokeOption) (*LookupAddressGroupResult, error)
    func LookupAddressGroupOutput(ctx *Context, args *LookupAddressGroupOutputArgs, opts ...InvokeOption) LookupAddressGroupResultOutput

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

    public static class GetAddressGroup 
    {
        public static Task<GetAddressGroupResult> InvokeAsync(GetAddressGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetAddressGroupResult> Invoke(GetAddressGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAddressGroupResult> getAddressGroup(GetAddressGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: nutanix:index/getAddressGroup:getAddressGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Uuid string
    • (Required) UUID of the address group
    Uuid string
    • (Required) UUID of the address group
    uuid String
    • (Required) UUID of the address group
    uuid string
    • (Required) UUID of the address group
    uuid str
    • (Required) UUID of the address group
    uuid String
    • (Required) UUID of the address group

    getAddressGroup Result

    The following output properties are available:

    AddressGroupString string
    • (ReadOnly) Address Group string
    Description string
    • (ReadOnly) Description of the address group
    Id string
    The provider-assigned unique ID for this managed resource.
    IpAddressBlockLists List<PiersKarsenbarg.Nutanix.Outputs.GetAddressGroupIpAddressBlockList>
    • (ReadOnly) list of IP address blocks with their prefix length
    Name string
    • (ReadOnly) Name of the address group
    Uuid string
    • (Required) UUID of the address group
    AddressGroupString string
    • (ReadOnly) Address Group string
    Description string
    • (ReadOnly) Description of the address group
    Id string
    The provider-assigned unique ID for this managed resource.
    IpAddressBlockLists []GetAddressGroupIpAddressBlockList
    • (ReadOnly) list of IP address blocks with their prefix length
    Name string
    • (ReadOnly) Name of the address group
    Uuid string
    • (Required) UUID of the address group
    addressGroupString String
    • (ReadOnly) Address Group string
    description String
    • (ReadOnly) Description of the address group
    id String
    The provider-assigned unique ID for this managed resource.
    ipAddressBlockLists List<GetAddressGroupIpAddressBlockList>
    • (ReadOnly) list of IP address blocks with their prefix length
    name String
    • (ReadOnly) Name of the address group
    uuid String
    • (Required) UUID of the address group
    addressGroupString string
    • (ReadOnly) Address Group string
    description string
    • (ReadOnly) Description of the address group
    id string
    The provider-assigned unique ID for this managed resource.
    ipAddressBlockLists GetAddressGroupIpAddressBlockList[]
    • (ReadOnly) list of IP address blocks with their prefix length
    name string
    • (ReadOnly) Name of the address group
    uuid string
    • (Required) UUID of the address group
    address_group_string str
    • (ReadOnly) Address Group string
    description str
    • (ReadOnly) Description of the address group
    id str
    The provider-assigned unique ID for this managed resource.
    ip_address_block_lists Sequence[GetAddressGroupIpAddressBlockList]
    • (ReadOnly) list of IP address blocks with their prefix length
    name str
    • (ReadOnly) Name of the address group
    uuid str
    • (Required) UUID of the address group
    addressGroupString String
    • (ReadOnly) Address Group string
    description String
    • (ReadOnly) Description of the address group
    id String
    The provider-assigned unique ID for this managed resource.
    ipAddressBlockLists List<Property Map>
    • (ReadOnly) list of IP address blocks with their prefix length
    name String
    • (ReadOnly) Name of the address group
    uuid String
    • (Required) UUID of the address group

    Supporting Types

    GetAddressGroupIpAddressBlockList

    Ip string
    • (ReadOnly) IP of the address block
    PrefixLength int
    • (ReadOnly) Prefix length of address block in int
    Ip string
    • (ReadOnly) IP of the address block
    PrefixLength int
    • (ReadOnly) Prefix length of address block in int
    ip String
    • (ReadOnly) IP of the address block
    prefixLength Integer
    • (ReadOnly) Prefix length of address block in int
    ip string
    • (ReadOnly) IP of the address block
    prefixLength number
    • (ReadOnly) Prefix length of address block in int
    ip str
    • (ReadOnly) IP of the address block
    prefix_length int
    • (ReadOnly) Prefix length of address block in int
    ip String
    • (ReadOnly) IP of the address block
    prefixLength Number
    • (ReadOnly) Prefix length of address block in int

    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.1 published on Monday, Nov 25, 2024 by Piers Karsenbarg