azure-native.cdn.SecurityPolicy
Explore with Pulumi AI
SecurityPolicy association for AzureFrontDoor profile Azure REST API version: 2023-05-01. Prior API version in Azure Native 1.x: 2020-09-01.
Other available API versions: 2023-07-01-preview, 2024-02-01, 2024-05-01-preview, 2024-06-01-preview.
Example Usage
SecurityPolicies_Create
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var securityPolicy = new AzureNative.Cdn.SecurityPolicy("securityPolicy", new()
{
Parameters = new AzureNative.Cdn.Inputs.SecurityPolicyWebApplicationFirewallParametersArgs
{
Associations = new[]
{
new AzureNative.Cdn.Inputs.SecurityPolicyWebApplicationFirewallAssociationArgs
{
Domains = new[]
{
new AzureNative.Cdn.Inputs.ActivatedResourceReferenceArgs
{
Id = "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1",
},
new AzureNative.Cdn.Inputs.ActivatedResourceReferenceArgs
{
Id = "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2",
},
},
PatternsToMatch = new[]
{
"/*",
},
},
},
Type = "WebApplicationFirewall",
WafPolicy = new AzureNative.Cdn.Inputs.ResourceReferenceArgs
{
Id = "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest",
},
},
ProfileName = "profile1",
ResourceGroupName = "RG",
SecurityPolicyName = "securityPolicy1",
});
});
package main
import (
cdn "github.com/pulumi/pulumi-azure-native-sdk/cdn/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cdn.NewSecurityPolicy(ctx, "securityPolicy", &cdn.SecurityPolicyArgs{
Parameters: &cdn.SecurityPolicyWebApplicationFirewallParametersArgs{
Associations: cdn.SecurityPolicyWebApplicationFirewallAssociationArray{
&cdn.SecurityPolicyWebApplicationFirewallAssociationArgs{
Domains: cdn.ActivatedResourceReferenceArray{
&cdn.ActivatedResourceReferenceArgs{
Id: pulumi.String("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"),
},
&cdn.ActivatedResourceReferenceArgs{
Id: pulumi.String("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"),
},
},
PatternsToMatch: pulumi.StringArray{
pulumi.String("/*"),
},
},
},
Type: pulumi.String("WebApplicationFirewall"),
WafPolicy: &cdn.ResourceReferenceArgs{
Id: pulumi.String("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"),
},
},
ProfileName: pulumi.String("profile1"),
ResourceGroupName: pulumi.String("RG"),
SecurityPolicyName: pulumi.String("securityPolicy1"),
})
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.cdn.SecurityPolicy;
import com.pulumi.azurenative.cdn.SecurityPolicyArgs;
import com.pulumi.azurenative.cdn.inputs.SecurityPolicyWebApplicationFirewallParametersArgs;
import com.pulumi.azurenative.cdn.inputs.ResourceReferenceArgs;
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 securityPolicy = new SecurityPolicy("securityPolicy", SecurityPolicyArgs.builder()
.parameters(SecurityPolicyWebApplicationFirewallParametersArgs.builder()
.associations(SecurityPolicyWebApplicationFirewallAssociationArgs.builder()
.domains(
ActivatedResourceReferenceArgs.builder()
.id("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1")
.build(),
ActivatedResourceReferenceArgs.builder()
.id("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2")
.build())
.patternsToMatch("/*")
.build())
.type("WebApplicationFirewall")
.wafPolicy(ResourceReferenceArgs.builder()
.id("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest")
.build())
.build())
.profileName("profile1")
.resourceGroupName("RG")
.securityPolicyName("securityPolicy1")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
security_policy = azure_native.cdn.SecurityPolicy("securityPolicy",
parameters={
"associations": [{
"domains": [
{
"id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1",
},
{
"id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2",
},
],
"patterns_to_match": ["/*"],
}],
"type": "WebApplicationFirewall",
"waf_policy": {
"id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest",
},
},
profile_name="profile1",
resource_group_name="RG",
security_policy_name="securityPolicy1")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const securityPolicy = new azure_native.cdn.SecurityPolicy("securityPolicy", {
parameters: {
associations: [{
domains: [
{
id: "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1",
},
{
id: "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2",
},
],
patternsToMatch: ["/*"],
}],
type: "WebApplicationFirewall",
wafPolicy: {
id: "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest",
},
},
profileName: "profile1",
resourceGroupName: "RG",
securityPolicyName: "securityPolicy1",
});
resources:
securityPolicy:
type: azure-native:cdn:SecurityPolicy
properties:
parameters:
associations:
- domains:
- id: /subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1
- id: /subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2
patternsToMatch:
- /*
type: WebApplicationFirewall
wafPolicy:
id: /subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest
profileName: profile1
resourceGroupName: RG
securityPolicyName: securityPolicy1
Create SecurityPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SecurityPolicy(name: string, args: SecurityPolicyArgs, opts?: CustomResourceOptions);
@overload
def SecurityPolicy(resource_name: str,
args: SecurityPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SecurityPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
profile_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
parameters: Optional[SecurityPolicyWebApplicationFirewallParametersArgs] = None,
security_policy_name: Optional[str] = None)
func NewSecurityPolicy(ctx *Context, name string, args SecurityPolicyArgs, opts ...ResourceOption) (*SecurityPolicy, error)
public SecurityPolicy(string name, SecurityPolicyArgs args, CustomResourceOptions? opts = null)
public SecurityPolicy(String name, SecurityPolicyArgs args)
public SecurityPolicy(String name, SecurityPolicyArgs args, CustomResourceOptions options)
type: azure-native:cdn:SecurityPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SecurityPolicyArgs
- 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 SecurityPolicyArgs
- 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 SecurityPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecurityPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecurityPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var securityPolicyResource = new AzureNative.Cdn.SecurityPolicy("securityPolicyResource", new()
{
ProfileName = "string",
ResourceGroupName = "string",
Parameters = new AzureNative.Cdn.Inputs.SecurityPolicyWebApplicationFirewallParametersArgs
{
Type = "WebApplicationFirewall",
Associations = new[]
{
new AzureNative.Cdn.Inputs.SecurityPolicyWebApplicationFirewallAssociationArgs
{
Domains = new[]
{
new AzureNative.Cdn.Inputs.ActivatedResourceReferenceArgs
{
Id = "string",
},
},
PatternsToMatch = new[]
{
"string",
},
},
},
WafPolicy = new AzureNative.Cdn.Inputs.ResourceReferenceArgs
{
Id = "string",
},
},
SecurityPolicyName = "string",
});
example, err := cdn.NewSecurityPolicy(ctx, "securityPolicyResource", &cdn.SecurityPolicyArgs{
ProfileName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
Parameters: &cdn.SecurityPolicyWebApplicationFirewallParametersArgs{
Type: pulumi.String("WebApplicationFirewall"),
Associations: cdn.SecurityPolicyWebApplicationFirewallAssociationArray{
&cdn.SecurityPolicyWebApplicationFirewallAssociationArgs{
Domains: cdn.ActivatedResourceReferenceArray{
&cdn.ActivatedResourceReferenceArgs{
Id: pulumi.String("string"),
},
},
PatternsToMatch: pulumi.StringArray{
pulumi.String("string"),
},
},
},
WafPolicy: &cdn.ResourceReferenceArgs{
Id: pulumi.String("string"),
},
},
SecurityPolicyName: pulumi.String("string"),
})
var securityPolicyResource = new SecurityPolicy("securityPolicyResource", SecurityPolicyArgs.builder()
.profileName("string")
.resourceGroupName("string")
.parameters(SecurityPolicyWebApplicationFirewallParametersArgs.builder()
.type("WebApplicationFirewall")
.associations(SecurityPolicyWebApplicationFirewallAssociationArgs.builder()
.domains(ActivatedResourceReferenceArgs.builder()
.id("string")
.build())
.patternsToMatch("string")
.build())
.wafPolicy(ResourceReferenceArgs.builder()
.id("string")
.build())
.build())
.securityPolicyName("string")
.build());
security_policy_resource = azure_native.cdn.SecurityPolicy("securityPolicyResource",
profile_name="string",
resource_group_name="string",
parameters={
"type": "WebApplicationFirewall",
"associations": [{
"domains": [{
"id": "string",
}],
"patternsToMatch": ["string"],
}],
"wafPolicy": {
"id": "string",
},
},
security_policy_name="string")
const securityPolicyResource = new azure_native.cdn.SecurityPolicy("securityPolicyResource", {
profileName: "string",
resourceGroupName: "string",
parameters: {
type: "WebApplicationFirewall",
associations: [{
domains: [{
id: "string",
}],
patternsToMatch: ["string"],
}],
wafPolicy: {
id: "string",
},
},
securityPolicyName: "string",
});
type: azure-native:cdn:SecurityPolicy
properties:
parameters:
associations:
- domains:
- id: string
patternsToMatch:
- string
type: WebApplicationFirewall
wafPolicy:
id: string
profileName: string
resourceGroupName: string
securityPolicyName: string
SecurityPolicy 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 SecurityPolicy resource accepts the following input properties:
- Profile
Name string - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
- Resource
Group stringName - Name of the Resource group within the Azure subscription.
- Parameters
Pulumi.
Azure Native. Cdn. Inputs. Security Policy Web Application Firewall Parameters - object which contains security policy parameters
- Security
Policy stringName - Name of the security policy under the profile.
- Profile
Name string - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
- Resource
Group stringName - Name of the Resource group within the Azure subscription.
- Parameters
Security
Policy Web Application Firewall Parameters Args - object which contains security policy parameters
- Security
Policy stringName - Name of the security policy under the profile.
- profile
Name String - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
- resource
Group StringName - Name of the Resource group within the Azure subscription.
- parameters
Security
Policy Web Application Firewall Parameters - object which contains security policy parameters
- security
Policy StringName - Name of the security policy under the profile.
- profile
Name string - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
- resource
Group stringName - Name of the Resource group within the Azure subscription.
- parameters
Security
Policy Web Application Firewall Parameters - object which contains security policy parameters
- security
Policy stringName - Name of the security policy under the profile.
- profile_
name str - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
- resource_
group_ strname - Name of the Resource group within the Azure subscription.
- parameters
Security
Policy Web Application Firewall Parameters Args - object which contains security policy parameters
- security_
policy_ strname - Name of the security policy under the profile.
- profile
Name String - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
- resource
Group StringName - Name of the Resource group within the Azure subscription.
- parameters Property Map
- object which contains security policy parameters
- security
Policy StringName - Name of the security policy under the profile.
Outputs
All input properties are implicitly available as output properties. Additionally, the SecurityPolicy resource produces the following output properties:
- Deployment
Status string - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource name.
- Provisioning
State string - Provisioning status
- System
Data Pulumi.Azure Native. Cdn. Outputs. System Data Response - Read only system data
- Type string
- Resource type.
- Deployment
Status string - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource name.
- Provisioning
State string - Provisioning status
- System
Data SystemData Response - Read only system data
- Type string
- Resource type.
- deployment
Status String - id String
- The provider-assigned unique ID for this managed resource.
- name String
- Resource name.
- provisioning
State String - Provisioning status
- system
Data SystemData Response - Read only system data
- type String
- Resource type.
- deployment
Status string - id string
- The provider-assigned unique ID for this managed resource.
- name string
- Resource name.
- provisioning
State string - Provisioning status
- system
Data SystemData Response - Read only system data
- type string
- Resource type.
- deployment_
status str - id str
- The provider-assigned unique ID for this managed resource.
- name str
- Resource name.
- provisioning_
state str - Provisioning status
- system_
data SystemData Response - Read only system data
- type str
- Resource type.
- deployment
Status String - id String
- The provider-assigned unique ID for this managed resource.
- name String
- Resource name.
- provisioning
State String - Provisioning status
- system
Data Property Map - Read only system data
- type String
- Resource type.
Supporting Types
ActivatedResourceReference, ActivatedResourceReferenceArgs
- Id string
- Resource ID.
- Id string
- Resource ID.
- id String
- Resource ID.
- id string
- Resource ID.
- id str
- Resource ID.
- id String
- Resource ID.
ActivatedResourceReferenceResponse, ActivatedResourceReferenceResponseArgs
ResourceReference, ResourceReferenceArgs
- Id string
- Resource ID.
- Id string
- Resource ID.
- id String
- Resource ID.
- id string
- Resource ID.
- id str
- Resource ID.
- id String
- Resource ID.
ResourceReferenceResponse, ResourceReferenceResponseArgs
- Id string
- Resource ID.
- Id string
- Resource ID.
- id String
- Resource ID.
- id string
- Resource ID.
- id str
- Resource ID.
- id String
- Resource ID.
SecurityPolicyWebApplicationFirewallAssociation, SecurityPolicyWebApplicationFirewallAssociationArgs
- Domains
List<Pulumi.
Azure Native. Cdn. Inputs. Activated Resource Reference> - List of domains.
- Patterns
To List<string>Match - List of paths
- Domains
[]Activated
Resource Reference - List of domains.
- Patterns
To []stringMatch - List of paths
- domains
List<Activated
Resource Reference> - List of domains.
- patterns
To List<String>Match - List of paths
- domains
Activated
Resource Reference[] - List of domains.
- patterns
To string[]Match - List of paths
- domains
Sequence[Activated
Resource Reference] - List of domains.
- patterns_
to_ Sequence[str]match - List of paths
- domains List<Property Map>
- List of domains.
- patterns
To List<String>Match - List of paths
SecurityPolicyWebApplicationFirewallAssociationResponse, SecurityPolicyWebApplicationFirewallAssociationResponseArgs
- Domains
List<Pulumi.
Azure Native. Cdn. Inputs. Activated Resource Reference Response> - List of domains.
- Patterns
To List<string>Match - List of paths
- Domains
[]Activated
Resource Reference Response - List of domains.
- Patterns
To []stringMatch - List of paths
- domains
List<Activated
Resource Reference Response> - List of domains.
- patterns
To List<String>Match - List of paths
- domains
Activated
Resource Reference Response[] - List of domains.
- patterns
To string[]Match - List of paths
- domains
Sequence[Activated
Resource Reference Response] - List of domains.
- patterns_
to_ Sequence[str]match - List of paths
- domains List<Property Map>
- List of domains.
- patterns
To List<String>Match - List of paths
SecurityPolicyWebApplicationFirewallParameters, SecurityPolicyWebApplicationFirewallParametersArgs
- Associations
[]Security
Policy Web Application Firewall Association - Waf associations
- Waf
Policy ResourceReference - Resource ID.
- associations
List<Security
Policy Web Application Firewall Association> - Waf associations
- waf
Policy ResourceReference - Resource ID.
- associations
Security
Policy Web Application Firewall Association[] - Waf associations
- waf
Policy ResourceReference - Resource ID.
- associations
Sequence[Security
Policy Web Application Firewall Association] - Waf associations
- waf_
policy ResourceReference - Resource ID.
- associations List<Property Map>
- Waf associations
- waf
Policy Property Map - Resource ID.
SecurityPolicyWebApplicationFirewallParametersResponse, SecurityPolicyWebApplicationFirewallParametersResponseArgs
- Associations
[]Security
Policy Web Application Firewall Association Response - Waf associations
- Waf
Policy ResourceReference Response - Resource ID.
- associations
List<Security
Policy Web Application Firewall Association Response> - Waf associations
- waf
Policy ResourceReference Response - Resource ID.
- associations
Security
Policy Web Application Firewall Association Response[] - Waf associations
- waf
Policy ResourceReference Response - Resource ID.
- associations
Sequence[Security
Policy Web Application Firewall Association Response] - Waf associations
- waf_
policy ResourceReference Response - Resource ID.
- associations List<Property Map>
- Waf associations
- waf
Policy Property Map - Resource ID.
SystemDataResponse, SystemDataResponseArgs
- Created
At string - The timestamp of resource creation (UTC)
- Created
By string - An identifier for the identity that created the resource
- Created
By stringType - The type of identity that created the resource
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - An identifier for the identity that last modified the resource
- Last
Modified stringBy Type - The type of identity that last modified the resource
- Created
At string - The timestamp of resource creation (UTC)
- Created
By string - An identifier for the identity that created the resource
- Created
By stringType - The type of identity that created the resource
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - An identifier for the identity that last modified the resource
- Last
Modified stringBy Type - The type of identity that last modified the resource
- created
At String - The timestamp of resource creation (UTC)
- created
By String - An identifier for the identity that created the resource
- created
By StringType - The type of identity that created the resource
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - An identifier for the identity that last modified the resource
- last
Modified StringBy Type - The type of identity that last modified the resource
- created
At string - The timestamp of resource creation (UTC)
- created
By string - An identifier for the identity that created the resource
- created
By stringType - The type of identity that created the resource
- last
Modified stringAt - The timestamp of resource last modification (UTC)
- last
Modified stringBy - An identifier for the identity that last modified the resource
- last
Modified stringBy Type - The type of identity that last modified the resource
- created_
at str - The timestamp of resource creation (UTC)
- created_
by str - An identifier for the identity that created the resource
- created_
by_ strtype - The type of identity that created the resource
- last_
modified_ strat - The timestamp of resource last modification (UTC)
- last_
modified_ strby - An identifier for the identity that last modified the resource
- last_
modified_ strby_ type - The type of identity that last modified the resource
- created
At String - The timestamp of resource creation (UTC)
- created
By String - An identifier for the identity that created the resource
- created
By StringType - The type of identity that created the resource
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - An identifier for the identity that last modified the resource
- last
Modified StringBy Type - The type of identity that last modified the resource
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:cdn:SecurityPolicy securityPolicy1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0