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

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

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

package com.pulumi.azure.appplatform.kotlin

import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceConfigServerGitSetting
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceContainerRegistry
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceDefaultBuildService
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceMarketplace
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceNetwork
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceRequiredNetworkTrafficRule
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceTrace
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 kotlin.collections.Map
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceConfigServerGitSetting.Companion.toKotlin as springCloudServiceConfigServerGitSettingToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceContainerRegistry.Companion.toKotlin as springCloudServiceContainerRegistryToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceDefaultBuildService.Companion.toKotlin as springCloudServiceDefaultBuildServiceToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceMarketplace.Companion.toKotlin as springCloudServiceMarketplaceToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceNetwork.Companion.toKotlin as springCloudServiceNetworkToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceRequiredNetworkTrafficRule.Companion.toKotlin as springCloudServiceRequiredNetworkTrafficRuleToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudServiceTrace.Companion.toKotlin as springCloudServiceTraceToKotlin

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

    public var args: SpringCloudServiceArgs = SpringCloudServiceArgs()

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

/**
 * Manages an Azure Spring Cloud Service.
 * ## 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 exampleInsights = new azure.appinsights.Insights("example", {
 *     name: "tf-test-appinsights",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationType: "web",
 * });
 * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("example", {
 *     name: "example-springcloud",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     skuName: "S0",
 *     configServerGitSetting: {
 *         uri: "https://github.com/Azure-Samples/piggymetrics",
 *         label: "config",
 *         searchPaths: [
 *             "dir1",
 *             "dir2",
 *         ],
 *     },
 *     trace: {
 *         connectionString: exampleInsights.connectionString,
 *         sampleRate: 10,
 *     },
 *     tags: {
 *         Env: "staging",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_insights = azure.appinsights.Insights("example",
 *     name="tf-test-appinsights",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     application_type="web")
 * example_spring_cloud_service = azure.appplatform.SpringCloudService("example",
 *     name="example-springcloud",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     sku_name="S0",
 *     config_server_git_setting={
 *         "uri": "https://github.com/Azure-Samples/piggymetrics",
 *         "label": "config",
 *         "search_paths": [
 *             "dir1",
 *             "dir2",
 *         ],
 *     },
 *     trace={
 *         "connection_string": example_insights.connection_string,
 *         "sample_rate": 10,
 *     },
 *     tags={
 *         "Env": "staging",
 *     })
 * ```
 * ```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 exampleInsights = new Azure.AppInsights.Insights("example", new()
 *     {
 *         Name = "tf-test-appinsights",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         ApplicationType = "web",
 *     });
 *     var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("example", new()
 *     {
 *         Name = "example-springcloud",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         SkuName = "S0",
 *         ConfigServerGitSetting = new Azure.AppPlatform.Inputs.SpringCloudServiceConfigServerGitSettingArgs
 *         {
 *             Uri = "https://github.com/Azure-Samples/piggymetrics",
 *             Label = "config",
 *             SearchPaths = new[]
 *             {
 *                 "dir1",
 *                 "dir2",
 *             },
 *         },
 *         Trace = new Azure.AppPlatform.Inputs.SpringCloudServiceTraceArgs
 *         {
 *             ConnectionString = exampleInsights.ConnectionString,
 *             SampleRate = 10,
 *         },
 *         Tags =
 *         {
 *             { "Env", "staging" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights"
 * 	"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
 * 		}
 * 		exampleInsights, err := appinsights.NewInsights(ctx, "example", &appinsights.InsightsArgs{
 * 			Name:              pulumi.String("tf-test-appinsights"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			ApplicationType:   pulumi.String("web"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appplatform.NewSpringCloudService(ctx, "example", &appplatform.SpringCloudServiceArgs{
 * 			Name:              pulumi.String("example-springcloud"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			SkuName:           pulumi.String("S0"),
 * 			ConfigServerGitSetting: &appplatform.SpringCloudServiceConfigServerGitSettingArgs{
 * 				Uri:   pulumi.String("https://github.com/Azure-Samples/piggymetrics"),
 * 				Label: pulumi.String("config"),
 * 				SearchPaths: pulumi.StringArray{
 * 					pulumi.String("dir1"),
 * 					pulumi.String("dir2"),
 * 				},
 * 			},
 * 			Trace: &appplatform.SpringCloudServiceTraceArgs{
 * 				ConnectionString: exampleInsights.ConnectionString,
 * 				SampleRate:       pulumi.Float64(10),
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"Env": pulumi.String("staging"),
 * 			},
 * 		})
 * 		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.appinsights.Insights;
 * import com.pulumi.azure.appinsights.InsightsArgs;
 * import com.pulumi.azure.appplatform.SpringCloudService;
 * import com.pulumi.azure.appplatform.SpringCloudServiceArgs;
 * import com.pulumi.azure.appplatform.inputs.SpringCloudServiceConfigServerGitSettingArgs;
 * import com.pulumi.azure.appplatform.inputs.SpringCloudServiceTraceArgs;
 * 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 exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
 *             .name("tf-test-appinsights")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .applicationType("web")
 *             .build());
 *         var exampleSpringCloudService = new SpringCloudService("exampleSpringCloudService", SpringCloudServiceArgs.builder()
 *             .name("example-springcloud")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .skuName("S0")
 *             .configServerGitSetting(SpringCloudServiceConfigServerGitSettingArgs.builder()
 *                 .uri("https://github.com/Azure-Samples/piggymetrics")
 *                 .label("config")
 *                 .searchPaths(
 *                     "dir1",
 *                     "dir2")
 *                 .build())
 *             .trace(SpringCloudServiceTraceArgs.builder()
 *                 .connectionString(exampleInsights.connectionString())
 *                 .sampleRate(10)
 *                 .build())
 *             .tags(Map.of("Env", "staging"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleInsights:
 *     type: azure:appinsights:Insights
 *     name: example
 *     properties:
 *       name: tf-test-appinsights
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       applicationType: web
 *   exampleSpringCloudService:
 *     type: azure:appplatform:SpringCloudService
 *     name: example
 *     properties:
 *       name: example-springcloud
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       skuName: S0
 *       configServerGitSetting:
 *         uri: https://github.com/Azure-Samples/piggymetrics
 *         label: config
 *         searchPaths:
 *           - dir1
 *           - dir2
 *       trace:
 *         connectionString: ${exampleInsights.connectionString}
 *         sampleRate: 10
 *       tags:
 *         Env: staging
 * ```
 * 
 * ## Import
 * Spring Cloud services can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appplatform/springCloudService:SpringCloudService example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AppPlatform/spring/spring1
 * ```
 */
public class SpringCloudService internal constructor(
    override val javaResource: com.pulumi.azure.appplatform.SpringCloudService,
) : KotlinCustomResource(javaResource, SpringCloudServiceMapper) {
    /**
     * Specifies the size for this Spring Cloud Service's default build agent pool. Possible values are `S1`, `S2`, `S3`, `S4` and `S5`. This field is applicable only for Spring Cloud Service with enterprise tier.
     */
    public val buildAgentPoolSize: Output?
        get() = javaResource.buildAgentPoolSize().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A `config_server_git_setting` block as defined below. This field is applicable only for Spring Cloud Service with basic and standard tier.
     */
    public val configServerGitSetting: Output?
        get() = javaResource.configServerGitSetting().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    springCloudServiceConfigServerGitSettingToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * One or more `container_registry` block as defined below. This field is applicable only for Spring Cloud Service with enterprise tier.
     */
    public val containerRegistries: Output>?
        get() = javaResource.containerRegistries().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        springCloudServiceContainerRegistryToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * A `default_build_service` block as defined below. This field is applicable only for Spring Cloud Service with enterprise tier.
     */
    public val defaultBuildService: Output?
        get() = javaResource.defaultBuildService().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> springCloudServiceDefaultBuildServiceToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Should the log stream in vnet injection instance could be accessed from Internet?
     */
    public val logStreamPublicEndpointEnabled: Output?
        get() = javaResource.logStreamPublicEndpointEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The resource Id of the Managed Environment that the Spring Apps instance builds on. Can only be specified when `sku_tier` is set to `StandardGen2`.
     */
    public val managedEnvironmentId: Output?
        get() = javaResource.managedEnvironmentId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A `marketplace` block as defined below. Can only be specified when `sku` is set to `E0`.
     */
    public val marketplace: Output
        get() = javaResource.marketplace().applyValue({ args0 ->
            args0.let({ args0 ->
                springCloudServiceMarketplaceToKotlin(args0)
            })
        })

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

    /**
     * A `network` block as defined below. Changing this forces a new resource to be created.
     */
    public val network: Output?
        get() = javaResource.network().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    springCloudServiceNetworkToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * A list of the outbound Public IP Addresses used by this Spring Cloud Service.
     */
    public val outboundPublicIpAddresses: Output>
        get() = javaResource.outboundPublicIpAddresses().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            })
        })

    /**
     * A list of `required_network_traffic_rules` blocks as defined below.
     */
    public val requiredNetworkTrafficRules: Output>
        get() = javaResource.requiredNetworkTrafficRules().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> springCloudServiceRequiredNetworkTrafficRuleToKotlin(args0) })
            })
        })

    /**
     * Specifies The name of the resource group in which to create the Spring Cloud Service. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * Whether enable the default Service Registry. This field is applicable only for Spring Cloud Service with enterprise tier.
     */
    public val serviceRegistryEnabled: Output?
        get() = javaResource.serviceRegistryEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the Spring Cloud Service Registry.
     */
    public val serviceRegistryId: Output
        get() = javaResource.serviceRegistryId().applyValue({ args0 -> args0 })

    /**
     * Specifies the SKU Name for this Spring Cloud Service. Possible values are `B0`, `S0` and `E0`. Defaults to `S0`. Changing this forces a new resource to be created.
     */
    public val skuName: Output?
        get() = javaResource.skuName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Specifies the SKU Tier for this Spring Cloud Service. Possible values are `Basic`, `Enterprise`, `Standard` and `StandardGen2`. The attribute is automatically computed from API response except when `managed_environment_id` is defined. Changing this forces a new resource to be created.
     */
    public val skuTier: Output
        get() = javaResource.skuTier().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags to assign to the resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

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

    /**
     * Whether zone redundancy is enabled for this Spring Cloud Service. Defaults to `false`.
     */
    public val zoneRedundant: Output?
        get() = javaResource.zoneRedundant().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy