Dns Security Rule Args
data class DnsSecurityRuleArgs(val action: Output<DnsSecurityRuleActionArgs>? = null, val dnsResolverDomainLists: Output<List<SubResourceArgs>>? = null, val dnsResolverPolicyName: Output<String>? = null, val dnsSecurityRuleName: Output<String>? = null, val dnsSecurityRuleState: Output<Either<String, DnsSecurityRuleState>>? = null, val location: Output<String>? = null, val priority: Output<Int>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<DnsSecurityRuleArgs>
Describes a DNS security rule. Uses Azure REST API version 2023-07-01-preview.
Example Usage
Upsert DNS security rule
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var dnsSecurityRule = new AzureNative.Network.DnsSecurityRule("dnsSecurityRule", new()
{
Action = new AzureNative.Network.Inputs.DnsSecurityRuleActionArgs
{
ActionType = AzureNative.Network.ActionType.Block,
BlockResponseCode = AzureNative.Network.BlockResponseCode.SERVFAIL,
},
DnsResolverDomainLists = new[]
{
new AzureNative.Network.Inputs.SubResourceArgs
{
Id = "/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolverDomainLists/sampleDnsResolverDomainList",
},
},
DnsResolverPolicyName = "sampleDnsResolverPolicy",
DnsSecurityRuleName = "sampleDnsSecurityRule",
DnsSecurityRuleState = AzureNative.Network.DnsSecurityRuleState.Enabled,
Location = "westus2",
Priority = 100,
ResourceGroupName = "sampleResourceGroup",
Tags =
{
{ "key1", "value1" },
},
});
});
Content copied to clipboard
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewDnsSecurityRule(ctx, "dnsSecurityRule", &network.DnsSecurityRuleArgs{
Action: &network.DnsSecurityRuleActionArgs{
ActionType: pulumi.String(network.ActionTypeBlock),
BlockResponseCode: pulumi.String(network.BlockResponseCodeSERVFAIL),
},
DnsResolverDomainLists: network.SubResourceArray{
&network.SubResourceArgs{
Id: pulumi.String("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolverDomainLists/sampleDnsResolverDomainList"),
},
},
DnsResolverPolicyName: pulumi.String("sampleDnsResolverPolicy"),
DnsSecurityRuleName: pulumi.String("sampleDnsSecurityRule"),
DnsSecurityRuleState: pulumi.String(network.DnsSecurityRuleStateEnabled),
Location: pulumi.String("westus2"),
Priority: pulumi.Int(100),
ResourceGroupName: pulumi.String("sampleResourceGroup"),
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.DnsSecurityRule;
import com.pulumi.azurenative.network.DnsSecurityRuleArgs;
import com.pulumi.azurenative.network.inputs.DnsSecurityRuleActionArgs;
import com.pulumi.azurenative.network.inputs.SubResourceArgs;
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 dnsSecurityRule = new DnsSecurityRule("dnsSecurityRule", DnsSecurityRuleArgs.builder()
.action(DnsSecurityRuleActionArgs.builder()
.actionType("Block")
.blockResponseCode("SERVFAIL")
.build())
.dnsResolverDomainLists(SubResourceArgs.builder()
.id("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolverDomainLists/sampleDnsResolverDomainList")
.build())
.dnsResolverPolicyName("sampleDnsResolverPolicy")
.dnsSecurityRuleName("sampleDnsSecurityRule")
.dnsSecurityRuleState("Enabled")
.location("westus2")
.priority(100)
.resourceGroupName("sampleResourceGroup")
.tags(Map.of("key1", "value1"))
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:network:DnsSecurityRule sampleDnsSecurityRule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecurityRules/{dnsSecurityRuleName}
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(action: Output<DnsSecurityRuleActionArgs>? = null, dnsResolverDomainLists: Output<List<SubResourceArgs>>? = null, dnsResolverPolicyName: Output<String>? = null, dnsSecurityRuleName: Output<String>? = null, dnsSecurityRuleState: Output<Either<String, DnsSecurityRuleState>>? = null, location: Output<String>? = null, priority: Output<Int>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null)
Properties
Link copied to clipboard
The action to take on DNS requests that match the DNS security rule.
Link copied to clipboard
DNS resolver policy domains lists that the DNS security rule applies to.
Link copied to clipboard
The name of the DNS resolver policy.
Link copied to clipboard
The name of the DNS security rule.
Link copied to clipboard
The state of DNS security rule.
Link copied to clipboard
The name of the resource group. The name is case insensitive.