blob: 2dff04b2c41e827075fa6bf0dea53413d7212bbd [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Compute Engine"
description: |-
Represents a PublicDelegatedPrefix for use with bring your own IP addresses (BYOIP).
---
# google\_compute\_public\_delegated\_prefix
Represents a PublicDelegatedPrefix for use with bring your own IP addresses (BYOIP).
To get more information about PublicDelegatedPrefix, see:
* [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/publicDelegatedPrefixes)
* How-to Guides
* [Using bring your own IP](https://cloud.google.com/vpc/docs/using-bring-your-own-ip)
## Example Usage - Public Delegated Prefixes Basic
```hcl
resource "google_compute_public_advertised_prefix" "advertised" {
name = "my-prefix"
description = "description"
dns_verification_ip = "127.127.0.0"
ip_cidr_range = "127.127.0.0/16"
}
resource "google_compute_public_delegated_prefix" "prefixes" {
name = "my-prefix"
region = "us-central1"
description = "my description"
ip_cidr_range = "127.127.0.0/24"
parent_prefix = google_compute_public_advertised_prefix.advertised.id
}
```
## Argument Reference
The following arguments are supported:
* `region` -
(Required)
A region where the prefix will reside.
* `name` -
(Required)
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]([-a-z0-9]*[a-z0-9])?`
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` -
(Required)
The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
* `ip_cidr_range` -
(Required)
The IPv4 address range, in CIDR format, represented by this public advertised prefix.
- - -
* `description` -
(Optional)
An optional description of this resource.
* `is_live_migration` -
(Optional)
If true, the prefix will be live migrated.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}`
* `self_link` - The URI of the created resource.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
PublicDelegatedPrefix can be imported using any of these accepted formats:
* `projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}`
* `{{project}}/{{region}}/{{name}}`
* `{{region}}/{{name}}`
* `{{name}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import PublicDelegatedPrefix using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}"
to = google_compute_public_delegated_prefix.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), PublicDelegatedPrefix can be imported using one of the formats above. For example:
```
$ terraform import google_compute_public_delegated_prefix.default projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}
$ terraform import google_compute_public_delegated_prefix.default {{project}}/{{region}}/{{name}}
$ terraform import google_compute_public_delegated_prefix.default {{region}}/{{name}}
$ terraform import google_compute_public_delegated_prefix.default {{name}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).