EndpointArgs

data class EndpointArgs(val contentTypesToCompress: Output<List<String>>? = null, val defaultOriginGroup: Output<ResourceReferenceArgs>? = null, val deliveryPolicy: Output<EndpointPropertiesUpdateParametersDeliveryPolicyArgs>? = null, val endpointName: Output<String>? = null, val geoFilters: Output<List<GeoFilterArgs>>? = null, val isCompressionEnabled: Output<Boolean>? = null, val isHttpAllowed: Output<Boolean>? = null, val isHttpsAllowed: Output<Boolean>? = null, val location: Output<String>? = null, val optimizationType: Output<Either<String, OptimizationType>>? = null, val originGroups: Output<List<DeepCreatedOriginGroupArgs>>? = null, val originHostHeader: Output<String>? = null, val originPath: Output<String>? = null, val origins: Output<List<DeepCreatedOriginArgs>>? = null, val probePath: Output<String>? = null, val profileName: Output<String>? = null, val queryStringCachingBehavior: Output<QueryStringCachingBehavior>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val urlSigningKeys: Output<List<UrlSigningKeyArgs>>? = null, val webApplicationFirewallPolicyLink: Output<EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLinkArgs>? = null) : ConvertibleToJava<EndpointArgs>

CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format .azureedge.net. Uses Azure REST API version 2024-09-01. In version 2.x of the Azure Native provider, it used API version 2023-05-01. Other available API versions: 2023-05-01, 2023-07-01-preview, 2024-02-01, 2024-05-01-preview, 2024-06-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native cdn [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Endpoints_Create

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var endpoint = new AzureNative.Cdn.Endpoint("endpoint", new()
{
ContentTypesToCompress = new[]
{
"text/html",
"application/octet-stream",
},
DefaultOriginGroup = new AzureNative.Cdn.Inputs.ResourceReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1",
},
DeliveryPolicy = new AzureNative.Cdn.Inputs.EndpointPropertiesUpdateParametersDeliveryPolicyArgs
{
Description = "Test description for a policy.",
Rules = new[]
{
new AzureNative.Cdn.Inputs.DeliveryRuleArgs
{
Actions =
{
new AzureNative.Cdn.Inputs.DeliveryRuleCacheExpirationActionArgs
{
Name = "CacheExpiration",
Parameters = new AzureNative.Cdn.Inputs.CacheExpirationActionParametersArgs
{
CacheBehavior = AzureNative.Cdn.CacheBehavior.Override,
CacheDuration = "10:10:09",
CacheType = AzureNative.Cdn.CacheType.All,
TypeName = "DeliveryRuleCacheExpirationActionParameters",
},
},
new AzureNative.Cdn.Inputs.DeliveryRuleResponseHeaderActionArgs
{
Name = "ModifyResponseHeader",
Parameters = new AzureNative.Cdn.Inputs.HeaderActionParametersArgs
{
HeaderAction = AzureNative.Cdn.HeaderAction.Overwrite,
HeaderName = "Access-Control-Allow-Origin",
TypeName = "DeliveryRuleHeaderActionParameters",
Value = "*",
},
},
new AzureNative.Cdn.Inputs.DeliveryRuleRequestHeaderActionArgs
{
Name = "ModifyRequestHeader",
Parameters = new AzureNative.Cdn.Inputs.HeaderActionParametersArgs
{
HeaderAction = AzureNative.Cdn.HeaderAction.Overwrite,
HeaderName = "Accept-Encoding",
TypeName = "DeliveryRuleHeaderActionParameters",
Value = "gzip",
},
},
},
Conditions = new[]
{
new AzureNative.Cdn.Inputs.DeliveryRuleRemoteAddressConditionArgs
{
Name = "RemoteAddress",
Parameters = new AzureNative.Cdn.Inputs.RemoteAddressMatchConditionParametersArgs
{
MatchValues = new[]
{
"192.168.1.0/24",
"10.0.0.0/24",
},
NegateCondition = true,
Operator = AzureNative.Cdn.RemoteAddressOperator.IPMatch,
TypeName = "DeliveryRuleRemoteAddressConditionParameters",
},
},
},
Name = "rule1",
Order = 1,
},
},
},
EndpointName = "endpoint1",
IsCompressionEnabled = true,
IsHttpAllowed = true,
IsHttpsAllowed = true,
Location = "WestUs",
OriginGroups = new[]
{
new AzureNative.Cdn.Inputs.DeepCreatedOriginGroupArgs
{
HealthProbeSettings = new AzureNative.Cdn.Inputs.HealthProbeParametersArgs
{
ProbeIntervalInSeconds = 120,
ProbePath = "/health.aspx",
ProbeProtocol = AzureNative.Cdn.ProbeProtocol.Http,
ProbeRequestType = AzureNative.Cdn.HealthProbeRequestType.GET,
},
Name = "originGroup1",
Origins = new[]
{
new AzureNative.Cdn.Inputs.ResourceReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1",
},
new AzureNative.Cdn.Inputs.ResourceReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2",
},
},
ResponseBasedOriginErrorDetectionSettings = new AzureNative.Cdn.Inputs.ResponseBasedOriginErrorDetectionParametersArgs
{
ResponseBasedDetectedErrorTypes = AzureNative.Cdn.ResponseBasedDetectedErrorTypes.TcpErrorsOnly,
ResponseBasedFailoverThresholdPercentage = 10,
},
},
},
OriginHostHeader = "www.bing.com",
OriginPath = "/photos",
Origins = new[]
{
new AzureNative.Cdn.Inputs.DeepCreatedOriginArgs
{
Enabled = true,
HostName = "www.someDomain1.net",
HttpPort = 80,
HttpsPort = 443,
Name = "origin1",
OriginHostHeader = "www.someDomain1.net",
Priority = 1,
Weight = 50,
},
new AzureNative.Cdn.Inputs.DeepCreatedOriginArgs
{
Enabled = true,
HostName = "www.someDomain2.net",
HttpPort = 80,
HttpsPort = 443,
Name = "origin2",
OriginHostHeader = "www.someDomain2.net",
Priority = 2,
Weight = 50,
},
},
ProfileName = "profile1",
QueryStringCachingBehavior = AzureNative.Cdn.QueryStringCachingBehavior.BypassCaching,
ResourceGroupName = "RG",
Tags =
{
{ "key1", "value1" },
},
});
});
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.NewEndpoint(ctx, "endpoint", &cdn.EndpointArgs{
ContentTypesToCompress: pulumi.StringArray{
pulumi.String("text/html"),
pulumi.String("application/octet-stream"),
},
DefaultOriginGroup: &cdn.ResourceReferenceArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1"),
},
DeliveryPolicy: &cdn.EndpointPropertiesUpdateParametersDeliveryPolicyArgs{
Description: pulumi.String("Test description for a policy."),
Rules: cdn.DeliveryRuleArray{
&cdn.DeliveryRuleArgs{
Actions: pulumi.Array{
cdn.DeliveryRuleCacheExpirationAction{
Name: "CacheExpiration",
Parameters: cdn.CacheExpirationActionParameters{
CacheBehavior: cdn.CacheBehaviorOverride,
CacheDuration: "10:10:09",
CacheType: cdn.CacheTypeAll,
TypeName: "DeliveryRuleCacheExpirationActionParameters",
},
},
cdn.DeliveryRuleResponseHeaderAction{
Name: "ModifyResponseHeader",
Parameters: cdn.HeaderActionParameters{
HeaderAction: cdn.HeaderActionOverwrite,
HeaderName: "Access-Control-Allow-Origin",
TypeName: "DeliveryRuleHeaderActionParameters",
Value: "*",
},
},
cdn.DeliveryRuleRequestHeaderAction{
Name: "ModifyRequestHeader",
Parameters: cdn.HeaderActionParameters{
HeaderAction: cdn.HeaderActionOverwrite,
HeaderName: "Accept-Encoding",
TypeName: "DeliveryRuleHeaderActionParameters",
Value: "gzip",
},
},
},
Conditions: pulumi.Array{
cdn.DeliveryRuleRemoteAddressCondition{
Name: "RemoteAddress",
Parameters: cdn.RemoteAddressMatchConditionParameters{
MatchValues: []string{
"192.168.1.0/24",
"10.0.0.0/24",
},
NegateCondition: true,
Operator: cdn.RemoteAddressOperatorIPMatch,
TypeName: "DeliveryRuleRemoteAddressConditionParameters",
},
},
},
Name: pulumi.String("rule1"),
Order: pulumi.Int(1),
},
},
},
EndpointName: pulumi.String("endpoint1"),
IsCompressionEnabled: pulumi.Bool(true),
IsHttpAllowed: pulumi.Bool(true),
IsHttpsAllowed: pulumi.Bool(true),
Location: pulumi.String("WestUs"),
OriginGroups: cdn.DeepCreatedOriginGroupArray{
&cdn.DeepCreatedOriginGroupArgs{
HealthProbeSettings: &cdn.HealthProbeParametersArgs{
ProbeIntervalInSeconds: pulumi.Int(120),
ProbePath: pulumi.String("/health.aspx"),
ProbeProtocol: cdn.ProbeProtocolHttp,
ProbeRequestType: cdn.HealthProbeRequestTypeGET,
},
Name: pulumi.String("originGroup1"),
Origins: cdn.ResourceReferenceArray{
&cdn.ResourceReferenceArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"),
},
&cdn.ResourceReferenceArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2"),
},
},
ResponseBasedOriginErrorDetectionSettings: &cdn.ResponseBasedOriginErrorDetectionParametersArgs{
ResponseBasedDetectedErrorTypes: cdn.ResponseBasedDetectedErrorTypesTcpErrorsOnly,
ResponseBasedFailoverThresholdPercentage: pulumi.Int(10),
},
},
},
OriginHostHeader: pulumi.String("www.bing.com"),
OriginPath: pulumi.String("/photos"),
Origins: cdn.DeepCreatedOriginArray{
&cdn.DeepCreatedOriginArgs{
Enabled: pulumi.Bool(true),
HostName: pulumi.String("www.someDomain1.net"),
HttpPort: pulumi.Int(80),
HttpsPort: pulumi.Int(443),
Name: pulumi.String("origin1"),
OriginHostHeader: pulumi.String("www.someDomain1.net"),
Priority: pulumi.Int(1),
Weight: pulumi.Int(50),
},
&cdn.DeepCreatedOriginArgs{
Enabled: pulumi.Bool(true),
HostName: pulumi.String("www.someDomain2.net"),
HttpPort: pulumi.Int(80),
HttpsPort: pulumi.Int(443),
Name: pulumi.String("origin2"),
OriginHostHeader: pulumi.String("www.someDomain2.net"),
Priority: pulumi.Int(2),
Weight: pulumi.Int(50),
},
},
ProfileName: pulumi.String("profile1"),
QueryStringCachingBehavior: cdn.QueryStringCachingBehaviorBypassCaching,
ResourceGroupName: pulumi.String("RG"),
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.cdn.Endpoint;
import com.pulumi.azurenative.cdn.EndpointArgs;
import com.pulumi.azurenative.cdn.inputs.ResourceReferenceArgs;
import com.pulumi.azurenative.cdn.inputs.EndpointPropertiesUpdateParametersDeliveryPolicyArgs;
import com.pulumi.azurenative.cdn.inputs.DeepCreatedOriginGroupArgs;
import com.pulumi.azurenative.cdn.inputs.HealthProbeParametersArgs;
import com.pulumi.azurenative.cdn.inputs.ResponseBasedOriginErrorDetectionParametersArgs;
import com.pulumi.azurenative.cdn.inputs.DeepCreatedOriginArgs;
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 endpoint = new Endpoint("endpoint", EndpointArgs.builder()
.contentTypesToCompress(
"text/html",
"application/octet-stream")
.defaultOriginGroup(ResourceReferenceArgs.builder()
.id("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1")
.build())
.deliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicyArgs.builder()
.description("Test description for a policy.")
.rules(DeliveryRuleArgs.builder()
.actions(
DeliveryRuleCacheExpirationActionArgs.builder()
.name("CacheExpiration")
.parameters(CacheExpirationActionParametersArgs.builder()
.cacheBehavior("Override")
.cacheDuration("10:10:09")
.cacheType("All")
.typeName("DeliveryRuleCacheExpirationActionParameters")
.build())
.build(),
DeliveryRuleCacheExpirationActionArgs.builder()
.name("ModifyResponseHeader")
.parameters(CacheExpirationActionParametersArgs.builder()
.headerAction("Overwrite")
.headerName("Access-Control-Allow-Origin")
.typeName("DeliveryRuleHeaderActionParameters")
.value("*")
.build())
.build(),
DeliveryRuleCacheExpirationActionArgs.builder()
.name("ModifyRequestHeader")
.parameters(CacheExpirationActionParametersArgs.builder()
.headerAction("Overwrite")
.headerName("Accept-Encoding")
.typeName("DeliveryRuleHeaderActionParameters")
.value("gzip")
.build())
.build())
.conditions(DeliveryRuleRemoteAddressConditionArgs.builder()
.name("RemoteAddress")
.parameters(RemoteAddressMatchConditionParametersArgs.builder()
.matchValues(
"192.168.1.0/24",
"10.0.0.0/24")
.negateCondition(true)
.operator("IPMatch")
.typeName("DeliveryRuleRemoteAddressConditionParameters")
.build())
.build())
.name("rule1")
.order(1)
.build())
.build())
.endpointName("endpoint1")
.isCompressionEnabled(true)
.isHttpAllowed(true)
.isHttpsAllowed(true)
.location("WestUs")
.originGroups(DeepCreatedOriginGroupArgs.builder()
.healthProbeSettings(HealthProbeParametersArgs.builder()
.probeIntervalInSeconds(120)
.probePath("/health.aspx")
.probeProtocol("Http")
.probeRequestType("GET")
.build())
.name("originGroup1")
.origins(
ResourceReferenceArgs.builder()
.id("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1")
.build(),
ResourceReferenceArgs.builder()
.id("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2")
.build())
.responseBasedOriginErrorDetectionSettings(ResponseBasedOriginErrorDetectionParametersArgs.builder()
.responseBasedDetectedErrorTypes("TcpErrorsOnly")
.responseBasedFailoverThresholdPercentage(10)
.build())
.build())
.originHostHeader("www.bing.com")
.originPath("/photos")
.origins(
DeepCreatedOriginArgs.builder()
.enabled(true)
.hostName("www.someDomain1.net")
.httpPort(80)
.httpsPort(443)
.name("origin1")
.originHostHeader("www.someDomain1.net")
.priority(1)
.weight(50)
.build(),
DeepCreatedOriginArgs.builder()
.enabled(true)
.hostName("www.someDomain2.net")
.httpPort(80)
.httpsPort(443)
.name("origin2")
.originHostHeader("www.someDomain2.net")
.priority(2)
.weight(50)
.build())
.profileName("profile1")
.queryStringCachingBehavior("BypassCaching")
.resourceGroupName("RG")
.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:cdn:Endpoint endpoint4899 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}

