All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.cdn.kotlin.FrontdoorRoute.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.cdn.kotlin

import com.pulumi.azure.cdn.kotlin.outputs.FrontdoorRouteCache
import com.pulumi.azure.cdn.kotlin.outputs.FrontdoorRouteCache.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [FrontdoorRoute].
 */
@PulumiTagMarker
public class FrontdoorRouteResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: FrontdoorRouteArgs = FrontdoorRouteArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend FrontdoorRouteArgsBuilder.() -> Unit) {
        val builder = FrontdoorRouteArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.opts(block)
    }

    internal fun build(): FrontdoorRoute {
        val builtJavaResource = com.pulumi.azure.cdn.FrontdoorRoute(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return FrontdoorRoute(builtJavaResource)
    }
}

/**
 * Manages a Front Door (standard/premium) Route.
 * ## Import
 * Front Door Routes can be imported using the `resource id`, e.g.
 * ```sh
 *  $ pulumi import azure:cdn/frontdoorRoute:FrontdoorRoute example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Cdn/profiles/profile1/afdEndpoints/endpoint1/routes/route1
 * ```
 *
 */
public class FrontdoorRoute internal constructor(
    override val javaResource: com.pulumi.azure.cdn.FrontdoorRoute,
) : KotlinCustomResource(javaResource, FrontdoorRouteMapper) {
    /**
     * A `cache` block as defined below.
     * > **NOTE:** To disable caching, do not provide the `cache` block in the configuration file.
     */
    public val cache: Output?
        get() = javaResource.cache().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The IDs of the Front Door Custom Domains which are associated with this Front Door Route.
     */
    public val cdnFrontdoorCustomDomainIds: Output>?
        get() = javaResource.cdnFrontdoorCustomDomainIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The resource ID of the Front Door Endpoint where this Front Door Route should exist. Changing this forces a new Front Door Route to be created.
     */
    public val cdnFrontdoorEndpointId: Output
        get() = javaResource.cdnFrontdoorEndpointId().applyValue({ args0 -> args0 })

    /**
     * The resource ID of the Front Door Origin Group where this Front Door Route should be created.
     */
    public val cdnFrontdoorOriginGroupId: Output
        get() = javaResource.cdnFrontdoorOriginGroupId().applyValue({ args0 -> args0 })

    /**
     * One or more Front Door Origin resource IDs that this Front Door Route will link to.
     */
    public val cdnFrontdoorOriginIds: Output>
        get() = javaResource.cdnFrontdoorOriginIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * A directory path on the Front Door Origin that can be used to retrieve content (e.g. `contoso.cloudapp.net/originpath`).
     */
    public val cdnFrontdoorOriginPath: Output?
        get() = javaResource.cdnFrontdoorOriginPath().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A list of the Front Door Rule Set IDs which should be assigned to this Front Door Route.
     */
    public val cdnFrontdoorRuleSetIds: Output>?
        get() = javaResource.cdnFrontdoorRuleSetIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Is this Front Door Route enabled? Possible values are `true` or `false`. Defaults to `true`.
     */
    public val enabled: Output?
        get() = javaResource.enabled().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The Protocol that will be use when forwarding traffic to backends. Possible values are `HttpOnly`, `HttpsOnly` or `MatchRequest`.
     */
    public val forwardingProtocol: Output?
        get() = javaResource.forwardingProtocol().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Automatically redirect HTTP traffic to HTTPS traffic? Possible values are `true` or `false`. Defaults to `true`.
     * > **NOTE:** The `https_redirect_enabled` rule is the first rule that will be executed.
     */
    public val httpsRedirectEnabled: Output?
        get() = javaResource.httpsRedirectEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Should this Front Door Route be linked to the default endpoint? Possible values include `true` or `false`. Defaults to `true`.
     */
    public val linkToDefaultDomain: Output?
        get() = javaResource.linkToDefaultDomain().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name which should be used for this Front Door Route. Valid values must begin with a letter or number, end with a letter or number and may only contain letters, numbers and hyphens with a maximum length of 90 characters. Changing this forces a new Front Door Route to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The route patterns of the rule.
     */
    public val patternsToMatches: Output>
        get() = javaResource.patternsToMatches().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * One or more Protocols supported by this Front Door Route. Possible values are `Http` or `Https`.
     * > **NOTE:** If `https_redirect_enabled` is set to `true` the `supported_protocols` field must contain both `Http` and `Https` values.
     */
    public val supportedProtocols: Output>
        get() = javaResource.supportedProtocols().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}

public object FrontdoorRouteMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.cdn.FrontdoorRoute::class == javaResource::class

    override fun map(javaResource: Resource): FrontdoorRoute = FrontdoorRoute(
        javaResource as
            com.pulumi.azure.cdn.FrontdoorRoute,
    )
}

/**
 * @see [FrontdoorRoute].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [FrontdoorRoute].
 */
public suspend fun frontdoorRoute(
    name: String,
    block: suspend FrontdoorRouteResourceBuilder.() -> Unit,
): FrontdoorRoute {
    val builder = FrontdoorRouteResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [FrontdoorRoute].
 * @param name The _unique_ name of the resulting resource.
 */
public fun frontdoorRoute(name: String): FrontdoorRoute {
    val builder = FrontdoorRouteResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy