Response Policy Rule Args
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());
}
}
Content copied to clipboard
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}}
Content copied to clipboard
$ pulumi import gcp:dns/responsePolicyRule:ResponsePolicyRule default {{project}}/{{response_policy}}/{{rule_name}}
Content copied to clipboard
$ pulumi import gcp:dns/responsePolicyRule:ResponsePolicyRule default {{response_policy}}/{{rule_name}}
Content copied to clipboard
Properties
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
Identifies the response policy addressed by this request.