Constructors

Link copied to clipboard
constructor(contentTypesToCompress: Output<List<String>>? = null, defaultOriginGroup: Output<ResourceReferenceArgs>? = null, deliveryPolicy: Output<EndpointPropertiesUpdateParametersDeliveryPolicyArgs>? = null, endpointName: Output<String>? = null, geoFilters: Output<List<GeoFilterArgs>>? = null, isCompressionEnabled: Output<Boolean>? = null, isHttpAllowed: Output<Boolean>? = null, isHttpsAllowed: Output<Boolean>? = null, location: Output<String>? = null, optimizationType: Output<Either<String, OptimizationType>>? = null, originGroups: Output<List<DeepCreatedOriginGroupArgs>>? = null, originHostHeader: Output<String>? = null, originPath: Output<String>? = null, origins: Output<List<DeepCreatedOriginArgs>>? = null, probePath: Output<String>? = null, profileName: Output<String>? = null, queryStringCachingBehavior: Output<QueryStringCachingBehavior>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, urlSigningKeys: Output<List<UrlSigningKeyArgs>>? = null, webApplicationFirewallPolicyLink: Output<EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLinkArgs>? = null)

Properties

Link copied to clipboard
val contentTypesToCompress: Output<List<String>>? = null

List of content types on which compression applies. The value should be a valid MIME type.

