ResponsePolicyRuleArgs

data class ResponsePolicyRuleArgs(val behavior: Output<String>? = null, val dnsName: Output<String>? = null, val localData: Output<ResponsePolicyRuleLocalDataArgs>? = null, val project: Output<String>? = null, val responsePolicy: Output<String>? = null, val ruleName: Output<String>? = null) : ConvertibleToJava<ResponsePolicyRuleArgs>

A Response Policy Rule is a selector that applies its behavior to queries that match the selector. Selectors are DNS names, which may be wildcards or exact matches. Each DNS query subject to a Response Policy matches at most one ResponsePolicyRule, as identified by the dns_name field with the longest matching suffix.

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 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());
var network_2 = new Network("network-2", NetworkArgs.builder()
.autoCreateSubnetworks(false)
.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());
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());
}
}

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}}

Constructors

Link copied to clipboard
constructor(behavior: Output<String>? = null, dnsName: Output<String>? = null, localData: Output<ResponsePolicyRuleLocalDataArgs>? = null, project: Output<String>? = null, responsePolicy: Output<String>? = null, ruleName: Output<String>? = null)

Properties

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

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

Link copied to clipboard
val dnsName: Output<String>? = null

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

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>? = null

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

Link copied to clipboard
val responsePolicy: Output<String>? = null

Identifies the response policy addressed by this request.

Link copied to clipboard
val ruleName: Output<String>? = null

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

Functions

Link copied to clipboard
open override fun toJava(): ResponsePolicyRuleArgs