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:
- Cdn
Frontdoor stringProfile Id 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 FrontdoorSecurity Policy Security Policies Args 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 stringProfile Id 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 FrontdoorSecurity Policy Security Policies Args 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 StringProfile Id 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 FrontdoorSecurity Policy Security Policies Args 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 stringProfile Id 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 FrontdoorSecurity Policy Security Policies Args 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_ strprofile_ id 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 FrontdoorSecurity Policy Security Policies Args 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.
- cdn
Frontdoor StringProfile Id 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 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.
- Cdn
Frontdoor stringProfile Id 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.
- Security
Policies FrontdoorSecurity Policy Security Policies Args An
security_policies
block as defined below. Changing this forces a new Front Door Security Policy to be created.
- Cdn
Frontdoor stringProfile Id 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.
- Security
Policies FrontdoorSecurity Policy Security Policies Args An
security_policies
block as defined below. Changing this forces a new Front Door Security Policy to be created.
- cdn
Frontdoor StringProfile Id 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.
- security
Policies FrontdoorSecurity Policy Security Policies Args An
security_policies
block as defined below. Changing this forces a new Front Door Security Policy to be created.
- cdn
Frontdoor stringProfile Id 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.
- security
Policies FrontdoorSecurity Policy Security Policies Args An
security_policies
block as defined below. Changing this forces a new Front Door Security Policy to be created.
- cdn_
frontdoor_ strprofile_ id 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 FrontdoorSecurity Policy Security Policies Args An
security_policies
block as defined below. Changing this forces a new Front Door Security Policy to be created.
- cdn
Frontdoor StringProfile Id 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.
- security
Policies 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
Frontdoor
Security Policy Security Policies Firewall An
firewall
block as defined below. Changing this forces a new Front Door Security Policy to be created.
- Firewall
Frontdoor
Security Policy Security Policies Firewall An
firewall
block as defined below. Changing this forces a new Front Door Security Policy to be created.
- firewall
Frontdoor
Security Policy Security Policies Firewall An
firewall
block as defined below. Changing this forces a new Front Door Security Policy to be created.
- firewall
Frontdoor
Security Policy Security Policies Firewall An
firewall
block as defined below. Changing this forces a new Front Door Security Policy to be created.
- firewall
Frontdoor
Security Policy Security Policies Firewall 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
Frontdoor
Security Policy Security Policies Firewall Association An
association
block as defined below. Changing this forces a new Front Door Security Policy to be created.- Cdn
Frontdoor stringFirewall Policy Id 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
Frontdoor
Security Policy Security Policies Firewall Association An
association
block as defined below. Changing this forces a new Front Door Security Policy to be created.- Cdn
Frontdoor stringFirewall Policy Id 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
Frontdoor
Security Policy Security Policies Firewall Association An
association
block as defined below. Changing this forces a new Front Door Security Policy to be created.- cdn
Frontdoor StringFirewall Policy Id 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
Frontdoor
Security Policy Security Policies Firewall Association An
association
block as defined below. Changing this forces a new Front Door Security Policy to be created.- cdn
Frontdoor stringFirewall Policy Id 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
Frontdoor
Security Policy Security Policies Firewall Association An
association
block as defined below. Changing this forces a new Front Door Security Policy to be created.- cdn_
frontdoor_ strfirewall_ policy_ id 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.- cdn
Frontdoor StringFirewall Policy Id 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<Frontdoor
Security Policy Security Policies Firewall Association Domain> One or more
domain
blocks as defined below. Changing this forces a new Front Door Security Policy to be created.- Patterns
To stringMatch 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
[]Frontdoor
Security Policy Security Policies Firewall Association Domain One or more
domain
blocks as defined below. Changing this forces a new Front Door Security Policy to be created.- Patterns
To stringMatch 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<Frontdoor
Security Policy Security Policies Firewall Association Domain> One or more
domain
blocks as defined below. Changing this forces a new Front Door Security Policy to be created.- patterns
To StringMatch 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
Frontdoor
Security Policy Security Policies Firewall Association Domain[] One or more
domain
blocks as defined below. Changing this forces a new Front Door Security Policy to be created.- patterns
To stringMatch 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[Frontdoor
Security Policy Security Policies Firewall Association Domain] One or more
domain
blocks as defined below. Changing this forces a new Front Door Security Policy to be created.- patterns_
to_ strmatch 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.- patterns
To StringMatch 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
- Cdn
Frontdoor stringDomain Id 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?
- Cdn
Frontdoor stringDomain Id 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?
- cdn
Frontdoor StringDomain Id 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 stringDomain Id 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_ strdomain_ id 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?
- cdn
Frontdoor StringDomain Id 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.