gcp.dns.ResponsePolicy
Explore with Pulumi AI
A Response Policy is a collection of selectors that apply to queries made against one or more Virtual Private Cloud networks.
Example Usage
Dns Response Policy Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const network_1 = new gcp.compute.Network("network-1", {
name: "network-1",
autoCreateSubnetworks: false,
});
const network_2 = new gcp.compute.Network("network-2", {
name: "network-2",
autoCreateSubnetworks: false,
});
const subnetwork_1 = new gcp.compute.Subnetwork("subnetwork-1", {
name: network_1.name,
network: network_1.name,
ipCidrRange: "10.0.36.0/24",
region: "us-central1",
privateIpGoogleAccess: true,
secondaryIpRanges: [
{
rangeName: "pod",
ipCidrRange: "10.0.0.0/19",
},
{
rangeName: "svc",
ipCidrRange: "10.0.32.0/22",
},
],
});
const cluster_1 = new gcp.container.Cluster("cluster-1", {
name: "cluster-1",
location: "us-central1-c",
initialNodeCount: 1,
networkingMode: "VPC_NATIVE",
defaultSnatStatus: {
disabled: true,
},
network: network_1.name,
subnetwork: subnetwork_1.name,
privateClusterConfig: {
enablePrivateEndpoint: true,
enablePrivateNodes: true,
masterIpv4CidrBlock: "10.42.0.0/28",
masterGlobalAccessConfig: {
enabled: true,
},
},
masterAuthorizedNetworksConfig: {},
ipAllocationPolicy: {
clusterSecondaryRangeName: subnetwork_1.secondaryIpRanges.apply(secondaryIpRanges => secondaryIpRanges[0].rangeName),
servicesSecondaryRangeName: subnetwork_1.secondaryIpRanges.apply(secondaryIpRanges => secondaryIpRanges[1].rangeName),
},
deletionProtection: true,
});
const example_response_policy = new gcp.dns.ResponsePolicy("example-response-policy", {
responsePolicyName: "example-response-policy",
networks: [
{
networkUrl: network_1.id,
},
{
networkUrl: network_2.id,
},
],
gkeClusters: [{
gkeClusterName: cluster_1.id,
}],
});
import pulumi
import pulumi_gcp as gcp
network_1 = gcp.compute.Network("network-1",
name="network-1",
auto_create_subnetworks=False)
network_2 = gcp.compute.Network("network-2",
name="network-2",
auto_create_subnetworks=False)
subnetwork_1 = gcp.compute.Subnetwork("subnetwork-1",
name=network_1.name,
network=network_1.name,
ip_cidr_range="10.0.36.0/24",
region="us-central1",
private_ip_google_access=True,
secondary_ip_ranges=[
{
"range_name": "pod",
"ip_cidr_range": "10.0.0.0/19",
},
{
"range_name": "svc",
"ip_cidr_range": "10.0.32.0/22",
},
])
cluster_1 = gcp.container.Cluster("cluster-1",
name="cluster-1",
location="us-central1-c",
initial_node_count=1,
networking_mode="VPC_NATIVE",
default_snat_status={
"disabled": True,
},
network=network_1.name,
subnetwork=subnetwork_1.name,
private_cluster_config={
"enable_private_endpoint": True,
"enable_private_nodes": True,
"master_ipv4_cidr_block": "10.42.0.0/28",
"master_global_access_config": {
"enabled": True,
},
},
master_authorized_networks_config={},
ip_allocation_policy={
"cluster_secondary_range_name": subnetwork_1.secondary_ip_ranges[0].range_name,
"services_secondary_range_name": subnetwork_1.secondary_ip_ranges[1].range_name,
},
deletion_protection=True)
example_response_policy = gcp.dns.ResponsePolicy("example-response-policy",
response_policy_name="example-response-policy",
networks=[
{
"network_url": network_1.id,
},
{
"network_url": network_2.id,
},
],
gke_clusters=[{
"gke_cluster_name": cluster_1.id,
}])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/container"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewNetwork(ctx, "network-1", &compute.NetworkArgs{
Name: pulumi.String("network-1"),
AutoCreateSubnetworks: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = compute.NewNetwork(ctx, "network-2", &compute.NetworkArgs{
Name: pulumi.String("network-2"),
AutoCreateSubnetworks: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = compute.NewSubnetwork(ctx, "subnetwork-1", &compute.SubnetworkArgs{
Name: network_1.Name,
Network: network_1.Name,
IpCidrRange: pulumi.String("10.0.36.0/24"),
Region: pulumi.String("us-central1"),
PrivateIpGoogleAccess: pulumi.Bool(true),
SecondaryIpRanges: compute.SubnetworkSecondaryIpRangeArray{
&compute.SubnetworkSecondaryIpRangeArgs{
RangeName: pulumi.String("pod"),
IpCidrRange: pulumi.String("10.0.0.0/19"),
},
&compute.SubnetworkSecondaryIpRangeArgs{
RangeName: pulumi.String("svc"),
IpCidrRange: pulumi.String("10.0.32.0/22"),
},
},
})
if err != nil {
return err
}
_, err = container.NewCluster(ctx, "cluster-1", &container.ClusterArgs{
Name: pulumi.String("cluster-1"),
Location: pulumi.String("us-central1-c"),
InitialNodeCount: pulumi.Int(1),
NetworkingMode: pulumi.String("VPC_NATIVE"),
DefaultSnatStatus: &container.ClusterDefaultSnatStatusArgs{
Disabled: pulumi.Bool(true),
},
Network: network_1.Name,
Subnetwork: subnetwork_1.Name,
PrivateClusterConfig: &container.ClusterPrivateClusterConfigArgs{
EnablePrivateEndpoint: pulumi.Bool(true),
EnablePrivateNodes: pulumi.Bool(true),
MasterIpv4CidrBlock: pulumi.String("10.42.0.0/28"),
MasterGlobalAccessConfig: &container.ClusterPrivateClusterConfigMasterGlobalAccessConfigArgs{
Enabled: pulumi.Bool(true),
},
},
MasterAuthorizedNetworksConfig: &container.ClusterMasterAuthorizedNetworksConfigArgs{},
IpAllocationPolicy: &container.ClusterIpAllocationPolicyArgs{
ClusterSecondaryRangeName: subnetwork_1.SecondaryIpRanges.ApplyT(func(secondaryIpRanges []compute.SubnetworkSecondaryIpRange) (*string, error) {
return &secondaryIpRanges[0].RangeName, nil
}).(pulumi.StringPtrOutput),
ServicesSecondaryRangeName: subnetwork_1.SecondaryIpRanges.ApplyT(func(secondaryIpRanges []compute.SubnetworkSecondaryIpRange) (*string, error) {
return &secondaryIpRanges[1].RangeName, nil
}).(pulumi.StringPtrOutput),
},
DeletionProtection: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = dns.NewResponsePolicy(ctx, "example-response-policy", &dns.ResponsePolicyArgs{
ResponsePolicyName: pulumi.String("example-response-policy"),
Networks: dns.ResponsePolicyNetworkArray{
&dns.ResponsePolicyNetworkArgs{
NetworkUrl: network_1.ID(),
},
&dns.ResponsePolicyNetworkArgs{
NetworkUrl: network_2.ID(),
},
},
GkeClusters: dns.ResponsePolicyGkeClusterArray{
&dns.ResponsePolicyGkeClusterArgs{
GkeClusterName: cluster_1.ID(),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var network_1 = new Gcp.Compute.Network("network-1", new()
{
Name = "network-1",
AutoCreateSubnetworks = false,
});
var network_2 = new Gcp.Compute.Network("network-2", new()
{
Name = "network-2",
AutoCreateSubnetworks = false,
});
var subnetwork_1 = new Gcp.Compute.Subnetwork("subnetwork-1", new()
{
Name = network_1.Name,
Network = network_1.Name,
IpCidrRange = "10.0.36.0/24",
Region = "us-central1",
PrivateIpGoogleAccess = true,
SecondaryIpRanges = new[]
{
new Gcp.Compute.Inputs.SubnetworkSecondaryIpRangeArgs
{
RangeName = "pod",
IpCidrRange = "10.0.0.0/19",
},
new Gcp.Compute.Inputs.SubnetworkSecondaryIpRangeArgs
{
RangeName = "svc",
IpCidrRange = "10.0.32.0/22",
},
},
});
var cluster_1 = new Gcp.Container.Cluster("cluster-1", new()
{
Name = "cluster-1",
Location = "us-central1-c",
InitialNodeCount = 1,
NetworkingMode = "VPC_NATIVE",
DefaultSnatStatus = new Gcp.Container.Inputs.ClusterDefaultSnatStatusArgs
{
Disabled = true,
},
Network = network_1.Name,
Subnetwork = subnetwork_1.Name,
PrivateClusterConfig = new Gcp.Container.Inputs.ClusterPrivateClusterConfigArgs
{
EnablePrivateEndpoint = true,
EnablePrivateNodes = true,
MasterIpv4CidrBlock = "10.42.0.0/28",
MasterGlobalAccessConfig = new Gcp.Container.Inputs.ClusterPrivateClusterConfigMasterGlobalAccessConfigArgs
{
Enabled = true,
},
},
MasterAuthorizedNetworksConfig = null,
IpAllocationPolicy = new Gcp.Container.Inputs.ClusterIpAllocationPolicyArgs
{
ClusterSecondaryRangeName = subnetwork_1.SecondaryIpRanges.Apply(secondaryIpRanges => secondaryIpRanges[0].RangeName),
ServicesSecondaryRangeName = subnetwork_1.SecondaryIpRanges.Apply(secondaryIpRanges => secondaryIpRanges[1].RangeName),
},
DeletionProtection = true,
});
var example_response_policy = new Gcp.Dns.ResponsePolicy("example-response-policy", new()
{
ResponsePolicyName = "example-response-policy",
Networks = new[]
{
new Gcp.Dns.Inputs.ResponsePolicyNetworkArgs
{
NetworkUrl = network_1.Id,
},
new Gcp.Dns.Inputs.ResponsePolicyNetworkArgs
{
NetworkUrl = network_2.Id,
},
},
GkeClusters = new[]
{
new Gcp.Dns.Inputs.ResponsePolicyGkeClusterArgs
{
GkeClusterName = cluster_1.Id,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.compute.inputs.SubnetworkSecondaryIpRangeArgs;
import com.pulumi.gcp.container.Cluster;
import com.pulumi.gcp.container.ClusterArgs;
import com.pulumi.gcp.container.inputs.ClusterDefaultSnatStatusArgs;
import com.pulumi.gcp.container.inputs.ClusterPrivateClusterConfigArgs;
import com.pulumi.gcp.container.inputs.ClusterPrivateClusterConfigMasterGlobalAccessConfigArgs;
import com.pulumi.gcp.container.inputs.ClusterMasterAuthorizedNetworksConfigArgs;
import com.pulumi.gcp.container.inputs.ClusterIpAllocationPolicyArgs;
import com.pulumi.gcp.dns.ResponsePolicy;
import com.pulumi.gcp.dns.ResponsePolicyArgs;
import com.pulumi.gcp.dns.inputs.ResponsePolicyNetworkArgs;
import com.pulumi.gcp.dns.inputs.ResponsePolicyGkeClusterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var network_1 = new Network("network-1", NetworkArgs.builder()
.name("network-1")
.autoCreateSubnetworks(false)
.build());
var network_2 = new Network("network-2", NetworkArgs.builder()
.name("network-2")
.autoCreateSubnetworks(false)
.build());
var subnetwork_1 = new Subnetwork("subnetwork-1", SubnetworkArgs.builder()
.name(network_1.name())
.network(network_1.name())
.ipCidrRange("10.0.36.0/24")
.region("us-central1")
.privateIpGoogleAccess(true)
.secondaryIpRanges(
SubnetworkSecondaryIpRangeArgs.builder()
.rangeName("pod")
.ipCidrRange("10.0.0.0/19")
.build(),
SubnetworkSecondaryIpRangeArgs.builder()
.rangeName("svc")
.ipCidrRange("10.0.32.0/22")
.build())
.build());
var cluster_1 = new Cluster("cluster-1", ClusterArgs.builder()
.name("cluster-1")
.location("us-central1-c")
.initialNodeCount(1)
.networkingMode("VPC_NATIVE")
.defaultSnatStatus(ClusterDefaultSnatStatusArgs.builder()
.disabled(true)
.build())
.network(network_1.name())
.subnetwork(subnetwork_1.name())
.privateClusterConfig(ClusterPrivateClusterConfigArgs.builder()
.enablePrivateEndpoint(true)
.enablePrivateNodes(true)
.masterIpv4CidrBlock("10.42.0.0/28")
.masterGlobalAccessConfig(ClusterPrivateClusterConfigMasterGlobalAccessConfigArgs.builder()
.enabled(true)
.build())
.build())
.masterAuthorizedNetworksConfig()
.ipAllocationPolicy(ClusterIpAllocationPolicyArgs.builder()
.clusterSecondaryRangeName(subnetwork_1.secondaryIpRanges().applyValue(secondaryIpRanges -> secondaryIpRanges[0].rangeName()))
.servicesSecondaryRangeName(subnetwork_1.secondaryIpRanges().applyValue(secondaryIpRanges -> secondaryIpRanges[1].rangeName()))
.build())
.deletionProtection(true)
.build());
var example_response_policy = new ResponsePolicy("example-response-policy", ResponsePolicyArgs.builder()
.responsePolicyName("example-response-policy")
.networks(
ResponsePolicyNetworkArgs.builder()
.networkUrl(network_1.id())
.build(),
ResponsePolicyNetworkArgs.builder()
.networkUrl(network_2.id())
.build())
.gkeClusters(ResponsePolicyGkeClusterArgs.builder()
.gkeClusterName(cluster_1.id())
.build())
.build());
}
}
resources:
network-1:
type: gcp:compute:Network
properties:
name: network-1
autoCreateSubnetworks: false
network-2:
type: gcp:compute:Network
properties:
name: network-2
autoCreateSubnetworks: false
subnetwork-1:
type: gcp:compute:Subnetwork
properties:
name: ${["network-1"].name}
network: ${["network-1"].name}
ipCidrRange: 10.0.36.0/24
region: us-central1
privateIpGoogleAccess: true
secondaryIpRanges:
- rangeName: pod
ipCidrRange: 10.0.0.0/19
- rangeName: svc
ipCidrRange: 10.0.32.0/22
cluster-1:
type: gcp:container:Cluster
properties:
name: cluster-1
location: us-central1-c
initialNodeCount: 1
networkingMode: VPC_NATIVE
defaultSnatStatus:
disabled: true
network: ${["network-1"].name}
subnetwork: ${["subnetwork-1"].name}
privateClusterConfig:
enablePrivateEndpoint: true
enablePrivateNodes: true
masterIpv4CidrBlock: 10.42.0.0/28
masterGlobalAccessConfig:
enabled: true
masterAuthorizedNetworksConfig: {}
ipAllocationPolicy:
clusterSecondaryRangeName: ${["subnetwork-1"].secondaryIpRanges[0].rangeName}
servicesSecondaryRangeName: ${["subnetwork-1"].secondaryIpRanges[1].rangeName}
deletionProtection: true
example-response-policy:
type: gcp:dns:ResponsePolicy
properties:
responsePolicyName: example-response-policy
networks:
- networkUrl: ${["network-1"].id}
- networkUrl: ${["network-2"].id}
gkeClusters:
- gkeClusterName: ${["cluster-1"].id}
Create ResponsePolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ResponsePolicy(name: string, args: ResponsePolicyArgs, opts?: CustomResourceOptions);
@overload
def ResponsePolicy(resource_name: str,
args: ResponsePolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ResponsePolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
response_policy_name: Optional[str] = None,
description: Optional[str] = None,
gke_clusters: Optional[Sequence[ResponsePolicyGkeClusterArgs]] = None,
networks: Optional[Sequence[ResponsePolicyNetworkArgs]] = None,
project: Optional[str] = None)
func NewResponsePolicy(ctx *Context, name string, args ResponsePolicyArgs, opts ...ResourceOption) (*ResponsePolicy, error)
public ResponsePolicy(string name, ResponsePolicyArgs args, CustomResourceOptions? opts = null)
public ResponsePolicy(String name, ResponsePolicyArgs args)
public ResponsePolicy(String name, ResponsePolicyArgs args, CustomResourceOptions options)
type: gcp:dns:ResponsePolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ResponsePolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ResponsePolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ResponsePolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResponsePolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ResponsePolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var responsePolicyResource = new Gcp.Dns.ResponsePolicy("responsePolicyResource", new()
{
ResponsePolicyName = "string",
Description = "string",
GkeClusters = new[]
{
new Gcp.Dns.Inputs.ResponsePolicyGkeClusterArgs
{
GkeClusterName = "string",
},
},
Networks = new[]
{
new Gcp.Dns.Inputs.ResponsePolicyNetworkArgs
{
NetworkUrl = "string",
},
},
Project = "string",
});
example, err := dns.NewResponsePolicy(ctx, "responsePolicyResource", &dns.ResponsePolicyArgs{
ResponsePolicyName: pulumi.String("string"),
Description: pulumi.String("string"),
GkeClusters: dns.ResponsePolicyGkeClusterArray{
&dns.ResponsePolicyGkeClusterArgs{
GkeClusterName: pulumi.String("string"),
},
},
Networks: dns.ResponsePolicyNetworkArray{
&dns.ResponsePolicyNetworkArgs{
NetworkUrl: pulumi.String("string"),
},
},
Project: pulumi.String("string"),
})
var responsePolicyResource = new ResponsePolicy("responsePolicyResource", ResponsePolicyArgs.builder()
.responsePolicyName("string")
.description("string")
.gkeClusters(ResponsePolicyGkeClusterArgs.builder()
.gkeClusterName("string")
.build())
.networks(ResponsePolicyNetworkArgs.builder()
.networkUrl("string")
.build())
.project("string")
.build());
response_policy_resource = gcp.dns.ResponsePolicy("responsePolicyResource",
response_policy_name="string",
description="string",
gke_clusters=[{
"gke_cluster_name": "string",
}],
networks=[{
"network_url": "string",
}],
project="string")
const responsePolicyResource = new gcp.dns.ResponsePolicy("responsePolicyResource", {
responsePolicyName: "string",
description: "string",
gkeClusters: [{
gkeClusterName: "string",
}],
networks: [{
networkUrl: "string",
}],
project: "string",
});
type: gcp:dns:ResponsePolicy
properties:
description: string
gkeClusters:
- gkeClusterName: string
networks:
- networkUrl: string
project: string
responsePolicyName: string
ResponsePolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ResponsePolicy resource accepts the following input properties:
- Response
Policy stringName - The user assigned name for this Response Policy, such as
myresponsepolicy
. - Description string
- The description of the response policy, such as
My new response policy
. - Gke
Clusters List<ResponsePolicy Gke Cluster> - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- Networks
List<Response
Policy Network> - The 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.
- Response
Policy stringName - The user assigned name for this Response Policy, such as
myresponsepolicy
. - Description string
- The description of the response policy, such as
My new response policy
. - Gke
Clusters []ResponsePolicy Gke Cluster Args - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- Networks
[]Response
Policy Network Args - The 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.
- response
Policy StringName - The user assigned name for this Response Policy, such as
myresponsepolicy
. - description String
- The description of the response policy, such as
My new response policy
. - gke
Clusters List<ResponsePolicy Gke Cluster> - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- networks
List<Response
Policy Network> - The 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.
- response
Policy stringName - The user assigned name for this Response Policy, such as
myresponsepolicy
. - description string
- The description of the response policy, such as
My new response policy
. - gke
Clusters ResponsePolicy Gke Cluster[] - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- networks
Response
Policy Network[] - The 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.
- response_
policy_ strname - The user assigned name for this Response Policy, such as
myresponsepolicy
. - description str
- The description of the response policy, such as
My new response policy
. - gke_
clusters Sequence[ResponsePolicy Gke Cluster Args] - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- networks
Sequence[Response
Policy Network Args] - The 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.
- response
Policy StringName - The user assigned name for this Response Policy, such as
myresponsepolicy
. - description String
- The description of the response policy, such as
My new response policy
. - gke
Clusters List<Property Map> - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- networks List<Property Map>
- The 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the ResponsePolicy 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 string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ResponsePolicy Resource
Get an existing ResponsePolicy 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?: ResponsePolicyState, opts?: CustomResourceOptions): ResponsePolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
gke_clusters: Optional[Sequence[ResponsePolicyGkeClusterArgs]] = None,
networks: Optional[Sequence[ResponsePolicyNetworkArgs]] = None,
project: Optional[str] = None,
response_policy_name: Optional[str] = None) -> ResponsePolicy
func GetResponsePolicy(ctx *Context, name string, id IDInput, state *ResponsePolicyState, opts ...ResourceOption) (*ResponsePolicy, error)
public static ResponsePolicy Get(string name, Input<string> id, ResponsePolicyState? state, CustomResourceOptions? opts = null)
public static ResponsePolicy get(String name, Output<String> id, ResponsePolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Description string
- The description of the response policy, such as
My new response policy
. - Gke
Clusters List<ResponsePolicy Gke Cluster> - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- Networks
List<Response
Policy Network> - The 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.
- Response
Policy stringName - The user assigned name for this Response Policy, such as
myresponsepolicy
.
- Description string
- The description of the response policy, such as
My new response policy
. - Gke
Clusters []ResponsePolicy Gke Cluster Args - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- Networks
[]Response
Policy Network Args - The 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.
- Response
Policy stringName - The user assigned name for this Response Policy, such as
myresponsepolicy
.
- description String
- The description of the response policy, such as
My new response policy
. - gke
Clusters List<ResponsePolicy Gke Cluster> - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- networks
List<Response
Policy Network> - The 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.
- response
Policy StringName - The user assigned name for this Response Policy, such as
myresponsepolicy
.
- description string
- The description of the response policy, such as
My new response policy
. - gke
Clusters ResponsePolicy Gke Cluster[] - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- networks
Response
Policy Network[] - The 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.
- response
Policy stringName - The user assigned name for this Response Policy, such as
myresponsepolicy
.
- description str
- The description of the response policy, such as
My new response policy
. - gke_
clusters Sequence[ResponsePolicy Gke Cluster Args] - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- networks
Sequence[Response
Policy Network Args] - The 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.
- response_
policy_ strname - The user assigned name for this Response Policy, such as
myresponsepolicy
.
- description String
- The description of the response policy, such as
My new response policy
. - gke
Clusters List<Property Map> - The list of Google Kubernetes Engine clusters that can see this zone. Structure is documented below.
- networks List<Property Map>
- The 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.
- response
Policy StringName - The user assigned name for this Response Policy, such as
myresponsepolicy
.
Supporting Types
ResponsePolicyGkeCluster, ResponsePolicyGkeClusterArgs
- Gke
Cluster stringName - The resource name of the cluster to bind this ManagedZone to.
This should be specified in the format like
projects/*/locations/*/clusters/*
- Gke
Cluster stringName - The resource name of the cluster to bind this ManagedZone to.
This should be specified in the format like
projects/*/locations/*/clusters/*
- gke
Cluster StringName - The resource name of the cluster to bind this ManagedZone to.
This should be specified in the format like
projects/*/locations/*/clusters/*
- gke
Cluster stringName - The resource name of the cluster to bind this ManagedZone to.
This should be specified in the format like
projects/*/locations/*/clusters/*
- gke_
cluster_ strname - The resource name of the cluster to bind this ManagedZone to.
This should be specified in the format like
projects/*/locations/*/clusters/*
- gke
Cluster StringName - The resource name of the cluster to bind this ManagedZone to.
This should be specified in the format like
projects/*/locations/*/clusters/*
ResponsePolicyNetwork, ResponsePolicyNetworkArgs
- Network
Url string - The fully qualified URL of the VPC network to bind to.
This should be formatted like
https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
- Network
Url string - The fully qualified URL of the VPC network to bind to.
This should be formatted like
https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
- network
Url String - The fully qualified URL of the VPC network to bind to.
This should be formatted like
https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
- network
Url string - The fully qualified URL of the VPC network to bind to.
This should be formatted like
https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
- network_
url str - The fully qualified URL of the VPC network to bind to.
This should be formatted like
https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
- network
Url String - The fully qualified URL of the VPC network to bind to.
This should be formatted like
https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
Import
ResponsePolicy can be imported using any of these accepted formats:
projects/{{project}}/responsePolicies/{{response_policy_name}}
{{project}}/{{response_policy_name}}
{{response_policy_name}}
When using the pulumi import
command, ResponsePolicy can be imported using one of the formats above. For example:
$ pulumi import gcp:dns/responsePolicy:ResponsePolicy default projects/{{project}}/responsePolicies/{{response_policy_name}}
$ pulumi import gcp:dns/responsePolicy:ResponsePolicy default {{project}}/{{response_policy_name}}
$ pulumi import gcp:dns/responsePolicy:ResponsePolicy default {{response_policy_name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.