Route Args
Friendly Routes name mapping to the any Routes or secret related information. 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, 2025-04-15. 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
Routes_Create
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var route = new AzureNative.Cdn.Route("route", new()
{
CacheConfiguration = new AzureNative.Cdn.Inputs.AfdRouteCacheConfigurationArgs
{
CompressionSettings = new AzureNative.Cdn.Inputs.CompressionSettingsArgs
{
ContentTypesToCompress = new[]
{
"text/html",
"application/octet-stream",
},
IsCompressionEnabled = true,
},
QueryParameters = "querystring=test",
QueryStringCachingBehavior = AzureNative.Cdn.AfdQueryStringCachingBehavior.IgnoreSpecifiedQueryStrings,
},
CustomDomains = new[]
{
new AzureNative.Cdn.Inputs.ActivatedResourceReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1",
},
},
EnabledState = AzureNative.Cdn.EnabledState.Enabled,
EndpointName = "endpoint1",
ForwardingProtocol = AzureNative.Cdn.ForwardingProtocol.MatchRequest,
HttpsRedirect = AzureNative.Cdn.HttpsRedirect.Enabled,
LinkToDefaultDomain = AzureNative.Cdn.LinkToDefaultDomain.Enabled,
OriginGroup = new AzureNative.Cdn.Inputs.ResourceReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1",
},
PatternsToMatch = new[]
{
"/*",
},
ProfileName = "profile1",
ResourceGroupName = "RG",
RouteName = "route1",
RuleSets = new[]
{
new AzureNative.Cdn.Inputs.ResourceReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1",
},
},
SupportedProtocols = new[]
{
AzureNative.Cdn.AFDEndpointProtocols.Https,
AzureNative.Cdn.AFDEndpointProtocols.Http,
},
});
});
package main
import (
cdn "github.com/pulumi/pulumi-azure-native-sdk/cdn/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cdn.NewRoute(ctx, "route", &cdn.RouteArgs{
CacheConfiguration: &cdn.AfdRouteCacheConfigurationArgs{
CompressionSettings: &cdn.CompressionSettingsArgs{
ContentTypesToCompress: pulumi.StringArray{
pulumi.String("text/html"),
pulumi.String("application/octet-stream"),
},
IsCompressionEnabled: pulumi.Bool(true),
},
QueryParameters: pulumi.String("querystring=test"),
QueryStringCachingBehavior: pulumi.String(cdn.AfdQueryStringCachingBehaviorIgnoreSpecifiedQueryStrings),
},
CustomDomains: cdn.ActivatedResourceReferenceArray{
&cdn.ActivatedResourceReferenceArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"),
},
},
EnabledState: pulumi.String(cdn.EnabledStateEnabled),
EndpointName: pulumi.String("endpoint1"),
ForwardingProtocol: pulumi.String(cdn.ForwardingProtocolMatchRequest),
HttpsRedirect: pulumi.String(cdn.HttpsRedirectEnabled),
LinkToDefaultDomain: pulumi.String(cdn.LinkToDefaultDomainEnabled),
OriginGroup: &cdn.ResourceReferenceArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1"),
},
PatternsToMatch: pulumi.StringArray{
pulumi.String("/*"),
},
ProfileName: pulumi.String("profile1"),
ResourceGroupName: pulumi.String("RG"),
RouteName: pulumi.String("route1"),
RuleSets: cdn.ResourceReferenceArray{
&cdn.ResourceReferenceArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"),
},
},
SupportedProtocols: pulumi.StringArray{
pulumi.String(cdn.AFDEndpointProtocolsHttps),
pulumi.String(cdn.AFDEndpointProtocolsHttp),
},
})
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.Route;
import com.pulumi.azurenative.cdn.RouteArgs;
import com.pulumi.azurenative.cdn.inputs.AfdRouteCacheConfigurationArgs;
import com.pulumi.azurenative.cdn.inputs.CompressionSettingsArgs;
import com.pulumi.azurenative.cdn.inputs.ActivatedResourceReferenceArgs;
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 route = new Route("route", RouteArgs.builder()
.cacheConfiguration(AfdRouteCacheConfigurationArgs.builder()
.compressionSettings(CompressionSettingsArgs.builder()
.contentTypesToCompress(
"text/html",
"application/octet-stream")
.isCompressionEnabled(true)
.build())
.queryParameters("querystring=test")
.queryStringCachingBehavior("IgnoreSpecifiedQueryStrings")
.build())
.customDomains(ActivatedResourceReferenceArgs.builder()
.id("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1")
.build())
.enabledState("Enabled")
.endpointName("endpoint1")
.forwardingProtocol("MatchRequest")
.httpsRedirect("Enabled")
.linkToDefaultDomain("Enabled")
.originGroup(ResourceReferenceArgs.builder()
.id("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1")
.build())
.patternsToMatch("/*")
.profileName("profile1")
.resourceGroupName("RG")
.routeName("route1")
.ruleSets(ResourceReferenceArgs.builder()
.id("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1")
.build())
.supportedProtocols(
"Https",
"Http")
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:cdn:Route route1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}
Constructors
Properties
The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object.
Domains referenced by this endpoint.
Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
Name of the endpoint under the profile which is unique globally.
Protocol this rule will use when forwarding traffic to backends.
Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed.
whether this route will be linked to the default endpoint domain.
A reference to the origin group.
A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
The route patterns of the rule.
Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
Name of the Resource group within the Azure subscription.
rule sets referenced by this endpoint.
List of supported protocols for this route. //*/