Route

class Route : KotlinCustomResource

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. 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/v2"
"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}

//*/

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard

The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object.

Link copied to clipboard

Domains referenced by this endpoint.

Link copied to clipboard
Link copied to clipboard
val enabledState: Output<String>?

Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'

Link copied to clipboard
val endpointName: Output<String>

The name of the endpoint which holds the route.

Link copied to clipboard

Protocol this rule will use when forwarding traffic to backends.

Link copied to clipboard
val httpsRedirect: Output<String>?

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.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

whether this route will be linked to the default endpoint domain.

Link copied to clipboard
val name: Output<String>

Resource name.

Link copied to clipboard

A reference to the origin group.

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

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

Link copied to clipboard
val patternsToMatch: Output<List<String>>?

The route patterns of the rule.

Link copied to clipboard

Provisioning status

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

rule sets referenced by this endpoint.

Link copied to clipboard

List of supported protocols for this route.

Link copied to clipboard

Read only system data

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>