| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** 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: "Cloud VMware Engine" |
| description: |- |
| Represents a network policy resource. |
| --- |
| |
| # google\_vmwareengine\_network\_policy |
| |
| Represents a network policy resource. Network policies are regional resources. |
| |
| |
| To get more information about NetworkPolicy, see: |
| |
| * [API documentation](https://cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.networkPolicies) |
| |
| ## Example Usage - Vmware Engine Network Policy Basic |
| |
| |
| ```hcl |
| resource "google_vmwareengine_network" "network-policy-nw" { |
| name = "standard-nw" |
| location = "global" |
| type = "STANDARD" |
| description = "VMwareEngine standard network sample" |
| } |
| |
| resource "google_vmwareengine_network_policy" "vmw-engine-network-policy" { |
| location = "us-west1" |
| name = "sample-network-policy" |
| edge_services_cidr = "192.168.30.0/26" |
| vmware_engine_network = google_vmwareengine_network.network-policy-nw.id |
| } |
| ``` |
| ## Example Usage - Vmware Engine Network Policy Full |
| |
| |
| ```hcl |
| resource "google_vmwareengine_network" "network-policy-nw" { |
| name = "standard-full-nw" |
| location = "global" |
| type = "STANDARD" |
| description = "VMwareEngine standard network sample" |
| } |
| |
| resource "google_vmwareengine_network_policy" "vmw-engine-network-policy" { |
| location = "us-west1" |
| name = "sample-network-policy-full" |
| edge_services_cidr = "192.168.30.0/26" |
| vmware_engine_network = google_vmwareengine_network.network-policy-nw.id |
| description = "Sample Network Policy" |
| internet_access { |
| enabled = true |
| } |
| external_ip { |
| enabled = true |
| } |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `edge_services_cidr` - |
| (Required) |
| IP address range in CIDR notation used to create internet access and external IP access. |
| An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any |
| prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network. |
| |
| * `vmware_engine_network` - |
| (Required) |
| The relative resource name of the VMware Engine network. Specify the name in the following form: |
| projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project} |
| can either be a project number or a project ID. |
| |
| * `location` - |
| (Required) |
| The resource name of the location (region) to create the new network policy in. |
| Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. |
| For example: projects/my-project/locations/us-central1 |
| |
| * `name` - |
| (Required) |
| The ID of the Network Policy. |
| |
| |
| - - - |
| |
| |
| * `description` - |
| (Optional) |
| User-provided description for this network policy. |
| |
| * `internet_access` - |
| (Optional) |
| Network service that allows VMware workloads to access the internet. |
| Structure is [documented below](#nested_internet_access). |
| |
| * `external_ip` - |
| (Optional) |
| Network service that allows External IP addresses to be assigned to VMware workloads. |
| This service can only be enabled when internetAccess is also enabled. |
| Structure is [documented below](#nested_external_ip). |
| |
| * `project` - (Optional) The ID of the project in which the resource belongs. |
| If it is not provided, the provider project is used. |
| |
| |
| <a name="nested_internet_access"></a>The `internet_access` block supports: |
| |
| * `enabled` - |
| (Optional) |
| True if the service is enabled; false otherwise. |
| |
| * `state` - |
| (Output) |
| State of the service. New values may be added to this enum when appropriate. |
| |
| <a name="nested_external_ip"></a>The `external_ip` block supports: |
| |
| * `enabled` - |
| (Optional) |
| True if the service is enabled; false otherwise. |
| |
| * `state` - |
| (Output) |
| State of the service. New values may be added to this enum when appropriate. |
| |
| ## 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}}/locations/{{location}}/networkPolicies/{{name}}` |
| |
| * `create_time` - |
| Creation time of this resource. |
| A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and |
| up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". |
| |
| * `update_time` - |
| Last updated time of this resource. |
| A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine |
| fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". |
| |
| * `uid` - |
| System-generated unique identifier for the resource. |
| |
| * `vmware_engine_network_canonical` - |
| The canonical name of the VMware Engine network in the form: |
| projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 60 minutes. |
| - `update` - Default is 60 minutes. |
| - `delete` - Default is 60 minutes. |
| |
| ## Import |
| |
| |
| NetworkPolicy can be imported using any of these accepted formats: |
| |
| * `projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}` |
| * `{{project}}/{{location}}/{{name}}` |
| * `{{location}}/{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import NetworkPolicy using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}" |
| to = google_vmwareengine_network_policy.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), NetworkPolicy can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_vmwareengine_network_policy.default projects/{{project}}/locations/{{location}}/networkPolicies/{{name}} |
| $ terraform import google_vmwareengine_network_policy.default {{project}}/{{location}}/{{name}} |
| $ terraform import google_vmwareengine_network_policy.default {{location}}/{{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). |