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

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

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

package com.pulumi.azure.cdn.kotlin

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.Map

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

    public var args: FrontdoorEndpointArgs = FrontdoorEndpointArgs()

    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 FrontdoorEndpointArgsBuilder.() -> Unit) {
        val builder = FrontdoorEndpointArgsBuilder()
        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.CustomResourceOptions.opts(block)
    }

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

/**
 * Manages a Front Door (standard/premium) Endpoint.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-cdn-frontdoor",
 *     location: "West Europe",
 * });
 * const exampleFrontdoorProfile = new azure.cdn.FrontdoorProfile("example", {
 *     name: "example-profile",
 *     resourceGroupName: example.name,
 *     skuName: "Standard_AzureFrontDoor",
 * });
 * const exampleFrontdoorEndpoint = new azure.cdn.FrontdoorEndpoint("example", {
 *     name: "example-endpoint",
 *     cdnFrontdoorProfileId: exampleFrontdoorProfile.id,
 *     tags: {
 *         ENV: "example",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-cdn-frontdoor",
 *     location="West Europe")
 * example_frontdoor_profile = azure.cdn.FrontdoorProfile("example",
 *     name="example-profile",
 *     resource_group_name=example.name,
 *     sku_name="Standard_AzureFrontDoor")
 * example_frontdoor_endpoint = azure.cdn.FrontdoorEndpoint("example",
 *     name="example-endpoint",
 *     cdn_frontdoor_profile_id=example_frontdoor_profile.id,
 *     tags={
 *         "ENV": "example",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-cdn-frontdoor",
 *         Location = "West Europe",
 *     });
 *     var exampleFrontdoorProfile = new Azure.Cdn.FrontdoorProfile("example", new()
 *     {
 *         Name = "example-profile",
 *         ResourceGroupName = example.Name,
 *         SkuName = "Standard_AzureFrontDoor",
 *     });
 *     var exampleFrontdoorEndpoint = new Azure.Cdn.FrontdoorEndpoint("example", new()
 *     {
 *         Name = "example-endpoint",
 *         CdnFrontdoorProfileId = exampleFrontdoorProfile.Id,
 *         Tags =
 *         {
 *             { "ENV", "example" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-cdn-frontdoor"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleFrontdoorProfile, err := cdn.NewFrontdoorProfile(ctx, "example", &cdn.FrontdoorProfileArgs{
 * 			Name:              pulumi.String("example-profile"),
 * 			ResourceGroupName: example.Name,
 * 			SkuName:           pulumi.String("Standard_AzureFrontDoor"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = cdn.NewFrontdoorEndpoint(ctx, "example", &cdn.FrontdoorEndpointArgs{
 * 			Name:                  pulumi.String("example-endpoint"),
 * 			CdnFrontdoorProfileId: exampleFrontdoorProfile.ID(),
 * 			Tags: pulumi.StringMap{
 * 				"ENV": pulumi.String("example"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.cdn.FrontdoorProfile;
 * import com.pulumi.azure.cdn.FrontdoorProfileArgs;
 * import com.pulumi.azure.cdn.FrontdoorEndpoint;
 * import com.pulumi.azure.cdn.FrontdoorEndpointArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-cdn-frontdoor")
 *             .location("West Europe")
 *             .build());
 *         var exampleFrontdoorProfile = new FrontdoorProfile("exampleFrontdoorProfile", FrontdoorProfileArgs.builder()
 *             .name("example-profile")
 *             .resourceGroupName(example.name())
 *             .skuName("Standard_AzureFrontDoor")
 *             .build());
 *         var exampleFrontdoorEndpoint = new FrontdoorEndpoint("exampleFrontdoorEndpoint", FrontdoorEndpointArgs.builder()
 *             .name("example-endpoint")
 *             .cdnFrontdoorProfileId(exampleFrontdoorProfile.id())
 *             .tags(Map.of("ENV", "example"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-cdn-frontdoor
 *       location: West Europe
 *   exampleFrontdoorProfile:
 *     type: azure:cdn:FrontdoorProfile
 *     name: example
 *     properties:
 *       name: example-profile
 *       resourceGroupName: ${example.name}
 *       skuName: Standard_AzureFrontDoor
 *   exampleFrontdoorEndpoint:
 *     type: azure:cdn:FrontdoorEndpoint
 *     name: example
 *     properties:
 *       name: example-endpoint
 *       cdnFrontdoorProfileId: ${exampleFrontdoorProfile.id}
 *       tags:
 *         ENV: example
 * ```
 * 
 * ## Import
 * Front Door Endpoints can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:cdn/frontdoorEndpoint:FrontdoorEndpoint example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Cdn/profiles/profile1/afdEndpoints/endpoint1
 * ```
 */
public class FrontdoorEndpoint internal constructor(
    override val javaResource: com.pulumi.azure.cdn.FrontdoorEndpoint,
) : KotlinCustomResource(javaResource, FrontdoorEndpointMapper) {
    /**
     * The ID of the Front Door Profile within which this Front Door Endpoint should exist. Changing this forces a new Front Door Endpoint to be created.
     */
    public val cdnFrontdoorProfileId: Output
        get() = javaResource.cdnFrontdoorProfileId().applyValue({ args0 -> args0 })

    /**
     * Specifies if this Front Door Endpoint is enabled? Defaults to `true`.
     */
    public val enabled: Output?
        get() = javaResource.enabled().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The host name of the Front Door Endpoint, in the format `{endpointName}.{dnsZone}` (for example, `contoso.azureedge.net`).
     */
    public val hostName: Output
        get() = javaResource.hostName().applyValue({ args0 -> args0 })

    /**
     * The name which should be used for this Front Door Endpoint. Changing this forces a new Front Door Endpoint to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Specifies a mapping of tags which should be assigned to the Front Door Endpoint.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })
}

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy