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

com.pulumi.azure.appplatform.kotlin.SpringCloudApiPortalArgs.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.SpringCloudApiPortalArgs.builder
import com.pulumi.azure.appplatform.kotlin.inputs.SpringCloudApiPortalSsoArgs
import com.pulumi.azure.appplatform.kotlin.inputs.SpringCloudApiPortalSsoArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Spring Cloud API Portal.
 * > **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",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     skuName: "E0",
 * });
 * const exampleSpringCloudGateway = new azure.appplatform.SpringCloudGateway("example", {
 *     name: "default",
 *     springCloudServiceId: exampleSpringCloudService.id,
 * });
 * const exampleSpringCloudApiPortal = new azure.appplatform.SpringCloudApiPortal("example", {
 *     name: "default",
 *     springCloudServiceId: exampleSpringCloudService.id,
 *     gatewayIds: [exampleSpringCloudGateway.id],
 *     httpsOnlyEnabled: false,
 *     publicNetworkAccessEnabled: true,
 *     instanceCount: 1,
 *     apiTryOutEnabled: true,
 *     sso: {
 *         clientId: "test",
 *         clientSecret: "secret",
 *         issuerUri: "https://www.example.com/issueToken",
 *         scopes: ["read"],
 *     },
 * });
 * ```
 * ```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",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku_name="E0")
 * example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("example",
 *     name="default",
 *     spring_cloud_service_id=example_spring_cloud_service.id)
 * example_spring_cloud_api_portal = azure.appplatform.SpringCloudApiPortal("example",
 *     name="default",
 *     spring_cloud_service_id=example_spring_cloud_service.id,
 *     gateway_ids=[example_spring_cloud_gateway.id],
 *     https_only_enabled=False,
 *     public_network_access_enabled=True,
 *     instance_count=1,
 *     api_try_out_enabled=True,
 *     sso=azure.appplatform.SpringCloudApiPortalSsoArgs(
 *         client_id="test",
 *         client_secret="secret",
 *         issuer_uri="https://www.example.com/issueToken",
 *         scopes=["read"],
 *     ))
 * ```
 * ```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",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         SkuName = "E0",
 *     });
 *     var exampleSpringCloudGateway = new Azure.AppPlatform.SpringCloudGateway("example", new()
 *     {
 *         Name = "default",
 *         SpringCloudServiceId = exampleSpringCloudService.Id,
 *     });
 *     var exampleSpringCloudApiPortal = new Azure.AppPlatform.SpringCloudApiPortal("example", new()
 *     {
 *         Name = "default",
 *         SpringCloudServiceId = exampleSpringCloudService.Id,
 *         GatewayIds = new[]
 *         {
 *             exampleSpringCloudGateway.Id,
 *         },
 *         HttpsOnlyEnabled = false,
 *         PublicNetworkAccessEnabled = true,
 *         InstanceCount = 1,
 *         ApiTryOutEnabled = true,
 *         Sso = new Azure.AppPlatform.Inputs.SpringCloudApiPortalSsoArgs
 *         {
 *             ClientId = "test",
 *             ClientSecret = "secret",
 *             IssuerUri = "https://www.example.com/issueToken",
 *             Scopes = new[]
 *             {
 *                 "read",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```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"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			SkuName:           pulumi.String("E0"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSpringCloudGateway, err := appplatform.NewSpringCloudGateway(ctx, "example", &appplatform.SpringCloudGatewayArgs{
 * 			Name:                 pulumi.String("default"),
 * 			SpringCloudServiceId: exampleSpringCloudService.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appplatform.NewSpringCloudApiPortal(ctx, "example", &appplatform.SpringCloudApiPortalArgs{
 * 			Name:                 pulumi.String("default"),
 * 			SpringCloudServiceId: exampleSpringCloudService.ID(),
 * 			GatewayIds: pulumi.StringArray{
 * 				exampleSpringCloudGateway.ID(),
 * 			},
 * 			HttpsOnlyEnabled:           pulumi.Bool(false),
 * 			PublicNetworkAccessEnabled: pulumi.Bool(true),
 * 			InstanceCount:              pulumi.Int(1),
 * 			ApiTryOutEnabled:           pulumi.Bool(true),
 * 			Sso: &appplatform.SpringCloudApiPortalSsoArgs{
 * 				ClientId:     pulumi.String("test"),
 * 				ClientSecret: pulumi.String("secret"),
 * 				IssuerUri:    pulumi.String("https://www.example.com/issueToken"),
 * 				Scopes: pulumi.StringArray{
 * 					pulumi.String("read"),
 * 				},
 * 			},
 * 		})
 * 		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.SpringCloudGateway;
 * import com.pulumi.azure.appplatform.SpringCloudGatewayArgs;
 * import com.pulumi.azure.appplatform.SpringCloudApiPortal;
 * import com.pulumi.azure.appplatform.SpringCloudApiPortalArgs;
 * import com.pulumi.azure.appplatform.inputs.SpringCloudApiPortalSsoArgs;
 * 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")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .skuName("E0")
 *             .build());
 *         var exampleSpringCloudGateway = new SpringCloudGateway("exampleSpringCloudGateway", SpringCloudGatewayArgs.builder()
 *             .name("default")
 *             .springCloudServiceId(exampleSpringCloudService.id())
 *             .build());
 *         var exampleSpringCloudApiPortal = new SpringCloudApiPortal("exampleSpringCloudApiPortal", SpringCloudApiPortalArgs.builder()
 *             .name("default")
 *             .springCloudServiceId(exampleSpringCloudService.id())
 *             .gatewayIds(exampleSpringCloudGateway.id())
 *             .httpsOnlyEnabled(false)
 *             .publicNetworkAccessEnabled(true)
 *             .instanceCount(1)
 *             .apiTryOutEnabled(true)
 *             .sso(SpringCloudApiPortalSsoArgs.builder()
 *                 .clientId("test")
 *                 .clientSecret("secret")
 *                 .issuerUri("https://www.example.com/issueToken")
 *                 .scopes("read")
 *                 .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
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       skuName: E0
 *   exampleSpringCloudGateway:
 *     type: azure:appplatform:SpringCloudGateway
 *     name: example
 *     properties:
 *       name: default
 *       springCloudServiceId: ${exampleSpringCloudService.id}
 *   exampleSpringCloudApiPortal:
 *     type: azure:appplatform:SpringCloudApiPortal
 *     name: example
 *     properties:
 *       name: default
 *       springCloudServiceId: ${exampleSpringCloudService.id}
 *       gatewayIds:
 *         - ${exampleSpringCloudGateway.id}
 *       httpsOnlyEnabled: false
 *       publicNetworkAccessEnabled: true
 *       instanceCount: 1
 *       apiTryOutEnabled: true
 *       sso:
 *         clientId: test
 *         clientSecret: secret
 *         issuerUri: https://www.example.com/issueToken
 *         scopes:
 *           - read
 * ```
 * 
 * ## Import
 * Spring Cloud API Portals can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appplatform/springCloudApiPortal:SpringCloudApiPortal example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.AppPlatform/spring/service1/apiPortals/apiPortal1
 * ```
 * @property apiTryOutEnabled Specifies whether the API try-out feature is enabled. When enabled, users can try out the API by sending requests and viewing responses in API portal.
 * @property gatewayIds Specifies a list of Spring Cloud Gateway.
 * @property httpsOnlyEnabled is only https is allowed?
 * @property instanceCount Specifies the required instance count of the Spring Cloud API Portal. Possible Values are between `1` and `500`. Defaults to `1` if not specified.
 * @property name The name which should be used for this Spring Cloud API Portal. Changing this forces a new Spring Cloud API Portal to be created. The only possible value is `default`.
 * @property publicNetworkAccessEnabled Is the public network access enabled?
 * @property springCloudServiceId The ID of the Spring Cloud Service. Changing this forces a new Spring Cloud API Portal to be created.
 * @property sso A `sso` block as defined below.
 */
public data class SpringCloudApiPortalArgs(
    public val apiTryOutEnabled: Output? = null,
    public val gatewayIds: Output>? = null,
    public val httpsOnlyEnabled: Output? = null,
    public val instanceCount: Output? = null,
    public val name: Output? = null,
    public val publicNetworkAccessEnabled: Output? = null,
    public val springCloudServiceId: Output? = null,
    public val sso: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.appplatform.SpringCloudApiPortalArgs =
        com.pulumi.azure.appplatform.SpringCloudApiPortalArgs.builder()
            .apiTryOutEnabled(apiTryOutEnabled?.applyValue({ args0 -> args0 }))
            .gatewayIds(gatewayIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .httpsOnlyEnabled(httpsOnlyEnabled?.applyValue({ args0 -> args0 }))
            .instanceCount(instanceCount?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .publicNetworkAccessEnabled(publicNetworkAccessEnabled?.applyValue({ args0 -> args0 }))
            .springCloudServiceId(springCloudServiceId?.applyValue({ args0 -> args0 }))
            .sso(sso?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [SpringCloudApiPortalArgs].
 */
@PulumiTagMarker
public class SpringCloudApiPortalArgsBuilder internal constructor() {
    private var apiTryOutEnabled: Output? = null

    private var gatewayIds: Output>? = null

    private var httpsOnlyEnabled: Output? = null

    private var instanceCount: Output? = null

    private var name: Output? = null

    private var publicNetworkAccessEnabled: Output? = null

    private var springCloudServiceId: Output? = null

    private var sso: Output? = null

    /**
     * @param value Specifies whether the API try-out feature is enabled. When enabled, users can try out the API by sending requests and viewing responses in API portal.
     */
    @JvmName("nortttofsmjwlgvw")
    public suspend fun apiTryOutEnabled(`value`: Output) {
        this.apiTryOutEnabled = value
    }

    /**
     * @param value Specifies a list of Spring Cloud Gateway.
     */
    @JvmName("ncfpsnjkiuuqbxyt")
    public suspend fun gatewayIds(`value`: Output>) {
        this.gatewayIds = value
    }

    @JvmName("voipcasnvrouqwvw")
    public suspend fun gatewayIds(vararg values: Output) {
        this.gatewayIds = Output.all(values.asList())
    }

    /**
     * @param values Specifies a list of Spring Cloud Gateway.
     */
    @JvmName("yxpvosqikyunhsnk")
    public suspend fun gatewayIds(values: List>) {
        this.gatewayIds = Output.all(values)
    }

    /**
     * @param value is only https is allowed?
     */
    @JvmName("fnqtlxfepfqkwkea")
    public suspend fun httpsOnlyEnabled(`value`: Output) {
        this.httpsOnlyEnabled = value
    }

    /**
     * @param value Specifies the required instance count of the Spring Cloud API Portal. Possible Values are between `1` and `500`. Defaults to `1` if not specified.
     */
    @JvmName("qvpydbjjvynqpqga")
    public suspend fun instanceCount(`value`: Output) {
        this.instanceCount = value
    }

    /**
     * @param value The name which should be used for this Spring Cloud API Portal. Changing this forces a new Spring Cloud API Portal to be created. The only possible value is `default`.
     */
    @JvmName("ndrevclknxdlqltj")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Is the public network access enabled?
     */
    @JvmName("mvujisbsnpgahtbk")
    public suspend fun publicNetworkAccessEnabled(`value`: Output) {
        this.publicNetworkAccessEnabled = value
    }

    /**
     * @param value The ID of the Spring Cloud Service. Changing this forces a new Spring Cloud API Portal to be created.
     */
    @JvmName("xqwngwotirttqmah")
    public suspend fun springCloudServiceId(`value`: Output) {
        this.springCloudServiceId = value
    }

    /**
     * @param value A `sso` block as defined below.
     */
    @JvmName("brjbpsxehncaorri")
    public suspend fun sso(`value`: Output) {
        this.sso = value
    }

    /**
     * @param value Specifies whether the API try-out feature is enabled. When enabled, users can try out the API by sending requests and viewing responses in API portal.
     */
    @JvmName("ehosgtypwnlwwstn")
    public suspend fun apiTryOutEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiTryOutEnabled = mapped
    }

    /**
     * @param value Specifies a list of Spring Cloud Gateway.
     */
    @JvmName("gkuqorwfnqktpfct")
    public suspend fun gatewayIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.gatewayIds = mapped
    }

    /**
     * @param values Specifies a list of Spring Cloud Gateway.
     */
    @JvmName("jfevpkujbpeyxscn")
    public suspend fun gatewayIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.gatewayIds = mapped
    }

    /**
     * @param value is only https is allowed?
     */
    @JvmName("olkbreqwxfylcaqi")
    public suspend fun httpsOnlyEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.httpsOnlyEnabled = mapped
    }

    /**
     * @param value Specifies the required instance count of the Spring Cloud API Portal. Possible Values are between `1` and `500`. Defaults to `1` if not specified.
     */
    @JvmName("kcdnekdsilvnrevl")
    public suspend fun instanceCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceCount = mapped
    }

    /**
     * @param value The name which should be used for this Spring Cloud API Portal. Changing this forces a new Spring Cloud API Portal to be created. The only possible value is `default`.
     */
    @JvmName("iswdjeqsgdrqfxkt")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Is the public network access enabled?
     */
    @JvmName("btdkswdmukbnulmu")
    public suspend fun publicNetworkAccessEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publicNetworkAccessEnabled = mapped
    }

    /**
     * @param value The ID of the Spring Cloud Service. Changing this forces a new Spring Cloud API Portal to be created.
     */
    @JvmName("jcruoicttmtwaroe")
    public suspend fun springCloudServiceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.springCloudServiceId = mapped
    }

    /**
     * @param value A `sso` block as defined below.
     */
    @JvmName("lgpymduhluwdxwpb")
    public suspend fun sso(`value`: SpringCloudApiPortalSsoArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sso = mapped
    }

    /**
     * @param argument A `sso` block as defined below.
     */
    @JvmName("npiyilopffntrcmp")
    public suspend fun sso(argument: suspend SpringCloudApiPortalSsoArgsBuilder.() -> Unit) {
        val toBeMapped = SpringCloudApiPortalSsoArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.sso = mapped
    }

    internal fun build(): SpringCloudApiPortalArgs = SpringCloudApiPortalArgs(
        apiTryOutEnabled = apiTryOutEnabled,
        gatewayIds = gatewayIds,
        httpsOnlyEnabled = httpsOnlyEnabled,
        instanceCount = instanceCount,
        name = name,
        publicNetworkAccessEnabled = publicNetworkAccessEnabled,
        springCloudServiceId = springCloudServiceId,
        sso = sso,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy