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

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

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.appplatform.kotlin

import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudBuildPackBindingLaunch
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudBuildPackBindingLaunch.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

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

    public var args: SpringCloudBuildPackBindingArgs = SpringCloudBuildPackBindingArgs()

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

/**
 * Manages a Spring Cloud Build Pack Binding.
 * > **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-Build Packs/java-azure"],
 *     }],
 *     stack: {
 *         id: "io.Build Packs.stacks.bionic",
 *         version: "base",
 *     },
 * });
 * const exampleSpringCloudBuildPackBinding = new azure.appplatform.SpringCloudBuildPackBinding("example", {
 *     name: "example",
 *     springCloudBuilderId: exampleSpringCloudBuilder.id,
 *     bindingType: "ApplicationInsights",
 *     launch: {
 *         properties: {
 *             abc: "def",
 *             "any-string": "any-string",
 *             "sampling-rate": "12.0",
 *         },
 *         secrets: {
 *             "connection-string": "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX",
 *         },
 *     },
 * });
 * ```
 * ```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=[azure.appplatform.SpringCloudBuilderBuildPackGroupArgs(
 *         name="mix",
 *         build_pack_ids=["tanzu-Build Packs/java-azure"],
 *     )],
 *     stack=azure.appplatform.SpringCloudBuilderStackArgs(
 *         id="io.Build Packs.stacks.bionic",
 *         version="base",
 *     ))
 * example_spring_cloud_build_pack_binding = azure.appplatform.SpringCloudBuildPackBinding("example",
 *     name="example",
 *     spring_cloud_builder_id=example_spring_cloud_builder.id,
 *     binding_type="ApplicationInsights",
 *     launch=azure.appplatform.SpringCloudBuildPackBindingLaunchArgs(
 *         properties={
 *             "abc": "def",
 *             "any-string": "any-string",
 *             "sampling-rate": "12.0",
 *         },
 *         secrets={
 *             "connection-string": "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX",
 *         },
 *     ))
 * ```
 * ```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-Build Packs/java-azure",
 *                 },
 *             },
 *         },
 *         Stack = new Azure.AppPlatform.Inputs.SpringCloudBuilderStackArgs
 *         {
 *             Id = "io.Build Packs.stacks.bionic",
 *             Version = "base",
 *         },
 *     });
 *     var exampleSpringCloudBuildPackBinding = new Azure.AppPlatform.SpringCloudBuildPackBinding("example", new()
 *     {
 *         Name = "example",
 *         SpringCloudBuilderId = exampleSpringCloudBuilder.Id,
 *         BindingType = "ApplicationInsights",
 *         Launch = new Azure.AppPlatform.Inputs.SpringCloudBuildPackBindingLaunchArgs
 *         {
 *             Properties =
 *             {
 *                 { "abc", "def" },
 *                 { "any-string", "any-string" },
 *                 { "sampling-rate", "12.0" },
 *             },
 *             Secrets =
 *             {
 *                 { "connection-string", "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX" },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		exampleSpringCloudBuilder, 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-Build Packs/java-azure"),
 * 					},
 * 				},
 * 			},
 * 			Stack: &appplatform.SpringCloudBuilderStackArgs{
 * 				Id:      pulumi.String("io.Build Packs.stacks.bionic"),
 * 				Version: pulumi.String("base"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appplatform.NewSpringCloudBuildPackBinding(ctx, "example", &appplatform.SpringCloudBuildPackBindingArgs{
 * 			Name:                 pulumi.String("example"),
 * 			SpringCloudBuilderId: exampleSpringCloudBuilder.ID(),
 * 			BindingType:          pulumi.String("ApplicationInsights"),
 * 			Launch: &appplatform.SpringCloudBuildPackBindingLaunchArgs{
 * 				Properties: pulumi.StringMap{
 * 					"abc":           pulumi.String("def"),
 * 					"any-string":    pulumi.String("any-string"),
 * 					"sampling-rate": pulumi.String("12.0"),
 * 				},
 * 				Secrets: pulumi.StringMap{
 * 					"connection-string": pulumi.String("XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX"),
 * 				},
 * 			},
 * 		})
 * 		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 com.pulumi.azure.appplatform.SpringCloudBuildPackBinding;
 * import com.pulumi.azure.appplatform.SpringCloudBuildPackBindingArgs;
 * import com.pulumi.azure.appplatform.inputs.SpringCloudBuildPackBindingLaunchArgs;
 * 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-Build Packs/java-azure")
 *                 .build())
 *             .stack(SpringCloudBuilderStackArgs.builder()
 *                 .id("io.Build Packs.stacks.bionic")
 *                 .version("base")
 *                 .build())
 *             .build());
 *         var exampleSpringCloudBuildPackBinding = new SpringCloudBuildPackBinding("exampleSpringCloudBuildPackBinding", SpringCloudBuildPackBindingArgs.builder()
 *             .name("example")
 *             .springCloudBuilderId(exampleSpringCloudBuilder.id())
 *             .bindingType("ApplicationInsights")
 *             .launch(SpringCloudBuildPackBindingLaunchArgs.builder()
 *                 .properties(Map.ofEntries(
 *                     Map.entry("abc", "def"),
 *                     Map.entry("any-string", "any-string"),
 *                     Map.entry("sampling-rate", "12.0")
 *                 ))
 *                 .secrets(Map.of("connection-string", "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX"))
 *                 .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-Build Packs/java-azure
 *       stack:
 *         id: io.Build Packs.stacks.bionic
 *         version: base
 *   exampleSpringCloudBuildPackBinding:
 *     type: azure:appplatform:SpringCloudBuildPackBinding
 *     name: example
 *     properties:
 *       name: example
 *       springCloudBuilderId: ${exampleSpringCloudBuilder.id}
 *       bindingType: ApplicationInsights
 *       launch:
 *         properties:
 *           abc: def
 *           any-string: any-string
 *           sampling-rate: '12.0'
 *         secrets:
 *           connection-string: XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX
 * ```
 * 
 * ## Import
 * Spring Cloud Build Pack Bindings can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appplatform/springCloudBuildPackBinding:SpringCloudBuildPackBinding example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.AppPlatform/spring/service1/buildServices/buildService1/builders/builder1/buildPackBindings/binding1
 * ```
 */
public class SpringCloudBuildPackBinding internal constructor(
    override val javaResource: com.pulumi.azure.appplatform.SpringCloudBuildPackBinding,
) : KotlinCustomResource(javaResource, SpringCloudBuildPackBindingMapper) {
    /**
     * Specifies the Build Pack Binding Type. Allowed values are `ApacheSkyWalking`, `AppDynamics`, `ApplicationInsights`, `Dynatrace`, `ElasticAPM` and `NewRelic`.
     */
    public val bindingType: Output?
        get() = javaResource.bindingType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A `launch` block as defined below.
     */
    public val launch: Output?
        get() = javaResource.launch().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            }).orElse(null)
        })

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

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

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy