Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.appplatform.kotlin.SpringCloudConnection.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.appplatform.kotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudConnectionAuthentication
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudConnectionSecretStore
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 com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudConnectionAuthentication.Companion.toKotlin as springCloudConnectionAuthenticationToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudConnectionSecretStore.Companion.toKotlin as springCloudConnectionSecretStoreToKotlin
/**
* Builder for [SpringCloudConnection].
*/
@PulumiTagMarker
public class SpringCloudConnectionResourceBuilder internal constructor() {
public var name: String? = null
public var args: SpringCloudConnectionArgs = SpringCloudConnectionArgs()
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 SpringCloudConnectionArgsBuilder.() -> Unit) {
val builder = SpringCloudConnectionArgsBuilder()
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(): SpringCloudConnection {
val builtJavaResource =
com.pulumi.azure.appplatform.SpringCloudConnection(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SpringCloudConnection(builtJavaResource)
}
}
/**
* Manages a service connector for spring cloud app.
* ## 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 exampleAccount = new azure.cosmosdb.Account("example", {
* name: "example-cosmosdb-account",
* location: example.location,
* resourceGroupName: example.name,
* offerType: "Standard",
* kind: "GlobalDocumentDB",
* consistencyPolicy: {
* consistencyLevel: "BoundedStaleness",
* maxIntervalInSeconds: 10,
* maxStalenessPrefix: 200,
* },
* geoLocations: [{
* location: example.location,
* failoverPriority: 0,
* }],
* });
* const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("example", {
* name: "cosmos-sql-db",
* resourceGroupName: exampleAccount.resourceGroupName,
* accountName: exampleAccount.name,
* throughput: 400,
* });
* const exampleSqlContainer = new azure.cosmosdb.SqlContainer("example", {
* name: "example-container",
* resourceGroupName: exampleAccount.resourceGroupName,
* accountName: exampleAccount.name,
* databaseName: exampleSqlDatabase.name,
* partitionKeyPath: "/definition",
* });
* const exampleSpringCloudService = new azure.appplatform.SpringCloudService("example", {
* name: "examplespringcloud",
* resourceGroupName: example.name,
* location: example.location,
* });
* const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("example", {
* name: "examplespringcloudapp",
* resourceGroupName: example.name,
* serviceName: exampleSpringCloudService.name,
* identity: {
* type: "SystemAssigned",
* },
* });
* const exampleSpringCloudJavaDeployment = new azure.appplatform.SpringCloudJavaDeployment("example", {
* name: "exampledeployment",
* springCloudAppId: exampleSpringCloudApp.id,
* });
* const exampleSpringCloudConnection = new azure.appplatform.SpringCloudConnection("example", {
* name: "example-serviceconnector",
* springCloudId: exampleSpringCloudJavaDeployment.id,
* targetResourceId: exampleSqlDatabase.id,
* authentication: {
* type: "systemAssignedIdentity",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_account = azure.cosmosdb.Account("example",
* name="example-cosmosdb-account",
* location=example.location,
* resource_group_name=example.name,
* offer_type="Standard",
* kind="GlobalDocumentDB",
* consistency_policy={
* "consistency_level": "BoundedStaleness",
* "max_interval_in_seconds": 10,
* "max_staleness_prefix": 200,
* },
* geo_locations=[{
* "location": example.location,
* "failover_priority": 0,
* }])
* example_sql_database = azure.cosmosdb.SqlDatabase("example",
* name="cosmos-sql-db",
* resource_group_name=example_account.resource_group_name,
* account_name=example_account.name,
* throughput=400)
* example_sql_container = azure.cosmosdb.SqlContainer("example",
* name="example-container",
* resource_group_name=example_account.resource_group_name,
* account_name=example_account.name,
* database_name=example_sql_database.name,
* partition_key_path="/definition")
* example_spring_cloud_service = azure.appplatform.SpringCloudService("example",
* name="examplespringcloud",
* resource_group_name=example.name,
* location=example.location)
* example_spring_cloud_app = azure.appplatform.SpringCloudApp("example",
* name="examplespringcloudapp",
* resource_group_name=example.name,
* service_name=example_spring_cloud_service.name,
* identity={
* "type": "SystemAssigned",
* })
* example_spring_cloud_java_deployment = azure.appplatform.SpringCloudJavaDeployment("example",
* name="exampledeployment",
* spring_cloud_app_id=example_spring_cloud_app.id)
* example_spring_cloud_connection = azure.appplatform.SpringCloudConnection("example",
* name="example-serviceconnector",
* spring_cloud_id=example_spring_cloud_java_deployment.id,
* target_resource_id=example_sql_database.id,
* authentication={
* "type": "systemAssignedIdentity",
* })
* ```
* ```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 exampleAccount = new Azure.CosmosDB.Account("example", new()
* {
* Name = "example-cosmosdb-account",
* Location = example.Location,
* ResourceGroupName = example.Name,
* OfferType = "Standard",
* Kind = "GlobalDocumentDB",
* ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs
* {
* ConsistencyLevel = "BoundedStaleness",
* MaxIntervalInSeconds = 10,
* MaxStalenessPrefix = 200,
* },
* GeoLocations = new[]
* {
* new Azure.CosmosDB.Inputs.AccountGeoLocationArgs
* {
* Location = example.Location,
* FailoverPriority = 0,
* },
* },
* });
* var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("example", new()
* {
* Name = "cosmos-sql-db",
* ResourceGroupName = exampleAccount.ResourceGroupName,
* AccountName = exampleAccount.Name,
* Throughput = 400,
* });
* var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("example", new()
* {
* Name = "example-container",
* ResourceGroupName = exampleAccount.ResourceGroupName,
* AccountName = exampleAccount.Name,
* DatabaseName = exampleSqlDatabase.Name,
* PartitionKeyPath = "/definition",
* });
* var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("example", new()
* {
* Name = "examplespringcloud",
* ResourceGroupName = example.Name,
* Location = example.Location,
* });
* var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("example", new()
* {
* Name = "examplespringcloudapp",
* ResourceGroupName = example.Name,
* ServiceName = exampleSpringCloudService.Name,
* Identity = new Azure.AppPlatform.Inputs.SpringCloudAppIdentityArgs
* {
* Type = "SystemAssigned",
* },
* });
* var exampleSpringCloudJavaDeployment = new Azure.AppPlatform.SpringCloudJavaDeployment("example", new()
* {
* Name = "exampledeployment",
* SpringCloudAppId = exampleSpringCloudApp.Id,
* });
* var exampleSpringCloudConnection = new Azure.AppPlatform.SpringCloudConnection("example", new()
* {
* Name = "example-serviceconnector",
* SpringCloudId = exampleSpringCloudJavaDeployment.Id,
* TargetResourceId = exampleSqlDatabase.Id,
* Authentication = new Azure.AppPlatform.Inputs.SpringCloudConnectionAuthenticationArgs
* {
* Type = "systemAssignedIdentity",
* },
* });
* });
* ```
* ```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-azure/sdk/v5/go/azure/cosmosdb"
* "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
* }
* exampleAccount, err := cosmosdb.NewAccount(ctx, "example", &cosmosdb.AccountArgs{
* Name: pulumi.String("example-cosmosdb-account"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* OfferType: pulumi.String("Standard"),
* Kind: pulumi.String("GlobalDocumentDB"),
* ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{
* ConsistencyLevel: pulumi.String("BoundedStaleness"),
* MaxIntervalInSeconds: pulumi.Int(10),
* MaxStalenessPrefix: pulumi.Int(200),
* },
* GeoLocations: cosmosdb.AccountGeoLocationArray{
* &cosmosdb.AccountGeoLocationArgs{
* Location: example.Location,
* FailoverPriority: pulumi.Int(0),
* },
* },
* })
* if err != nil {
* return err
* }
* exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "example", &cosmosdb.SqlDatabaseArgs{
* Name: pulumi.String("cosmos-sql-db"),
* ResourceGroupName: exampleAccount.ResourceGroupName,
* AccountName: exampleAccount.Name,
* Throughput: pulumi.Int(400),
* })
* if err != nil {
* return err
* }
* _, err = cosmosdb.NewSqlContainer(ctx, "example", &cosmosdb.SqlContainerArgs{
* Name: pulumi.String("example-container"),
* ResourceGroupName: exampleAccount.ResourceGroupName,
* AccountName: exampleAccount.Name,
* DatabaseName: exampleSqlDatabase.Name,
* PartitionKeyPath: pulumi.String("/definition"),
* })
* if err != nil {
* return err
* }
* exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "example", &appplatform.SpringCloudServiceArgs{
* Name: pulumi.String("examplespringcloud"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* })
* if err != nil {
* return err
* }
* exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "example", &appplatform.SpringCloudAppArgs{
* Name: pulumi.String("examplespringcloudapp"),
* ResourceGroupName: example.Name,
* ServiceName: exampleSpringCloudService.Name,
* Identity: &appplatform.SpringCloudAppIdentityArgs{
* Type: pulumi.String("SystemAssigned"),
* },
* })
* if err != nil {
* return err
* }
* exampleSpringCloudJavaDeployment, err := appplatform.NewSpringCloudJavaDeployment(ctx, "example", &appplatform.SpringCloudJavaDeploymentArgs{
* Name: pulumi.String("exampledeployment"),
* SpringCloudAppId: exampleSpringCloudApp.ID(),
* })
* if err != nil {
* return err
* }
* _, err = appplatform.NewSpringCloudConnection(ctx, "example", &appplatform.SpringCloudConnectionArgs{
* Name: pulumi.String("example-serviceconnector"),
* SpringCloudId: exampleSpringCloudJavaDeployment.ID(),
* TargetResourceId: exampleSqlDatabase.ID(),
* Authentication: &appplatform.SpringCloudConnectionAuthenticationArgs{
* Type: pulumi.String("systemAssignedIdentity"),
* },
* })
* 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.cosmosdb.Account;
* import com.pulumi.azure.cosmosdb.AccountArgs;
* import com.pulumi.azure.cosmosdb.inputs.AccountConsistencyPolicyArgs;
* import com.pulumi.azure.cosmosdb.inputs.AccountGeoLocationArgs;
* import com.pulumi.azure.cosmosdb.SqlDatabase;
* import com.pulumi.azure.cosmosdb.SqlDatabaseArgs;
* import com.pulumi.azure.cosmosdb.SqlContainer;
* import com.pulumi.azure.cosmosdb.SqlContainerArgs;
* import com.pulumi.azure.appplatform.SpringCloudService;
* import com.pulumi.azure.appplatform.SpringCloudServiceArgs;
* import com.pulumi.azure.appplatform.SpringCloudApp;
* import com.pulumi.azure.appplatform.SpringCloudAppArgs;
* import com.pulumi.azure.appplatform.inputs.SpringCloudAppIdentityArgs;
* import com.pulumi.azure.appplatform.SpringCloudJavaDeployment;
* import com.pulumi.azure.appplatform.SpringCloudJavaDeploymentArgs;
* import com.pulumi.azure.appplatform.SpringCloudConnection;
* import com.pulumi.azure.appplatform.SpringCloudConnectionArgs;
* import com.pulumi.azure.appplatform.inputs.SpringCloudConnectionAuthenticationArgs;
* 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 exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("example-cosmosdb-account")
* .location(example.location())
* .resourceGroupName(example.name())
* .offerType("Standard")
* .kind("GlobalDocumentDB")
* .consistencyPolicy(AccountConsistencyPolicyArgs.builder()
* .consistencyLevel("BoundedStaleness")
* .maxIntervalInSeconds(10)
* .maxStalenessPrefix(200)
* .build())
* .geoLocations(AccountGeoLocationArgs.builder()
* .location(example.location())
* .failoverPriority(0)
* .build())
* .build());
* var exampleSqlDatabase = new SqlDatabase("exampleSqlDatabase", SqlDatabaseArgs.builder()
* .name("cosmos-sql-db")
* .resourceGroupName(exampleAccount.resourceGroupName())
* .accountName(exampleAccount.name())
* .throughput(400)
* .build());
* var exampleSqlContainer = new SqlContainer("exampleSqlContainer", SqlContainerArgs.builder()
* .name("example-container")
* .resourceGroupName(exampleAccount.resourceGroupName())
* .accountName(exampleAccount.name())
* .databaseName(exampleSqlDatabase.name())
* .partitionKeyPath("/definition")
* .build());
* var exampleSpringCloudService = new SpringCloudService("exampleSpringCloudService", SpringCloudServiceArgs.builder()
* .name("examplespringcloud")
* .resourceGroupName(example.name())
* .location(example.location())
* .build());
* var exampleSpringCloudApp = new SpringCloudApp("exampleSpringCloudApp", SpringCloudAppArgs.builder()
* .name("examplespringcloudapp")
* .resourceGroupName(example.name())
* .serviceName(exampleSpringCloudService.name())
* .identity(SpringCloudAppIdentityArgs.builder()
* .type("SystemAssigned")
* .build())
* .build());
* var exampleSpringCloudJavaDeployment = new SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", SpringCloudJavaDeploymentArgs.builder()
* .name("exampledeployment")
* .springCloudAppId(exampleSpringCloudApp.id())
* .build());
* var exampleSpringCloudConnection = new SpringCloudConnection("exampleSpringCloudConnection", SpringCloudConnectionArgs.builder()
* .name("example-serviceconnector")
* .springCloudId(exampleSpringCloudJavaDeployment.id())
* .targetResourceId(exampleSqlDatabase.id())
* .authentication(SpringCloudConnectionAuthenticationArgs.builder()
* .type("systemAssignedIdentity")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleAccount:
* type: azure:cosmosdb:Account
* name: example
* properties:
* name: example-cosmosdb-account
* location: ${example.location}
* resourceGroupName: ${example.name}
* offerType: Standard
* kind: GlobalDocumentDB
* consistencyPolicy:
* consistencyLevel: BoundedStaleness
* maxIntervalInSeconds: 10
* maxStalenessPrefix: 200
* geoLocations:
* - location: ${example.location}
* failoverPriority: 0
* exampleSqlDatabase:
* type: azure:cosmosdb:SqlDatabase
* name: example
* properties:
* name: cosmos-sql-db
* resourceGroupName: ${exampleAccount.resourceGroupName}
* accountName: ${exampleAccount.name}
* throughput: 400
* exampleSqlContainer:
* type: azure:cosmosdb:SqlContainer
* name: example
* properties:
* name: example-container
* resourceGroupName: ${exampleAccount.resourceGroupName}
* accountName: ${exampleAccount.name}
* databaseName: ${exampleSqlDatabase.name}
* partitionKeyPath: /definition
* exampleSpringCloudService:
* type: azure:appplatform:SpringCloudService
* name: example
* properties:
* name: examplespringcloud
* resourceGroupName: ${example.name}
* location: ${example.location}
* exampleSpringCloudApp:
* type: azure:appplatform:SpringCloudApp
* name: example
* properties:
* name: examplespringcloudapp
* resourceGroupName: ${example.name}
* serviceName: ${exampleSpringCloudService.name}
* identity:
* type: SystemAssigned
* exampleSpringCloudJavaDeployment:
* type: azure:appplatform:SpringCloudJavaDeployment
* name: example
* properties:
* name: exampledeployment
* springCloudAppId: ${exampleSpringCloudApp.id}
* exampleSpringCloudConnection:
* type: azure:appplatform:SpringCloudConnection
* name: example
* properties:
* name: example-serviceconnector
* springCloudId: ${exampleSpringCloudJavaDeployment.id}
* targetResourceId: ${exampleSqlDatabase.id}
* authentication:
* type: systemAssignedIdentity
* ```
*
* ## Import
* Service Connector for spring cloud can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:appplatform/springCloudConnection:SpringCloudConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AppPlatform/Spring/springcloud/apps/springcloudapp/deployments/deployment/providers/Microsoft.ServiceLinker/linkers/serviceconnector1
* ```
*/
public class SpringCloudConnection internal constructor(
override val javaResource: com.pulumi.azure.appplatform.SpringCloudConnection,
) : KotlinCustomResource(javaResource, SpringCloudConnectionMapper) {
/**
* The authentication info. An `authentication` block as defined below.
*/
public val authentication: Output
get() = javaResource.authentication().applyValue({ args0 ->
args0.let({ args0 ->
springCloudConnectionAuthenticationToKotlin(args0)
})
})
public val clientType: Output?
get() = javaResource.clientType().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the service connection. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
public val secretStore: Output?
get() = javaResource.secretStore().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
springCloudConnectionSecretStoreToKotlin(args0)
})
}).orElse(null)
})
/**
* The ID of the data source spring cloud. Changing this forces a new resource to be created.
*/
public val springCloudId: Output
get() = javaResource.springCloudId().applyValue({ args0 -> args0 })
/**
* The ID of the target resource. Changing this forces a new resource to be created. Possible target resources are `Postgres`, `PostgresFlexible`, `Mysql`, `Sql`, `Redis`, `RedisEnterprise`, `CosmosCassandra`, `CosmosGremlin`, `CosmosMongo`, `CosmosSql`, `CosmosTable`, `StorageBlob`, `StorageQueue`, `StorageFile`, `StorageTable`, `AppConfig`, `EventHub`, `ServiceBus`, `SignalR`, `WebPubSub`, `ConfluentKafka`. The integration guide can be found [here](https://learn.microsoft.com/en-us/azure/service-connector/how-to-integrate-postgres).
*/
public val targetResourceId: Output
get() = javaResource.targetResourceId().applyValue({ args0 -> args0 })
public val vnetSolution: Output?
get() = javaResource.vnetSolution().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object SpringCloudConnectionMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.appplatform.SpringCloudConnection::class == javaResource::class
override fun map(javaResource: Resource): SpringCloudConnection =
SpringCloudConnection(javaResource as com.pulumi.azure.appplatform.SpringCloudConnection)
}
/**
* @see [SpringCloudConnection].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [SpringCloudConnection].
*/
public suspend fun springCloudConnection(
name: String,
block: suspend SpringCloudConnectionResourceBuilder.() -> Unit,
): SpringCloudConnection {
val builder = SpringCloudConnectionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [SpringCloudConnection].
* @param name The _unique_ name of the resulting resource.
*/
public fun springCloudConnection(name: String): SpringCloudConnection {
val builder = SpringCloudConnectionResourceBuilder()
builder.name(name)
return builder.build()
}