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

com.pulumi.azurenative.cdn.kotlin.AFDTargetGroup.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.cdn.kotlin

import com.pulumi.azurenative.cdn.kotlin.outputs.SystemDataResponse
import com.pulumi.azurenative.cdn.kotlin.outputs.TargetEndpointResponse
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
import com.pulumi.azurenative.cdn.kotlin.outputs.SystemDataResponse.Companion.toKotlin as systemDataResponseToKotlin
import com.pulumi.azurenative.cdn.kotlin.outputs.TargetEndpointResponse.Companion.toKotlin as targetEndpointResponseToKotlin

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

    public var args: AFDTargetGroupArgs = AFDTargetGroupArgs()

    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 AFDTargetGroupArgsBuilder.() -> Unit) {
        val builder = AFDTargetGroupArgsBuilder()
        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(): AFDTargetGroup {
        val builtJavaResource = com.pulumi.azurenative.cdn.AFDTargetGroup(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return AFDTargetGroup(builtJavaResource)
    }
}

/**
 * AFDTargetGroup comprises a list of Endpoints that is used for tunnelling protocols to allow certain traffic.
 * Azure REST API version: 2024-06-01-preview.
 * ## Example Usage
 * ### AfdTargetGroups_Create
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var afdTargetGroup = new AzureNative.Cdn.AFDTargetGroup("afdTargetGroup", new()
 *     {
 *         ProfileName = "profile1",
 *         ResourceGroupName = "RG",
 *         TargetEndpoints = new[]
 *         {
 *             new AzureNative.Cdn.Inputs.TargetEndpointArgs
 *             {
 *                 Ports = new[]
 *                 {
 *                     443,
 *                     80,
 *                 },
 *                 TargetFqdn = "host1.foo.com",
 *             },
 *             new AzureNative.Cdn.Inputs.TargetEndpointArgs
 *             {
 *                 Ports = new[]
 *                 {
 *                     443,
 *                     80,
 *                 },
 *                 TargetFqdn = "host2.contoso.com",
 *             },
 *         },
 *         TargetGroupName = "targetgroup1",
 *     });
 * });
 * ```
 * ```go
 * 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.NewAFDTargetGroup(ctx, "afdTargetGroup", &cdn.AFDTargetGroupArgs{
 * 			ProfileName:       pulumi.String("profile1"),
 * 			ResourceGroupName: pulumi.String("RG"),
 * 			TargetEndpoints: cdn.TargetEndpointArray{
 * 				&cdn.TargetEndpointArgs{
 * 					Ports: pulumi.IntArray{
 * 						pulumi.Int(443),
 * 						pulumi.Int(80),
 * 					},
 * 					TargetFqdn: pulumi.String("host1.foo.com"),
 * 				},
 * 				&cdn.TargetEndpointArgs{
 * 					Ports: pulumi.IntArray{
 * 						pulumi.Int(443),
 * 						pulumi.Int(80),
 * 					},
 * 					TargetFqdn: pulumi.String("host2.contoso.com"),
 * 				},
 * 			},
 * 			TargetGroupName: pulumi.String("targetgroup1"),
 * 		})
 * 		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.azurenative.cdn.AFDTargetGroup;
 * import com.pulumi.azurenative.cdn.AFDTargetGroupArgs;
 * import com.pulumi.azurenative.cdn.inputs.TargetEndpointArgs;
 * 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 afdTargetGroup = new AFDTargetGroup("afdTargetGroup", AFDTargetGroupArgs.builder()
 *             .profileName("profile1")
 *             .resourceGroupName("RG")
 *             .targetEndpoints(
 *                 TargetEndpointArgs.builder()
 *                     .ports(
 *                         443,
 *                         80)
 *                     .targetFqdn("host1.foo.com")
 *                     .build(),
 *                 TargetEndpointArgs.builder()
 *                     .ports(
 *                         443,
 *                         80)
 *                     .targetFqdn("host2.contoso.com")
 *                     .build())
 *             .targetGroupName("targetgroup1")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:cdn:AFDTargetGroup targetgroup1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/targetGroups/{targetGroupName}
 * ```
 */
public class AFDTargetGroup internal constructor(
    override val javaResource: com.pulumi.azurenative.cdn.AFDTargetGroup,
) : KotlinCustomResource(javaResource, AFDTargetGroupMapper) {
    public val deploymentStatus: Output
        get() = javaResource.deploymentStatus().applyValue({ args0 -> args0 })

    /**
     * Resource name.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Provisioning status
     */
    public val provisioningState: Output
        get() = javaResource.provisioningState().applyValue({ args0 -> args0 })

    /**
     * Read only system data
     */
    public val systemData: Output
        get() = javaResource.systemData().applyValue({ args0 ->
            args0.let({ args0 ->
                systemDataResponseToKotlin(args0)
            })
        })

    /**
     * TargetEndpoint list referenced by this target group.
     */
    public val targetEndpoints: Output>
        get() = javaResource.targetEndpoints().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> targetEndpointResponseToKotlin(args0) })
            })
        })

    /**
     * Resource type.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

public object AFDTargetGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azurenative.cdn.AFDTargetGroup::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy