azure logo
Azure Classic v5.32.0, Jan 25 23

azure.cdn.FrontdoorSecurityPolicy

Manages a Front Door (standard/premium) Security Policy.

Example Usage

Coming soon!

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.cdn.FrontdoorProfile;
import com.pulumi.azure.cdn.FrontdoorProfileArgs;
import com.pulumi.azure.cdn.FrontdoorFirewallPolicy;
import com.pulumi.azure.cdn.FrontdoorFirewallPolicyArgs;
import com.pulumi.azure.cdn.inputs.FrontdoorFirewallPolicyCustomRuleArgs;
import com.pulumi.azure.cdn.FrontdoorSecurityPolicy;
import com.pulumi.azure.cdn.FrontdoorSecurityPolicyArgs;
import com.pulumi.azure.cdn.inputs.FrontdoorSecurityPolicySecurityPoliciesArgs;
import com.pulumi.azure.cdn.inputs.FrontdoorSecurityPolicySecurityPoliciesFirewallArgs;
import com.pulumi.azure.cdn.inputs.FrontdoorSecurityPolicySecurityPoliciesFirewallAssociationArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleFrontdoorProfile = new FrontdoorProfile("exampleFrontdoorProfile", FrontdoorProfileArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .build());

        var exampleFrontdoorFirewallPolicy = new FrontdoorFirewallPolicy("exampleFrontdoorFirewallPolicy", FrontdoorFirewallPolicyArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .skuName(exampleFrontdoorProfile.skuName())
            .enabled(true)
            .mode("Prevention")
            .redirectUrl("https://www.contoso.com")
            .customBlockResponseStatusCode(403)
            .customBlockResponseBody("PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==")
            .customRules(FrontdoorFirewallPolicyCustomRuleArgs.builder()
                .name("Rule1")
                .enabled(true)
                .priority(1)
                .rateLimitDurationInMinutes(1)
                .rateLimitThreshold(10)
                .type("MatchRule")
                .action("Block")
                .matchConditions(FrontdoorFirewallPolicyCustomRuleMatchConditionArgs.builder()
                    .matchVariable("RemoteAddr")
                    .operator("IPMatch")
                    .negationCondition(false)
                    .matchValues(                    
                        "192.168.1.0/24",
                        "10.0.1.0/24")
                    .build())
                .build())
            .build());

        var exampleFrontdoorSecurityPolicy = new FrontdoorSecurityPolicy("exampleFrontdoorSecurityPolicy", FrontdoorSecurityPolicyArgs.builder()        
            .cdnFrontdoorProfileId(exampleFrontdoorProfile.id())
            .securityPolicies(FrontdoorSecurityPolicySecurityPoliciesArgs.builder()
                .firewall(FrontdoorSecurityPolicySecurityPoliciesFirewallArgs.builder()
                    .cdnFrontdoorFirewallPolicyId(exampleFrontdoorFirewallPolicy.id())
                    .association(FrontdoorSecurityPolicySecurityPoliciesFirewallAssociationArgs.builder()
                        .domains(FrontdoorSecurityPolicySecurityPoliciesFirewallAssociationDomainArgs.builder()
                            .cdnFrontdoorDomainId(azurerm_cdn_frontdoor_custom_domain.domain1().id())
                            .build())
                        .patternsToMatch("/*")
                        .build())
                    .build())
                .build())
            .build());

    }
}

Coming soon!

Coming soon!

resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleFrontdoorProfile:
    type: azure:cdn:FrontdoorProfile
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
  exampleFrontdoorFirewallPolicy:
    type: azure:cdn:FrontdoorFirewallPolicy
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      skuName: ${exampleFrontdoorProfile.skuName}
      enabled: true
      mode: Prevention
      redirectUrl: https://www.contoso.com
      customBlockResponseStatusCode: 403
      customBlockResponseBody: PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==
      customRules:
        - name: Rule1
          enabled: true
          priority: 1
          rateLimitDurationInMinutes: 1
          rateLimitThreshold: 10
          type: MatchRule
          action: Block
          matchConditions:
            - matchVariable: RemoteAddr
              operator: IPMatch
              negationCondition: false
              matchValues:
                - 192.168.1.0/24
                - 10.0.1.0/24
  exampleFrontdoorSecurityPolicy:
    type: azure:cdn:FrontdoorSecurityPolicy
    properties:
      cdnFrontdoorProfileId: ${exampleFrontdoorProfile.id}
      securityPolicies:
        firewall:
          cdnFrontdoorFirewallPolicyId: ${exampleFrontdoorFirewallPolicy.id}
          association:
            domains:
              - cdnFrontdoorDomainId: ${azurerm_cdn_frontdoor_custom_domain.domain1.id}
            patternsToMatch:
              - /*

Create FrontdoorSecurityPolicy Resource

new FrontdoorSecurityPolicy(name: string, args: FrontdoorSecurityPolicyArgs, opts?: CustomResourceOptions);
@overload
def FrontdoorSecurityPolicy(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            cdn_frontdoor_profile_id: Optional[str] = None,
                            name: Optional[str] = None,
                            security_policies: Optional[FrontdoorSecurityPolicySecurityPoliciesArgs] = None)
@overload
def FrontdoorSecurityPolicy(resource_name: str,
                            args: FrontdoorSecurityPolicyArgs,
                            opts: Optional[ResourceOptions] = None)
func NewFrontdoorSecurityPolicy(ctx *Context, name string, args FrontdoorSecurityPolicyArgs, opts ...ResourceOption) (*FrontdoorSecurityPolicy, error)
public FrontdoorSecurityPolicy(string name, FrontdoorSecurityPolicyArgs args, CustomResourceOptions? opts = null)
public FrontdoorSecurityPolicy(String name, FrontdoorSecurityPolicyArgs args)
public FrontdoorSecurityPolicy(String name, FrontdoorSecurityPolicyArgs args, CustomResourceOptions options)
type: azure:cdn:FrontdoorSecurityPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args FrontdoorSecurityPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args FrontdoorSecurityPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args FrontdoorSecurityPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FrontdoorSecurityPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args FrontdoorSecurityPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

FrontdoorSecurityPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The FrontdoorSecurityPolicy resource accepts the following input properties:

CdnFrontdoorProfileId string

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

SecurityPolicies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

Name string

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

CdnFrontdoorProfileId string

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

SecurityPolicies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

Name string

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

cdnFrontdoorProfileId String

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

securityPolicies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

name String

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

cdnFrontdoorProfileId string

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

securityPolicies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

name string

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

cdn_frontdoor_profile_id str

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

security_policies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

name str

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

cdnFrontdoorProfileId String

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

securityPolicies Property Map

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

name String

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the FrontdoorSecurityPolicy resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing FrontdoorSecurityPolicy Resource

Get an existing FrontdoorSecurityPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: FrontdoorSecurityPolicyState, opts?: CustomResourceOptions): FrontdoorSecurityPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cdn_frontdoor_profile_id: Optional[str] = None,
        name: Optional[str] = None,
        security_policies: Optional[FrontdoorSecurityPolicySecurityPoliciesArgs] = None) -> FrontdoorSecurityPolicy
func GetFrontdoorSecurityPolicy(ctx *Context, name string, id IDInput, state *FrontdoorSecurityPolicyState, opts ...ResourceOption) (*FrontdoorSecurityPolicy, error)
public static FrontdoorSecurityPolicy Get(string name, Input<string> id, FrontdoorSecurityPolicyState? state, CustomResourceOptions? opts = null)
public static FrontdoorSecurityPolicy get(String name, Output<String> id, FrontdoorSecurityPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CdnFrontdoorProfileId string

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

Name string

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

SecurityPolicies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

CdnFrontdoorProfileId string

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

Name string

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

SecurityPolicies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

cdnFrontdoorProfileId String

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

name String

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

securityPolicies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

cdnFrontdoorProfileId string

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

name string

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

securityPolicies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

cdn_frontdoor_profile_id str

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

name str

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

security_policies FrontdoorSecurityPolicySecurityPoliciesArgs

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

cdnFrontdoorProfileId String

The Front Door Profile Resource Id that is linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

name String

The name which should be used for this Front Door Security Policy. Possible values must not be an empty string. Changing this forces a new Front Door Security Policy to be created.

securityPolicies Property Map

An security_policies block as defined below. Changing this forces a new Front Door Security Policy to be created.

Supporting Types

FrontdoorSecurityPolicySecurityPolicies

Firewall FrontdoorSecurityPolicySecurityPoliciesFirewall

An firewall block as defined below. Changing this forces a new Front Door Security Policy to be created.

Firewall FrontdoorSecurityPolicySecurityPoliciesFirewall

An firewall block as defined below. Changing this forces a new Front Door Security Policy to be created.

firewall FrontdoorSecurityPolicySecurityPoliciesFirewall

An firewall block as defined below. Changing this forces a new Front Door Security Policy to be created.

firewall FrontdoorSecurityPolicySecurityPoliciesFirewall

An firewall block as defined below. Changing this forces a new Front Door Security Policy to be created.

firewall FrontdoorSecurityPolicySecurityPoliciesFirewall

An firewall block as defined below. Changing this forces a new Front Door Security Policy to be created.

firewall Property Map

An firewall block as defined below. Changing this forces a new Front Door Security Policy to be created.

FrontdoorSecurityPolicySecurityPoliciesFirewall

Association FrontdoorSecurityPolicySecurityPoliciesFirewallAssociation

An association block as defined below. Changing this forces a new Front Door Security Policy to be created.

CdnFrontdoorFirewallPolicyId string

The Resource Id of the Front Door Firewall Policy that should be linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

Association FrontdoorSecurityPolicySecurityPoliciesFirewallAssociation

An association block as defined below. Changing this forces a new Front Door Security Policy to be created.

CdnFrontdoorFirewallPolicyId string

The Resource Id of the Front Door Firewall Policy that should be linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

association FrontdoorSecurityPolicySecurityPoliciesFirewallAssociation

An association block as defined below. Changing this forces a new Front Door Security Policy to be created.

cdnFrontdoorFirewallPolicyId String

The Resource Id of the Front Door Firewall Policy that should be linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

association FrontdoorSecurityPolicySecurityPoliciesFirewallAssociation

An association block as defined below. Changing this forces a new Front Door Security Policy to be created.

cdnFrontdoorFirewallPolicyId string

The Resource Id of the Front Door Firewall Policy that should be linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

association FrontdoorSecurityPolicySecurityPoliciesFirewallAssociation

An association block as defined below. Changing this forces a new Front Door Security Policy to be created.

cdn_frontdoor_firewall_policy_id str

The Resource Id of the Front Door Firewall Policy that should be linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

association Property Map

An association block as defined below. Changing this forces a new Front Door Security Policy to be created.

cdnFrontdoorFirewallPolicyId String

The Resource Id of the Front Door Firewall Policy that should be linked to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

FrontdoorSecurityPolicySecurityPoliciesFirewallAssociation

Domains List<FrontdoorSecurityPolicySecurityPoliciesFirewallAssociationDomain>

One or more domain blocks as defined below. Changing this forces a new Front Door Security Policy to be created.

PatternsToMatch string

The list of paths to match for this firewall policy. Possible value includes /*. Changing this forces a new Front Door Security Policy to be created.

Domains []FrontdoorSecurityPolicySecurityPoliciesFirewallAssociationDomain

One or more domain blocks as defined below. Changing this forces a new Front Door Security Policy to be created.

PatternsToMatch string

The list of paths to match for this firewall policy. Possible value includes /*. Changing this forces a new Front Door Security Policy to be created.

domains List<FrontdoorSecurityPolicySecurityPoliciesFirewallAssociationDomain>

One or more domain blocks as defined below. Changing this forces a new Front Door Security Policy to be created.

patternsToMatch String

The list of paths to match for this firewall policy. Possible value includes /*. Changing this forces a new Front Door Security Policy to be created.

domains FrontdoorSecurityPolicySecurityPoliciesFirewallAssociationDomain[]

One or more domain blocks as defined below. Changing this forces a new Front Door Security Policy to be created.

patternsToMatch string

The list of paths to match for this firewall policy. Possible value includes /*. Changing this forces a new Front Door Security Policy to be created.

domains Sequence[FrontdoorSecurityPolicySecurityPoliciesFirewallAssociationDomain]

One or more domain blocks as defined below. Changing this forces a new Front Door Security Policy to be created.

patterns_to_match str

The list of paths to match for this firewall policy. Possible value includes /*. Changing this forces a new Front Door Security Policy to be created.

domains List<Property Map>

One or more domain blocks as defined below. Changing this forces a new Front Door Security Policy to be created.

patternsToMatch String

The list of paths to match for this firewall policy. Possible value includes /*. Changing this forces a new Front Door Security Policy to be created.

FrontdoorSecurityPolicySecurityPoliciesFirewallAssociationDomain

CdnFrontdoorDomainId string

The Resource Id of the Front Door Custom Domain or Front Door Endpoint that should be bound to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

Active bool

Is the Front Door Custom Domain/Endpoint activated?

CdnFrontdoorDomainId string

The Resource Id of the Front Door Custom Domain or Front Door Endpoint that should be bound to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

Active bool

Is the Front Door Custom Domain/Endpoint activated?

cdnFrontdoorDomainId String

The Resource Id of the Front Door Custom Domain or Front Door Endpoint that should be bound to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

active Boolean

Is the Front Door Custom Domain/Endpoint activated?

cdnFrontdoorDomainId string

The Resource Id of the Front Door Custom Domain or Front Door Endpoint that should be bound to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

active boolean

Is the Front Door Custom Domain/Endpoint activated?

cdn_frontdoor_domain_id str

The Resource Id of the Front Door Custom Domain or Front Door Endpoint that should be bound to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

active bool

Is the Front Door Custom Domain/Endpoint activated?

cdnFrontdoorDomainId String

The Resource Id of the Front Door Custom Domain or Front Door Endpoint that should be bound to this Front Door Security Policy. Changing this forces a new Front Door Security Policy to be created.

active Boolean

Is the Front Door Custom Domain/Endpoint activated?

Import

Front Door Security Policies can be imported using the resource id, e.g.

 $ pulumi import azure:cdn/frontdoorSecurityPolicy:FrontdoorSecurityPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Cdn/profiles/profile1/securityPolicies/policy1

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.