1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIsVpcAddressPrefix
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getIsVpcAddressPrefix

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Provides a read-only data source for VPC Address Prefix. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const example = ibm.getIsVpcAddressPrefix({
        vpc: ibm_is_vpc.example.id,
        addressPrefix: ibm_is_vpc_address_prefix.example.address_prefix,
    });
    const example_1 = ibm.getIsVpcAddressPrefix({
        vpcName: ibm_is_vpc.example.name,
        addressPrefix: ibm_is_vpc_address_prefix.example.address_prefix,
    });
    const example_2 = ibm.getIsVpcAddressPrefix({
        vpc: ibm_is_vpc.example.id,
        addressPrefixName: ibm_is_vpc_address_prefix.example.name,
    });
    const example_3 = ibm.getIsVpcAddressPrefix({
        vpcName: ibm_is_vpc.example.name,
        addressPrefixName: ibm_is_vpc_address_prefix.example.name,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    example = ibm.get_is_vpc_address_prefix(vpc=ibm_is_vpc["example"]["id"],
        address_prefix=ibm_is_vpc_address_prefix["example"]["address_prefix"])
    example_1 = ibm.get_is_vpc_address_prefix(vpc_name=ibm_is_vpc["example"]["name"],
        address_prefix=ibm_is_vpc_address_prefix["example"]["address_prefix"])
    example_2 = ibm.get_is_vpc_address_prefix(vpc=ibm_is_vpc["example"]["id"],
        address_prefix_name=ibm_is_vpc_address_prefix["example"]["name"])
    example_3 = ibm.get_is_vpc_address_prefix(vpc_name=ibm_is_vpc["example"]["name"],
        address_prefix_name=ibm_is_vpc_address_prefix["example"]["name"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupIsVpcAddressPrefix(ctx, &ibm.LookupIsVpcAddressPrefixArgs{
    			Vpc:           pulumi.StringRef(ibm_is_vpc.Example.Id),
    			AddressPrefix: pulumi.StringRef(ibm_is_vpc_address_prefix.Example.Address_prefix),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.LookupIsVpcAddressPrefix(ctx, &ibm.LookupIsVpcAddressPrefixArgs{
    			VpcName:       pulumi.StringRef(ibm_is_vpc.Example.Name),
    			AddressPrefix: pulumi.StringRef(ibm_is_vpc_address_prefix.Example.Address_prefix),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.LookupIsVpcAddressPrefix(ctx, &ibm.LookupIsVpcAddressPrefixArgs{
    			Vpc:               pulumi.StringRef(ibm_is_vpc.Example.Id),
    			AddressPrefixName: pulumi.StringRef(ibm_is_vpc_address_prefix.Example.Name),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.LookupIsVpcAddressPrefix(ctx, &ibm.LookupIsVpcAddressPrefixArgs{
    			VpcName:           pulumi.StringRef(ibm_is_vpc.Example.Name),
    			AddressPrefixName: pulumi.StringRef(ibm_is_vpc_address_prefix.Example.Name),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ibm.GetIsVpcAddressPrefix.Invoke(new()
        {
            Vpc = ibm_is_vpc.Example.Id,
            AddressPrefix = ibm_is_vpc_address_prefix.Example.Address_prefix,
        });
    
        var example_1 = Ibm.GetIsVpcAddressPrefix.Invoke(new()
        {
            VpcName = ibm_is_vpc.Example.Name,
            AddressPrefix = ibm_is_vpc_address_prefix.Example.Address_prefix,
        });
    
        var example_2 = Ibm.GetIsVpcAddressPrefix.Invoke(new()
        {
            Vpc = ibm_is_vpc.Example.Id,
            AddressPrefixName = ibm_is_vpc_address_prefix.Example.Name,
        });
    
        var example_3 = Ibm.GetIsVpcAddressPrefix.Invoke(new()
        {
            VpcName = ibm_is_vpc.Example.Name,
            AddressPrefixName = ibm_is_vpc_address_prefix.Example.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetIsVpcAddressPrefixArgs;
    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 example = IbmFunctions.getIsVpcAddressPrefix(GetIsVpcAddressPrefixArgs.builder()
                .vpc(ibm_is_vpc.example().id())
                .addressPrefix(ibm_is_vpc_address_prefix.example().address_prefix())
                .build());
    
            final var example-1 = IbmFunctions.getIsVpcAddressPrefix(GetIsVpcAddressPrefixArgs.builder()
                .vpcName(ibm_is_vpc.example().name())
                .addressPrefix(ibm_is_vpc_address_prefix.example().address_prefix())
                .build());
    
            final var example-2 = IbmFunctions.getIsVpcAddressPrefix(GetIsVpcAddressPrefixArgs.builder()
                .vpc(ibm_is_vpc.example().id())
                .addressPrefixName(ibm_is_vpc_address_prefix.example().name())
                .build());
    
            final var example-3 = IbmFunctions.getIsVpcAddressPrefix(GetIsVpcAddressPrefixArgs.builder()
                .vpcName(ibm_is_vpc.example().name())
                .addressPrefixName(ibm_is_vpc_address_prefix.example().name())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ibm:getIsVpcAddressPrefix
          arguments:
            vpc: ${ibm_is_vpc.example.id}
            addressPrefix: ${ibm_is_vpc_address_prefix.example.address_prefix}
      example-1:
        fn::invoke:
          function: ibm:getIsVpcAddressPrefix
          arguments:
            vpcName: ${ibm_is_vpc.example.name}
            addressPrefix: ${ibm_is_vpc_address_prefix.example.address_prefix}
      example-2:
        fn::invoke:
          function: ibm:getIsVpcAddressPrefix
          arguments:
            vpc: ${ibm_is_vpc.example.id}
            addressPrefixName: ${ibm_is_vpc_address_prefix.example.name}
      example-3:
        fn::invoke:
          function: ibm:getIsVpcAddressPrefix
          arguments:
            vpcName: ${ibm_is_vpc.example.name}
            addressPrefixName: ${ibm_is_vpc_address_prefix.example.name}
    

    Using getIsVpcAddressPrefix

    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 getIsVpcAddressPrefix(args: GetIsVpcAddressPrefixArgs, opts?: InvokeOptions): Promise<GetIsVpcAddressPrefixResult>
    function getIsVpcAddressPrefixOutput(args: GetIsVpcAddressPrefixOutputArgs, opts?: InvokeOptions): Output<GetIsVpcAddressPrefixResult>
    def get_is_vpc_address_prefix(address_prefix: Optional[str] = None,
                                  address_prefix_name: Optional[str] = None,
                                  id: Optional[str] = None,
                                  vpc: Optional[str] = None,
                                  vpc_name: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetIsVpcAddressPrefixResult
    def get_is_vpc_address_prefix_output(address_prefix: Optional[pulumi.Input[str]] = None,
                                  address_prefix_name: Optional[pulumi.Input[str]] = None,
                                  id: Optional[pulumi.Input[str]] = None,
                                  vpc: Optional[pulumi.Input[str]] = None,
                                  vpc_name: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetIsVpcAddressPrefixResult]
    func LookupIsVpcAddressPrefix(ctx *Context, args *LookupIsVpcAddressPrefixArgs, opts ...InvokeOption) (*LookupIsVpcAddressPrefixResult, error)
    func LookupIsVpcAddressPrefixOutput(ctx *Context, args *LookupIsVpcAddressPrefixOutputArgs, opts ...InvokeOption) LookupIsVpcAddressPrefixResultOutput

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

    public static class GetIsVpcAddressPrefix 
    {
        public static Task<GetIsVpcAddressPrefixResult> InvokeAsync(GetIsVpcAddressPrefixArgs args, InvokeOptions? opts = null)
        public static Output<GetIsVpcAddressPrefixResult> Invoke(GetIsVpcAddressPrefixInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIsVpcAddressPrefixResult> getIsVpcAddressPrefix(GetIsVpcAddressPrefixArgs args, InvokeOptions options)
    public static Output<GetIsVpcAddressPrefixResult> getIsVpcAddressPrefix(GetIsVpcAddressPrefixArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIsVpcAddressPrefix:getIsVpcAddressPrefix
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AddressPrefix string
    The address prefix identifier.
    AddressPrefixName string

    The address prefix name.

    Note: Provide exactly one of address_prefix, address_prefix_name

    Id string
    (String) The unique identifier of the AddressPrefix.
    Vpc string
    The VPC identifier
    VpcName string

    Name of the VPC

    Note: Provide exactly one of vpc, vpc_name

    AddressPrefix string
    The address prefix identifier.
    AddressPrefixName string

    The address prefix name.

    Note: Provide exactly one of address_prefix, address_prefix_name

    Id string
    (String) The unique identifier of the AddressPrefix.
    Vpc string
    The VPC identifier
    VpcName string

    Name of the VPC

    Note: Provide exactly one of vpc, vpc_name

    addressPrefix String
    The address prefix identifier.
    addressPrefixName String

    The address prefix name.

    Note: Provide exactly one of address_prefix, address_prefix_name

    id String
    (String) The unique identifier of the AddressPrefix.
    vpc String
    The VPC identifier
    vpcName String

    Name of the VPC

    Note: Provide exactly one of vpc, vpc_name

    addressPrefix string
    The address prefix identifier.
    addressPrefixName string

    The address prefix name.

    Note: Provide exactly one of address_prefix, address_prefix_name

    id string
    (String) The unique identifier of the AddressPrefix.
    vpc string
    The VPC identifier
    vpcName string

    Name of the VPC

    Note: Provide exactly one of vpc, vpc_name

    address_prefix str
    The address prefix identifier.
    address_prefix_name str

    The address prefix name.

    Note: Provide exactly one of address_prefix, address_prefix_name

    id str
    (String) The unique identifier of the AddressPrefix.
    vpc str
    The VPC identifier
    vpc_name str

    Name of the VPC

    Note: Provide exactly one of vpc, vpc_name

    addressPrefix String
    The address prefix identifier.
    addressPrefixName String

    The address prefix name.

    Note: Provide exactly one of address_prefix, address_prefix_name

    id String
    (String) The unique identifier of the AddressPrefix.
    vpc String
    The VPC identifier
    vpcName String

    Name of the VPC

    Note: Provide exactly one of vpc, vpc_name

    getIsVpcAddressPrefix Result

    The following output properties are available:

    Cidr string
    (String) The CIDR block for this prefix.
    CreatedAt string
    (String) The date and time that the prefix was created.
    HasSubnets bool
    (Boolean) Indicates whether subnets exist with addresses from this prefix.
    Href string
    (String) The URL for this zone.
    Id string
    (String) The unique identifier of the AddressPrefix.
    IsDefault bool
    (Boolean) Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.
    Name string
    (String) The globally unique name for this zone.
    Zones List<GetIsVpcAddressPrefixZone>
    (List) The zone this address prefix resides in. Nested scheme for zone:
    AddressPrefix string
    AddressPrefixName string
    Vpc string
    VpcName string
    Cidr string
    (String) The CIDR block for this prefix.
    CreatedAt string
    (String) The date and time that the prefix was created.
    HasSubnets bool
    (Boolean) Indicates whether subnets exist with addresses from this prefix.
    Href string
    (String) The URL for this zone.
    Id string
    (String) The unique identifier of the AddressPrefix.
    IsDefault bool
    (Boolean) Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.
    Name string
    (String) The globally unique name for this zone.
    Zones []GetIsVpcAddressPrefixZone
    (List) The zone this address prefix resides in. Nested scheme for zone:
    AddressPrefix string
    AddressPrefixName string
    Vpc string
    VpcName string
    cidr String
    (String) The CIDR block for this prefix.
    createdAt String
    (String) The date and time that the prefix was created.
    hasSubnets Boolean
    (Boolean) Indicates whether subnets exist with addresses from this prefix.
    href String
    (String) The URL for this zone.
    id String
    (String) The unique identifier of the AddressPrefix.
    isDefault Boolean
    (Boolean) Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.
    name String
    (String) The globally unique name for this zone.
    zones List<GetIsVpcAddressPrefixZone>
    (List) The zone this address prefix resides in. Nested scheme for zone:
    addressPrefix String
    addressPrefixName String
    vpc String
    vpcName String
    cidr string
    (String) The CIDR block for this prefix.
    createdAt string
    (String) The date and time that the prefix was created.
    hasSubnets boolean
    (Boolean) Indicates whether subnets exist with addresses from this prefix.
    href string
    (String) The URL for this zone.
    id string
    (String) The unique identifier of the AddressPrefix.
    isDefault boolean
    (Boolean) Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.
    name string
    (String) The globally unique name for this zone.
    zones GetIsVpcAddressPrefixZone[]
    (List) The zone this address prefix resides in. Nested scheme for zone:
    addressPrefix string
    addressPrefixName string
    vpc string
    vpcName string
    cidr str
    (String) The CIDR block for this prefix.
    created_at str
    (String) The date and time that the prefix was created.
    has_subnets bool
    (Boolean) Indicates whether subnets exist with addresses from this prefix.
    href str
    (String) The URL for this zone.
    id str
    (String) The unique identifier of the AddressPrefix.
    is_default bool
    (Boolean) Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.
    name str
    (String) The globally unique name for this zone.
    zones Sequence[GetIsVpcAddressPrefixZone]
    (List) The zone this address prefix resides in. Nested scheme for zone:
    address_prefix str
    address_prefix_name str
    vpc str
    vpc_name str
    cidr String
    (String) The CIDR block for this prefix.
    createdAt String
    (String) The date and time that the prefix was created.
    hasSubnets Boolean
    (Boolean) Indicates whether subnets exist with addresses from this prefix.
    href String
    (String) The URL for this zone.
    id String
    (String) The unique identifier of the AddressPrefix.
    isDefault Boolean
    (Boolean) Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of randomly-selected words, but may be updated with a user-specified name.
    name String
    (String) The globally unique name for this zone.
    zones List<Property Map>
    (List) The zone this address prefix resides in. Nested scheme for zone:
    addressPrefix String
    addressPrefixName String
    vpc String
    vpcName String

    Supporting Types

    GetIsVpcAddressPrefixZone

    Href string
    (String) The URL for this zone.
    Name string
    (String) The globally unique name for this zone.
    Href string
    (String) The URL for this zone.
    Name string
    (String) The globally unique name for this zone.
    href String
    (String) The URL for this zone.
    name String
    (String) The globally unique name for this zone.
    href string
    (String) The URL for this zone.
    name string
    (String) The globally unique name for this zone.
    href str
    (String) The URL for this zone.
    name str
    (String) The globally unique name for this zone.
    href String
    (String) The URL for this zone.
    name String
    (String) The globally unique name for this zone.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud