Represents a network policy resource. Network policies are regional resources.
To get more information about NetworkPolicy, see:
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
}
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
}
}
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.
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.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
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.
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.
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}
This resource provides the following Timeouts configuration options:
create
- Default is 60 minutes.update
- Default is 60 minutes.delete
- Default is 60 minutes.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 to import NetworkPolicy using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}"
to = google_vmwareengine_network_policy.default
}
When using the terraform import
command, 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}}
This resource supports User Project Overrides.