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

com.pulumi.azure.appplatform.kotlin.SpringCloudBuilder.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.appplatform.kotlin

import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudBuilderBuildPackGroup
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudBuilderStack
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.azure.appplatform.kotlin.outputs.SpringCloudBuilderBuildPackGroup.Companion.toKotlin as springCloudBuilderBuildPackGroupToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudBuilderStack.Companion.toKotlin as springCloudBuilderStackToKotlin

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

    public var args: SpringCloudBuilderArgs = SpringCloudBuilderArgs()

    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 SpringCloudBuilderArgsBuilder.() -> Unit) {
        val builder = SpringCloudBuilderArgsBuilder()
        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(): SpringCloudBuilder {
        val builtJavaResource = com.pulumi.azure.appplatform.SpringCloudBuilder(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return SpringCloudBuilder(builtJavaResource)
    }
}

/**
 * Manages a Spring Cloud Builder.
 * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("example", {
 *     name: "example-springcloud",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     skuName: "E0",
 * });
 * const exampleSpringCloudBuilder = new azure.appplatform.SpringCloudBuilder("example", {
 *     name: "example",
 *     springCloudServiceId: exampleSpringCloudService.id,
 *     buildPackGroups: [{
 *         name: "mix",
 *         buildPackIds: ["tanzu-buildpacks/java-azure"],
 *     }],
 *     stack: {
 *         id: "io.buildpacks.stacks.bionic",
 *         version: "base",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_spring_cloud_service = azure.appplatform.SpringCloudService("example",
 *     name="example-springcloud",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     sku_name="E0")
 * example_spring_cloud_builder = azure.appplatform.SpringCloudBuilder("example",
 *     name="example",
 *     spring_cloud_service_id=example_spring_cloud_service.id,
 *     build_pack_groups=[{
 *         "name": "mix",
 *         "build_pack_ids": ["tanzu-buildpacks/java-azure"],
 *     }],
 *     stack={
 *         "id": "io.buildpacks.stacks.bionic",
 *         "version": "base",
 *     })
 * ```
 * ```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-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("example", new()
 *     {
 *         Name = "example-springcloud",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         SkuName = "E0",
 *     });
 *     var exampleSpringCloudBuilder = new Azure.AppPlatform.SpringCloudBuilder("example", new()
 *     {
 *         Name = "example",
 *         SpringCloudServiceId = exampleSpringCloudService.Id,
 *         BuildPackGroups = new[]
 *         {
 *             new Azure.AppPlatform.Inputs.SpringCloudBuilderBuildPackGroupArgs
 *             {
 *                 Name = "mix",
 *                 BuildPackIds = new[]
 *                 {
 *                     "tanzu-buildpacks/java-azure",
 *                 },
 *             },
 *         },
 *         Stack = new Azure.AppPlatform.Inputs.SpringCloudBuilderStackArgs
 *         {
 *             Id = "io.buildpacks.stacks.bionic",
 *             Version = "base",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform"
 * 	"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-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "example", &appplatform.SpringCloudServiceArgs{
 * 			Name:              pulumi.String("example-springcloud"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			SkuName:           pulumi.String("E0"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appplatform.NewSpringCloudBuilder(ctx, "example", &appplatform.SpringCloudBuilderArgs{
 * 			Name:                 pulumi.String("example"),
 * 			SpringCloudServiceId: exampleSpringCloudService.ID(),
 * 			BuildPackGroups: appplatform.SpringCloudBuilderBuildPackGroupArray{
 * 				&appplatform.SpringCloudBuilderBuildPackGroupArgs{
 * 					Name: pulumi.String("mix"),
 * 					BuildPackIds: pulumi.StringArray{
 * 						pulumi.String("tanzu-buildpacks/java-azure"),
 * 					},
 * 				},
 * 			},
 * 			Stack: &appplatform.SpringCloudBuilderStackArgs{
 * 				Id:      pulumi.String("io.buildpacks.stacks.bionic"),
 * 				Version: pulumi.String("base"),
 * 			},
 * 		})
 * 		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.appplatform.SpringCloudService;
 * import com.pulumi.azure.appplatform.SpringCloudServiceArgs;
 * import com.pulumi.azure.appplatform.SpringCloudBuilder;
 * import com.pulumi.azure.appplatform.SpringCloudBuilderArgs;
 * import com.pulumi.azure.appplatform.inputs.SpringCloudBuilderBuildPackGroupArgs;
 * import com.pulumi.azure.appplatform.inputs.SpringCloudBuilderStackArgs;
 * 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-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleSpringCloudService = new SpringCloudService("exampleSpringCloudService", SpringCloudServiceArgs.builder()
 *             .name("example-springcloud")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .skuName("E0")
 *             .build());
 *         var exampleSpringCloudBuilder = new SpringCloudBuilder("exampleSpringCloudBuilder", SpringCloudBuilderArgs.builder()
 *             .name("example")
 *             .springCloudServiceId(exampleSpringCloudService.id())
 *             .buildPackGroups(SpringCloudBuilderBuildPackGroupArgs.builder()
 *                 .name("mix")
 *                 .buildPackIds("tanzu-buildpacks/java-azure")
 *                 .build())
 *             .stack(SpringCloudBuilderStackArgs.builder()
 *                 .id("io.buildpacks.stacks.bionic")
 *                 .version("base")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleSpringCloudService:
 *     type: azure:appplatform:SpringCloudService
 *     name: example
 *     properties:
 *       name: example-springcloud
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       skuName: E0
 *   exampleSpringCloudBuilder:
 *     type: azure:appplatform:SpringCloudBuilder
 *     name: example
 *     properties:
 *       name: example
 *       springCloudServiceId: ${exampleSpringCloudService.id}
 *       buildPackGroups:
 *         - name: mix
 *           buildPackIds:
 *             - tanzu-buildpacks/java-azure
 *       stack:
 *         id: io.buildpacks.stacks.bionic
 *         version: base
 * ```
 * 
 * ## Import
 * Spring Cloud Builders can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appplatform/springCloudBuilder:SpringCloudBuilder example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroup1/providers/Microsoft.AppPlatform/spring/service1/buildServices/buildService1/builders/builder1
 * ```
 */
public class SpringCloudBuilder internal constructor(
    override val javaResource: com.pulumi.azure.appplatform.SpringCloudBuilder,
) : KotlinCustomResource(javaResource, SpringCloudBuilderMapper) {
    /**
     * One or more `build_pack_group` blocks as defined below.
     */
    public val buildPackGroups: Output>
        get() = javaResource.buildPackGroups().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> springCloudBuilderBuildPackGroupToKotlin(args0) })
            })
        })

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

    /**
     * The ID of the Spring Cloud Service. Changing this forces a new Spring Cloud Builder to be created.
     */
    public val springCloudServiceId: Output
        get() = javaResource.springCloudServiceId().applyValue({ args0 -> args0 })

    /**
     * A `stack` block as defined below.
     */
    public val stack: Output
        get() = javaResource.stack().applyValue({ args0 ->
            args0.let({ args0 ->
                springCloudBuilderStackToKotlin(args0)
            })
        })
}

public object SpringCloudBuilderMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.appplatform.SpringCloudBuilder::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy