DnsSecurityRule

class DnsSecurityRule : KotlinCustomResource

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" },
},
});
});
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
})
}
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());
}
}

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}

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 state of DNS security rule.

Link copied to clipboard
val etag: Output<String>

ETag of the DNS security rule.

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

The geo-location where the resource lives

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard
val priority: Output<Int>

The priority of the DNS security rule.

Link copied to clipboard

The current provisioning state of the DNS security rule. This is a read-only property and any attempt to set this value will be ignored.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Azure Resource Manager metadata containing createdBy and modifiedBy information.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags.

Link copied to clipboard
val type: Output<String>

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Link copied to clipboard
val urn: Output<String>