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:
- API documentation
- How-to Guides
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:
- Alternative
Name PolicyServer Config Alternative Name Server Config Args 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’.
- Enable
Inbound boolForwarding 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 string
User assigned name for this policy.
- Networks
List<Policy
Network Args> 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 PolicyServer Config Alternative Name Server Config 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’.
- Enable
Inbound boolForwarding 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 string
User assigned name for this policy.
- Networks
[]Policy
Network 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 PolicyServer Config Alternative Name Server Config 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’.
- enable
Inbound booleanForwarding 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 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
Policy
Network[] 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_ Dict[Policyserver_ config Alternative Name Server Config] 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_ boolforwarding 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[Policy
Network] 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:
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): Policystatic 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:
- Alternative
Name PolicyServer Config Alternative Name Server Config Args 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’.
- Enable
Inbound boolForwarding 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 string
User assigned name for this policy.
- Networks
List<Policy
Network Args> 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 PolicyServer Config Alternative Name Server Config 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’.
- Enable
Inbound boolForwarding 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 string
User assigned name for this policy.
- Networks
[]Policy
Network 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 PolicyServer Config Alternative Name Server Config 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’.
- enable
Inbound booleanForwarding 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 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
Policy
Network[] 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_ Dict[Policyserver_ config Alternative Name Server Config] 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_ boolforwarding 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[Policy
Network] 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
- Target
Name List<PolicyServers Alternative Name Server Config Target Name Server Args> 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.
- Target
Name []PolicyServers Alternative Name Server Config Target Name Server 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.
- target
Name PolicyServers Alternative Name Server Config Target Name Server[] 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.
- target
Name List[PolicyServers Alternative Name Server Config Target Name Server] 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
- 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
- Network
Url 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}orhttps://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
- Network
Url 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}orhttps://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
- network
Url 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}orhttps://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
- network
Url 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}orhttps://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-betaTerraform Provider.