ResponsePolicyRule

Example Usage

Dns Response Policy Rule Basic

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

$ pulumi import gcp:dns/responsePolicyRule:ResponsePolicyRule default projects/{{project}}/responsePolicies/{{response_policy}}/rules/{{rule_name}}
$ pulumi import gcp:dns/responsePolicyRule:ResponsePolicyRule default {{project}}/{{response_policy}}/{{rule_name}}
$ pulumi import gcp:dns/responsePolicyRule:ResponsePolicyRule default {{response_policy}}/{{rule_name}}

Properties

Link copied to clipboard
val behavior: Output<String>?

Answer this query with a behavior rather than DNS data. Acceptable values are 'behaviorUnspecified', and 'bypassResponsePolicy'

Link copied to clipboard
val dnsName: Output<String>

The DNS name (wildcard or exact) to apply this rule to. Must be unique within the Response Policy Rule.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Answer this query directly with DNS data. These ResourceRecordSets override any other DNS behavior for the matched name; in particular they override private zones, the public internet, and GCP internal DNS. No SOA nor NS types are allowed. Structure is documented below.

Link copied to clipboard
val project: Output<String>

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val responsePolicy: Output<String>

Identifies the response policy addressed by this request.

Link copied to clipboard
val ruleName: Output<String>

An identifier for this rule. Must be unique with the ResponsePolicy.

Link copied to clipboard
val urn: Output<String>