1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. PublicDelegatedPrefix
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

gcp.compute.PublicDelegatedPrefix

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

    Represents a PublicDelegatedPrefix for use with bring your own IP addresses (BYOIP).

    To get more information about PublicDelegatedPrefix, see:

    Example Usage

    Public Delegated Prefixes Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const advertised = new gcp.compute.PublicAdvertisedPrefix("advertised", {
        name: "my-prefix",
        description: "description",
        dnsVerificationIp: "127.127.0.0",
        ipCidrRange: "127.127.0.0/16",
    });
    const prefixes = new gcp.compute.PublicDelegatedPrefix("prefixes", {
        name: "my-prefix",
        region: "us-central1",
        description: "my description",
        ipCidrRange: "127.127.0.0/24",
        parentPrefix: advertised.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    advertised = gcp.compute.PublicAdvertisedPrefix("advertised",
        name="my-prefix",
        description="description",
        dns_verification_ip="127.127.0.0",
        ip_cidr_range="127.127.0.0/16")
    prefixes = gcp.compute.PublicDelegatedPrefix("prefixes",
        name="my-prefix",
        region="us-central1",
        description="my description",
        ip_cidr_range="127.127.0.0/24",
        parent_prefix=advertised.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		advertised, err := compute.NewPublicAdvertisedPrefix(ctx, "advertised", &compute.PublicAdvertisedPrefixArgs{
    			Name:              pulumi.String("my-prefix"),
    			Description:       pulumi.String("description"),
    			DnsVerificationIp: pulumi.String("127.127.0.0"),
    			IpCidrRange:       pulumi.String("127.127.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewPublicDelegatedPrefix(ctx, "prefixes", &compute.PublicDelegatedPrefixArgs{
    			Name:         pulumi.String("my-prefix"),
    			Region:       pulumi.String("us-central1"),
    			Description:  pulumi.String("my description"),
    			IpCidrRange:  pulumi.String("127.127.0.0/24"),
    			ParentPrefix: advertised.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var advertised = new Gcp.Compute.PublicAdvertisedPrefix("advertised", new()
        {
            Name = "my-prefix",
            Description = "description",
            DnsVerificationIp = "127.127.0.0",
            IpCidrRange = "127.127.0.0/16",
        });
    
        var prefixes = new Gcp.Compute.PublicDelegatedPrefix("prefixes", new()
        {
            Name = "my-prefix",
            Region = "us-central1",
            Description = "my description",
            IpCidrRange = "127.127.0.0/24",
            ParentPrefix = advertised.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.PublicAdvertisedPrefix;
    import com.pulumi.gcp.compute.PublicAdvertisedPrefixArgs;
    import com.pulumi.gcp.compute.PublicDelegatedPrefix;
    import com.pulumi.gcp.compute.PublicDelegatedPrefixArgs;
    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 advertised = new PublicAdvertisedPrefix("advertised", PublicAdvertisedPrefixArgs.builder()
                .name("my-prefix")
                .description("description")
                .dnsVerificationIp("127.127.0.0")
                .ipCidrRange("127.127.0.0/16")
                .build());
    
            var prefixes = new PublicDelegatedPrefix("prefixes", PublicDelegatedPrefixArgs.builder()
                .name("my-prefix")
                .region("us-central1")
                .description("my description")
                .ipCidrRange("127.127.0.0/24")
                .parentPrefix(advertised.id())
                .build());
    
        }
    }
    
    resources:
      advertised:
        type: gcp:compute:PublicAdvertisedPrefix
        properties:
          name: my-prefix
          description: description
          dnsVerificationIp: 127.127.0.0
          ipCidrRange: 127.127.0.0/16
      prefixes:
        type: gcp:compute:PublicDelegatedPrefix
        properties:
          name: my-prefix
          region: us-central1
          description: my description
          ipCidrRange: 127.127.0.0/24
          parentPrefix: ${advertised.id}
    

    Create PublicDelegatedPrefix Resource

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

    Constructor syntax

    new PublicDelegatedPrefix(name: string, args: PublicDelegatedPrefixArgs, opts?: CustomResourceOptions);
    @overload
    def PublicDelegatedPrefix(resource_name: str,
                              args: PublicDelegatedPrefixArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def PublicDelegatedPrefix(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              ip_cidr_range: Optional[str] = None,
                              parent_prefix: Optional[str] = None,
                              region: Optional[str] = None,
                              description: Optional[str] = None,
                              is_live_migration: Optional[bool] = None,
                              name: Optional[str] = None,
                              project: Optional[str] = None)
    func NewPublicDelegatedPrefix(ctx *Context, name string, args PublicDelegatedPrefixArgs, opts ...ResourceOption) (*PublicDelegatedPrefix, error)
    public PublicDelegatedPrefix(string name, PublicDelegatedPrefixArgs args, CustomResourceOptions? opts = null)
    public PublicDelegatedPrefix(String name, PublicDelegatedPrefixArgs args)
    public PublicDelegatedPrefix(String name, PublicDelegatedPrefixArgs args, CustomResourceOptions options)
    
    type: gcp:compute:PublicDelegatedPrefix
    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 PublicDelegatedPrefixArgs
    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 PublicDelegatedPrefixArgs
    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 PublicDelegatedPrefixArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PublicDelegatedPrefixArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PublicDelegatedPrefixArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var publicDelegatedPrefixResource = new Gcp.Compute.PublicDelegatedPrefix("publicDelegatedPrefixResource", new()
    {
        IpCidrRange = "string",
        ParentPrefix = "string",
        Region = "string",
        Description = "string",
        IsLiveMigration = false,
        Name = "string",
        Project = "string",
    });
    
    example, err := compute.NewPublicDelegatedPrefix(ctx, "publicDelegatedPrefixResource", &compute.PublicDelegatedPrefixArgs{
    	IpCidrRange:     pulumi.String("string"),
    	ParentPrefix:    pulumi.String("string"),
    	Region:          pulumi.String("string"),
    	Description:     pulumi.String("string"),
    	IsLiveMigration: pulumi.Bool(false),
    	Name:            pulumi.String("string"),
    	Project:         pulumi.String("string"),
    })
    
    var publicDelegatedPrefixResource = new PublicDelegatedPrefix("publicDelegatedPrefixResource", PublicDelegatedPrefixArgs.builder()
        .ipCidrRange("string")
        .parentPrefix("string")
        .region("string")
        .description("string")
        .isLiveMigration(false)
        .name("string")
        .project("string")
        .build());
    
    public_delegated_prefix_resource = gcp.compute.PublicDelegatedPrefix("publicDelegatedPrefixResource",
        ip_cidr_range="string",
        parent_prefix="string",
        region="string",
        description="string",
        is_live_migration=False,
        name="string",
        project="string")
    
    const publicDelegatedPrefixResource = new gcp.compute.PublicDelegatedPrefix("publicDelegatedPrefixResource", {
        ipCidrRange: "string",
        parentPrefix: "string",
        region: "string",
        description: "string",
        isLiveMigration: false,
        name: "string",
        project: "string",
    });
    
    type: gcp:compute:PublicDelegatedPrefix
    properties:
        description: string
        ipCidrRange: string
        isLiveMigration: false
        name: string
        parentPrefix: string
        project: string
        region: string
    

    PublicDelegatedPrefix Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The PublicDelegatedPrefix resource accepts the following input properties:

    IpCidrRange string
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    ParentPrefix string
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    Region string
    A region where the prefix will reside.
    Description string
    An optional description of this resource.
    IsLiveMigration bool
    If true, the prefix will be live migrated.
    Name string
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    IpCidrRange string
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    ParentPrefix string
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    Region string
    A region where the prefix will reside.
    Description string
    An optional description of this resource.
    IsLiveMigration bool
    If true, the prefix will be live migrated.
    Name string
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ipCidrRange String
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    parentPrefix String
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    region String
    A region where the prefix will reside.
    description String
    An optional description of this resource.
    isLiveMigration Boolean
    If true, the prefix will be live migrated.
    name String
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ipCidrRange string
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    parentPrefix string
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    region string
    A region where the prefix will reside.
    description string
    An optional description of this resource.
    isLiveMigration boolean
    If true, the prefix will be live migrated.
    name string
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ip_cidr_range str
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    parent_prefix str
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    region str
    A region where the prefix will reside.
    description str
    An optional description of this resource.
    is_live_migration bool
    If true, the prefix will be live migrated.
    name str
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ipCidrRange String
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    parentPrefix String
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    region String
    A region where the prefix will reside.
    description String
    An optional description of this resource.
    isLiveMigration Boolean
    If true, the prefix will be live migrated.
    name String
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    SelfLink string
    The URI of the created resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    SelfLink string
    The URI of the created resource.
    id String
    The provider-assigned unique ID for this managed resource.
    selfLink String
    The URI of the created resource.
    id string
    The provider-assigned unique ID for this managed resource.
    selfLink string
    The URI of the created resource.
    id str
    The provider-assigned unique ID for this managed resource.
    self_link str
    The URI of the created resource.
    id String
    The provider-assigned unique ID for this managed resource.
    selfLink String
    The URI of the created resource.

    Look up Existing PublicDelegatedPrefix Resource

    Get an existing PublicDelegatedPrefix 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?: PublicDelegatedPrefixState, opts?: CustomResourceOptions): PublicDelegatedPrefix
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            ip_cidr_range: Optional[str] = None,
            is_live_migration: Optional[bool] = None,
            name: Optional[str] = None,
            parent_prefix: Optional[str] = None,
            project: Optional[str] = None,
            region: Optional[str] = None,
            self_link: Optional[str] = None) -> PublicDelegatedPrefix
    func GetPublicDelegatedPrefix(ctx *Context, name string, id IDInput, state *PublicDelegatedPrefixState, opts ...ResourceOption) (*PublicDelegatedPrefix, error)
    public static PublicDelegatedPrefix Get(string name, Input<string> id, PublicDelegatedPrefixState? state, CustomResourceOptions? opts = null)
    public static PublicDelegatedPrefix get(String name, Output<String> id, PublicDelegatedPrefixState 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
    An optional description of this resource.
    IpCidrRange string
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    IsLiveMigration bool
    If true, the prefix will be live migrated.
    Name string
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    ParentPrefix string
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    A region where the prefix will reside.
    SelfLink string
    The URI of the created resource.
    Description string
    An optional description of this resource.
    IpCidrRange string
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    IsLiveMigration bool
    If true, the prefix will be live migrated.
    Name string
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    ParentPrefix string
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    A region where the prefix will reside.
    SelfLink string
    The URI of the created resource.
    description String
    An optional description of this resource.
    ipCidrRange String
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    isLiveMigration Boolean
    If true, the prefix will be live migrated.
    name String
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    parentPrefix String
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    A region where the prefix will reside.
    selfLink String
    The URI of the created resource.
    description string
    An optional description of this resource.
    ipCidrRange string
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    isLiveMigration boolean
    If true, the prefix will be live migrated.
    name string
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    parentPrefix string
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    A region where the prefix will reside.
    selfLink string
    The URI of the created resource.
    description str
    An optional description of this resource.
    ip_cidr_range str
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    is_live_migration bool
    If true, the prefix will be live migrated.
    name str
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    parent_prefix str
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    A region where the prefix will reside.
    self_link str
    The URI of the created resource.
    description String
    An optional description of this resource.
    ipCidrRange String
    The IPv4 address range, in CIDR format, represented by this public advertised prefix.


    isLiveMigration Boolean
    If true, the prefix will be live migrated.
    name String
    Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    parentPrefix String
    The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    A region where the prefix will reside.
    selfLink String
    The URI of the created resource.

    Import

    PublicDelegatedPrefix can be imported using any of these accepted formats:

    • projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}

    • {{project}}/{{region}}/{{name}}

    • {{region}}/{{name}}

    • {{name}}

    When using the pulumi import command, PublicDelegatedPrefix can be imported using one of the formats above. For example:

    $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}
    
    $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{project}}/{{region}}/{{name}}
    
    $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{region}}/{{name}}
    
    $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi