DnsFunctions |
|
DnsManagedZoneIamBinding |
Three different resources help you manage your IAM policy for Cloud DNS ManagedZone.
|
DnsManagedZoneIamBindingArgs |
|
DnsManagedZoneIamBindingArgs.Builder |
|
DnsManagedZoneIamMember |
Three different resources help you manage your IAM policy for Cloud DNS ManagedZone.
|
DnsManagedZoneIamMemberArgs |
|
DnsManagedZoneIamMemberArgs.Builder |
|
DnsManagedZoneIamPolicy |
Three different resources help you manage your IAM policy for Cloud DNS ManagedZone.
|
DnsManagedZoneIamPolicyArgs |
|
DnsManagedZoneIamPolicyArgs.Builder |
|
ManagedZone |
A zone is a subtree of the DNS namespace under one administrative
responsibility.
|
ManagedZoneArgs |
|
ManagedZoneArgs.Builder |
|
Policy |
A policy is a collection of DNS rules applied to one or more Virtual
Private Cloud resources.
|
PolicyArgs |
|
PolicyArgs.Builder |
|
RecordSet |
## Example Usage
### Binding a DNS name to the ephemeral IP of a new instance:
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Instance;
import com.pulumi.gcp.compute.InstanceArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
import com.pulumi.gcp.dns.ManagedZone;
import com.pulumi.gcp.dns.ManagedZoneArgs;
import com.pulumi.gcp.dns.RecordSet;
import com.pulumi.gcp.dns.RecordSetArgs;
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 frontendInstance = new Instance("frontendInstance", InstanceArgs.builder()
.machineType("g1-small")
.zone("us-central1-b")
.bootDisk(InstanceBootDiskArgs.builder()
.initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
.image("debian-cloud/debian-11")
.build())
.build())
.networkInterfaces(InstanceNetworkInterfaceArgs.builder()
.network("default")
.accessConfigs()
.build())
.build());
var prod = new ManagedZone("prod", ManagedZoneArgs.builder()
.dnsName("prod.mydomain.com.")
.build());
var frontendRecordSet = new RecordSet("frontendRecordSet", RecordSetArgs.builder()
.name(prod.dnsName().applyValue(dnsName -> String.format("frontend.%s", dnsName)))
.type("A")
.ttl(300)
.managedZone(prod.name())
.rrdatas(frontendInstance.networkInterfaces().applyValue(networkInterfaces -> networkInterfaces[0].accessConfigs()[0].natIp()))
.build());
}
}
```
### Adding an A record
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.dns.ManagedZone;
import com.pulumi.gcp.dns.ManagedZoneArgs;
import com.pulumi.gcp.dns.RecordSet;
import com.pulumi.gcp.dns.RecordSetArgs;
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 prod = new ManagedZone("prod", ManagedZoneArgs.builder()
.dnsName("prod.mydomain.com.")
.build());
var recordSet = new RecordSet("recordSet", RecordSetArgs.builder()
.name(prod.dnsName().applyValue(dnsName -> String.format("backend.%s", dnsName)))
.managedZone(prod.name())
.type("A")
.ttl(300)
.rrdatas("8.8.8.8")
.build());
}
}
```
### Adding an MX record
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.dns.ManagedZone;
import com.pulumi.gcp.dns.ManagedZoneArgs;
import com.pulumi.gcp.dns.RecordSet;
import com.pulumi.gcp.dns.RecordSetArgs;
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 prod = new ManagedZone("prod", ManagedZoneArgs.builder()
.dnsName("prod.mydomain.com.")
.build());
var mx = new RecordSet("mx", RecordSetArgs.builder()
.name(prod.dnsName())
.managedZone(prod.name())
.type("MX")
.ttl(3600)
.rrdatas(
"1 aspmx.l.google.com.",
"5 alt1.aspmx.l.google.com.",
"5 alt2.aspmx.l.google.com.",
"10 alt3.aspmx.l.google.com.",
"10 alt4.aspmx.l.google.com.")
.build());
}
}
```
### Adding an SPF record
Quotes (`""`) must be added around your `rrdatas` for a SPF record.
|
RecordSetArgs |
|
RecordSetArgs.Builder |
|
ResponsePolicy |
## Example Usage
### Dns Response Policy Basic
```java
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 com.pulumi.resources.CustomResourceOptions;
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()
.autoCreateSubnetworks(false)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var network_2 = new Network("network-2", NetworkArgs.builder()
.autoCreateSubnetworks(false)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var subnetwork_1 = new Subnetwork("subnetwork-1", SubnetworkArgs.builder()
.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(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var cluster_1 = new Cluster("cluster-1", ClusterArgs.builder()
.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())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.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(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
```
## Import
ResponsePolicy can be imported using any of these accepted formats
```sh
$ pulumi import gcp:dns/responsePolicy:ResponsePolicy default projects/{{project}}/responsePolicies/{{response_policy_name}}
```
```sh
$ pulumi import gcp:dns/responsePolicy:ResponsePolicy default {{project}}/{{response_policy_name}}
```
```sh
$ pulumi import gcp:dns/responsePolicy:ResponsePolicy default {{response_policy_name}}
```
|
ResponsePolicyArgs |
|
ResponsePolicyArgs.Builder |
|
ResponsePolicyRule |
## Example Usage
### Dns Response Policy Rule Basic
```java
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.dns.ResponsePolicy;
import com.pulumi.gcp.dns.ResponsePolicyArgs;
import com.pulumi.gcp.dns.inputs.ResponsePolicyNetworkArgs;
import com.pulumi.gcp.dns.ResponsePolicyRule;
import com.pulumi.gcp.dns.ResponsePolicyRuleArgs;
import com.pulumi.gcp.dns.inputs.ResponsePolicyRuleLocalDataArgs;
import com.pulumi.resources.CustomResourceOptions;
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()
.autoCreateSubnetworks(false)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var network_2 = new Network("network-2", NetworkArgs.builder()
.autoCreateSubnetworks(false)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var response_policy = new ResponsePolicy("response-policy", ResponsePolicyArgs.builder()
.responsePolicyName("example-response-policy")
.networks(
ResponsePolicyNetworkArgs.builder()
.networkUrl(network_1.id())
.build(),
ResponsePolicyNetworkArgs.builder()
.networkUrl(network_2.id())
.build())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var example_response_policy_rule = new ResponsePolicyRule("example-response-policy-rule", ResponsePolicyRuleArgs.builder()
.responsePolicy(response_policy.responsePolicyName())
.ruleName("example-rule")
.dnsName("dns.example.com.")
.localData(ResponsePolicyRuleLocalDataArgs.builder()
.localDatas(ResponsePolicyRuleLocalDataLocalDataArgs.builder()
.name("dns.example.com.")
.type("A")
.ttl(300)
.rrdatas("192.0.2.91")
.build())
.build())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
```
## Import
ResponsePolicyRule can be imported using any of these accepted formats
```sh
$ pulumi import gcp:dns/responsePolicyRule:ResponsePolicyRule default projects/{{project}}/responsePolicies/{{response_policy}}/rules/{{rule_name}}
```
```sh
$ pulumi import gcp:dns/responsePolicyRule:ResponsePolicyRule default {{project}}/{{response_policy}}/{{rule_name}}
```
```sh
$ pulumi import gcp:dns/responsePolicyRule:ResponsePolicyRule default {{response_policy}}/{{rule_name}}
```
|
ResponsePolicyRuleArgs |
|
ResponsePolicyRuleArgs.Builder |
|