Link copied to clipboard

A reference to the origin group.

Link copied to clipboard

A policy that specifies the delivery rules to be used for an endpoint.

Link copied to clipboard
val endpointName: Output<String>? = null

Name of the endpoint under the profile which is unique globally.

Link copied to clipboard
val geoFilters: Output<List<GeoFilterArgs>>? = null

List of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path /pictures/

Link copied to clipboard
val isCompressionEnabled: Output<Boolean>? = null

Indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB.

Link copied to clipboard
val isHttpAllowed: Output<Boolean>? = null

Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed.

Link copied to clipboard
val isHttpsAllowed: Output<Boolean>? = null

Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed.

Link copied to clipboard
val location: Output<String>? = null

Resource location.

Link copied to clipboard
val optimizationType: Output<Either<String, OptimizationType>>? = null

Specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization.

Link copied to clipboard

The origin groups comprising of origins that are used for load balancing the traffic based on availability.

Link copied to clipboard
val originHostHeader: Output<String>? = null

The host header value sent to the origin with each request. This property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default.

Link copied to clipboard
val originPath: Output<String>? = null

A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.

Link copied to clipboard
val origins: Output<List<DeepCreatedOriginArgs>>? = null

The source of the content being delivered via CDN.

Link copied to clipboard
val probePath: Output<String>? = null

Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is only relevant when using a single origin.

Link copied to clipboard
val profileName: Output<String>? = null

Name of the CDN profile which is unique within the resource group.

Link copied to clipboard

Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

Name of the Resource group within the Azure subscription.

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

Resource tags.

Link copied to clipboard
val urlSigningKeys: Output<List<UrlSigningKeyArgs>>? = null

List of keys used to validate the signed URL hashes.

Link copied to clipboard

Defines the Web Application Firewall policy for the endpoint (if applicable)

Functions

Link copied to clipboard
open override fun toJava(): EndpointArgs