Policy

A policy is a collection of DNS rules applied to one or more Virtual Private Cloud resources.

To get more information about Policy, see:

Create a Policy Resource

new Policy(name: string, args?: PolicyArgs, opts?: CustomResourceOptions);
def Policy(resource_name, opts=None, alternative_name_server_config=None, description=None, enable_inbound_forwarding=None, enable_logging=None, name=None, networks=None, project=None, __props__=None);
func NewPolicy(ctx *Context, name string, args *PolicyArgs, opts ...ResourceOption) (*Policy, error)
public Policy(string name, PolicyArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Policy Resource Properties

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

Inputs

The Policy resource accepts the following input properties:

AlternativeNameServerConfig PolicyAlternativeNameServerConfigArgs

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

Description string

A textual description field. Defaults to ‘Managed by Pulumi’.

EnableInboundForwarding bool

Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy.

EnableLogging bool

Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.

Name string

User assigned name for this policy.

Networks List<PolicyNetworkArgs>

List of network names specifying networks to which this policy is applied. Structure is documented below.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

AlternativeNameServerConfig PolicyAlternativeNameServerConfig

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

Description string

A textual description field. Defaults to ‘Managed by Pulumi’.

EnableInboundForwarding bool

Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy.

EnableLogging bool

Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.

Name string

User assigned name for this policy.

Networks []PolicyNetwork

List of network names specifying networks to which this policy is applied. Structure is documented below.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

alternativeNameServerConfig PolicyAlternativeNameServerConfig

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

description string

A textual description field. Defaults to ‘Managed by Pulumi’.

enableInboundForwarding boolean

Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy.

enableLogging boolean

Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.

name string

User assigned name for this policy.

networks PolicyNetwork[]

List of network names specifying networks to which this policy is applied. Structure is documented below.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

alternative_name_server_config Dict[PolicyAlternativeNameServerConfig]

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

description str

A textual description field. Defaults to ‘Managed by Pulumi’.

enable_inbound_forwarding bool

Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy.

enable_logging bool

Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.

name str

User assigned name for this policy.

networks List[PolicyNetwork]

List of network names specifying networks to which this policy is applied. Structure is documented below.

project str

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 Policy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Policy Resource

Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policy
static get(resource_name, id, opts=None, alternative_name_server_config=None, description=None, enable_inbound_forwarding=None, enable_logging=None, name=None, networks=None, project=None, __props__=None);
func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)
public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

AlternativeNameServerConfig PolicyAlternativeNameServerConfigArgs

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

Description string

A textual description field. Defaults to ‘Managed by Pulumi’.

EnableInboundForwarding bool

Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy.

EnableLogging bool

Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.

Name string

User assigned name for this policy.

Networks List<PolicyNetworkArgs>

List of network names specifying networks to which this policy is applied. Structure is documented below.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

AlternativeNameServerConfig PolicyAlternativeNameServerConfig

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

Description string

A textual description field. Defaults to ‘Managed by Pulumi’.

EnableInboundForwarding bool

Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy.

EnableLogging bool

Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.

Name string

User assigned name for this policy.

Networks []PolicyNetwork

List of network names specifying networks to which this policy is applied. Structure is documented below.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

alternativeNameServerConfig PolicyAlternativeNameServerConfig

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

description string

A textual description field. Defaults to ‘Managed by Pulumi’.

enableInboundForwarding boolean

Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy.

enableLogging boolean

Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.

name string

User assigned name for this policy.

networks PolicyNetwork[]

List of network names specifying networks to which this policy is applied. Structure is documented below.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

alternative_name_server_config Dict[PolicyAlternativeNameServerConfig]

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

description str

A textual description field. Defaults to ‘Managed by Pulumi’.

enable_inbound_forwarding bool

Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy.

enable_logging bool

Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.

name str

User assigned name for this policy.

networks List[PolicyNetwork]

List of network names specifying networks to which this policy is applied. Structure is documented below.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Supporting Types

PolicyAlternativeNameServerConfig

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

TargetNameServers List<PolicyAlternativeNameServerConfigTargetNameServerArgs>

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

TargetNameServers []PolicyAlternativeNameServerConfigTargetNameServer

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

targetNameServers PolicyAlternativeNameServerConfigTargetNameServer[]

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

targetNameServers List[PolicyAlternativeNameServerConfigTargetNameServer]

Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. Structure is documented below.

PolicyAlternativeNameServerConfigTargetNameServer

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Ipv4Address string

IPv4 address to forward to.

Ipv4Address string

IPv4 address to forward to.

ipv4Address string

IPv4 address to forward to.

ipv4Address str

IPv4 address to forward to.

PolicyNetwork

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

NetworkUrl string

The id or fully qualified URL of the VPC network to forward queries to. This should be formatted like projects/{project}/global/networks/{network} or https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}

NetworkUrl string

The id or fully qualified URL of the VPC network to forward queries to. This should be formatted like projects/{project}/global/networks/{network} or https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}

networkUrl string

The id or fully qualified URL of the VPC network to forward queries to. This should be formatted like projects/{project}/global/networks/{network} or https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}

networkUrl str

The id or fully qualified URL of the VPC network to forward queries to. This should be formatted like projects/{project}/global/networks/{network} or https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.