UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

286 lines (285 loc) • 11.9 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network_policy_nw = new gcp.vmwareengine.Network("network-policy-nw", { * name: "sample-network", * location: "global", * type: "STANDARD", * description: "VMwareEngine standard network sample", * }); * const vmw_engine_network_policy = new gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy", { * location: "us-west1", * name: "sample-network-policy", * edgeServicesCidr: "192.168.30.0/26", * vmwareEngineNetwork: network_policy_nw.id, * }); * ``` * ### Vmware Engine Network Policy Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network_policy_nw = new gcp.vmwareengine.Network("network-policy-nw", { * name: "sample-network", * location: "global", * type: "STANDARD", * description: "VMwareEngine standard network sample", * }); * const vmw_engine_network_policy = new gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy", { * location: "us-west1", * name: "sample-network-policy", * edgeServicesCidr: "192.168.30.0/26", * vmwareEngineNetwork: network_policy_nw.id, * description: "Sample Network Policy", * internetAccess: { * enabled: true, * }, * externalIp: { * enabled: true, * }, * }); * ``` * * ## Import * * NetworkPolicy can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}` * * * `{{project}}/{{location}}/{{name}}` * * * `{{location}}/{{name}}` * * When using the `pulumi import` command, NetworkPolicy can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default projects/{{project}}/locations/{{location}}/networkPolicies/{{name}} * ``` * * ```sh * $ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default {{project}}/{{location}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default {{location}}/{{name}} * ``` */ export declare class NetworkPolicy extends pulumi.CustomResource { /** * Get an existing NetworkPolicy resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NetworkPolicyState, opts?: pulumi.CustomResourceOptions): NetworkPolicy; /** * Returns true if the given object is an instance of NetworkPolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is NetworkPolicy; /** * 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". */ readonly createTime: pulumi.Output<string>; /** * User-provided description for this network policy. */ readonly description: pulumi.Output<string | undefined>; /** * 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. */ readonly edgeServicesCidr: pulumi.Output<string>; /** * 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. */ readonly externalIp: pulumi.Output<outputs.vmwareengine.NetworkPolicyExternalIp>; /** * Network service that allows VMware workloads to access the internet. * Structure is documented below. */ readonly internetAccess: pulumi.Output<outputs.vmwareengine.NetworkPolicyInternetAccess>; /** * 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 */ readonly location: pulumi.Output<string>; /** * The ID of the Network Policy. */ readonly name: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * System-generated unique identifier for the resource. */ readonly uid: pulumi.Output<string>; /** * 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". */ readonly updateTime: pulumi.Output<string>; /** * 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. */ readonly vmwareEngineNetwork: pulumi.Output<string>; /** * The canonical name of the VMware Engine network in the form: * projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} */ readonly vmwareEngineNetworkCanonical: pulumi.Output<string>; /** * Create a NetworkPolicy resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: NetworkPolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering NetworkPolicy resources. */ export interface NetworkPolicyState { /** * 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". */ createTime?: pulumi.Input<string>; /** * User-provided description for this network policy. */ description?: pulumi.Input<string>; /** * 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. */ edgeServicesCidr?: pulumi.Input<string>; /** * 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. */ externalIp?: pulumi.Input<inputs.vmwareengine.NetworkPolicyExternalIp>; /** * Network service that allows VMware workloads to access the internet. * Structure is documented below. */ internetAccess?: pulumi.Input<inputs.vmwareengine.NetworkPolicyInternetAccess>; /** * 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 */ location?: pulumi.Input<string>; /** * The ID of the Network Policy. */ name?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * System-generated unique identifier for the resource. */ uid?: pulumi.Input<string>; /** * 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". */ updateTime?: pulumi.Input<string>; /** * 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. */ vmwareEngineNetwork?: pulumi.Input<string>; /** * The canonical name of the VMware Engine network in the form: * projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} */ vmwareEngineNetworkCanonical?: pulumi.Input<string>; } /** * The set of arguments for constructing a NetworkPolicy resource. */ export interface NetworkPolicyArgs { /** * User-provided description for this network policy. */ description?: pulumi.Input<string>; /** * 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. */ edgeServicesCidr: pulumi.Input<string>; /** * 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. */ externalIp?: pulumi.Input<inputs.vmwareengine.NetworkPolicyExternalIp>; /** * Network service that allows VMware workloads to access the internet. * Structure is documented below. */ internetAccess?: pulumi.Input<inputs.vmwareengine.NetworkPolicyInternetAccess>; /** * 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 */ location: pulumi.Input<string>; /** * The ID of the Network Policy. */ name?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * 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. */ vmwareEngineNetwork: pulumi.Input<string>; }