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.SpringCloudCustomDomain.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.appplatform.kotlin
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 [SpringCloudCustomDomain].
*/
@PulumiTagMarker
public class SpringCloudCustomDomainResourceBuilder internal constructor() {
public var name: String? = null
public var args: SpringCloudCustomDomainArgs = SpringCloudCustomDomainArgs()
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 SpringCloudCustomDomainArgsBuilder.() -> Unit) {
val builder = SpringCloudCustomDomainArgsBuilder()
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(): SpringCloudCustomDomain {
val builtJavaResource =
com.pulumi.azure.appplatform.SpringCloudCustomDomain(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SpringCloudCustomDomain(builtJavaResource)
}
}
/**
* Manages an Azure Spring Cloud Custom Domain.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* import * as std from "@pulumi/std";
* const exampleResourceGroup = new azure.core.ResourceGroup("example", {
* name: "rg-example",
* location: "West Europe",
* });
* const example = azure.dns.getZoneOutput({
* name: "mydomain.com",
* resourceGroupName: exampleResourceGroup.name,
* });
* const exampleSpringCloudService = new azure.appplatform.SpringCloudService("example", {
* name: "example-springcloud",
* resourceGroupName: exampleResourceGroup.name,
* location: exampleResourceGroup.location,
* });
* const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("example", {
* name: "example-springcloudapp",
* resourceGroupName: exampleResourceGroup.name,
* serviceName: exampleSpringCloudService.name,
* });
* const exampleCNameRecord = new azure.dns.CNameRecord("example", {
* name: "record1",
* zoneName: example.apply(example => example.name),
* resourceGroupName: example.apply(example => example.resourceGroupName),
* ttl: 300,
* record: exampleSpringCloudApp.fqdn,
* });
* const exampleSpringCloudCustomDomain = new azure.appplatform.SpringCloudCustomDomain("example", {
* name: std.joinOutput({
* separator: ".",
* input: [
* exampleCNameRecord.name,
* exampleCNameRecord.zoneName,
* ],
* }).apply(invoke => invoke.result),
* springCloudAppId: exampleSpringCloudApp.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* import pulumi_std as std
* example_resource_group = azure.core.ResourceGroup("example",
* name="rg-example",
* location="West Europe")
* example = azure.dns.get_zone_output(name="mydomain.com",
* resource_group_name=example_resource_group.name)
* example_spring_cloud_service = azure.appplatform.SpringCloudService("example",
* name="example-springcloud",
* resource_group_name=example_resource_group.name,
* location=example_resource_group.location)
* example_spring_cloud_app = azure.appplatform.SpringCloudApp("example",
* name="example-springcloudapp",
* resource_group_name=example_resource_group.name,
* service_name=example_spring_cloud_service.name)
* example_c_name_record = azure.dns.CNameRecord("example",
* name="record1",
* zone_name=example.name,
* resource_group_name=example.resource_group_name,
* ttl=300,
* record=example_spring_cloud_app.fqdn)
* example_spring_cloud_custom_domain = azure.appplatform.SpringCloudCustomDomain("example",
* name=std.join_output(separator=".",
* input=[
* example_c_name_record.name,
* example_c_name_record.zone_name,
* ]).apply(lambda invoke: invoke.result),
* spring_cloud_app_id=example_spring_cloud_app.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "rg-example",
* Location = "West Europe",
* });
* var example = Azure.Dns.GetZone.Invoke(new()
* {
* Name = "mydomain.com",
* ResourceGroupName = exampleResourceGroup.Name,
* });
* var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("example", new()
* {
* Name = "example-springcloud",
* ResourceGroupName = exampleResourceGroup.Name,
* Location = exampleResourceGroup.Location,
* });
* var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("example", new()
* {
* Name = "example-springcloudapp",
* ResourceGroupName = exampleResourceGroup.Name,
* ServiceName = exampleSpringCloudService.Name,
* });
* var exampleCNameRecord = new Azure.Dns.CNameRecord("example", new()
* {
* Name = "record1",
* ZoneName = example.Apply(getZoneResult => getZoneResult.Name),
* ResourceGroupName = example.Apply(getZoneResult => getZoneResult.ResourceGroupName),
* Ttl = 300,
* Record = exampleSpringCloudApp.Fqdn,
* });
* var exampleSpringCloudCustomDomain = new Azure.AppPlatform.SpringCloudCustomDomain("example", new()
* {
* Name = Std.Join.Invoke(new()
* {
* Separator = ".",
* Input = new[]
* {
* exampleCNameRecord.Name,
* exampleCNameRecord.ZoneName,
* },
* }).Apply(invoke => invoke.Result),
* SpringCloudAppId = exampleSpringCloudApp.Id,
* });
* });
* ```
* ```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/dns"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("rg-example"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* example := dns.LookupZoneOutput(ctx, dns.GetZoneOutputArgs{
* Name: pulumi.String("mydomain.com"),
* ResourceGroupName: exampleResourceGroup.Name,
* }, nil)
* exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "example", &appplatform.SpringCloudServiceArgs{
* Name: pulumi.String("example-springcloud"),
* ResourceGroupName: exampleResourceGroup.Name,
* Location: exampleResourceGroup.Location,
* })
* if err != nil {
* return err
* }
* exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "example", &appplatform.SpringCloudAppArgs{
* Name: pulumi.String("example-springcloudapp"),
* ResourceGroupName: exampleResourceGroup.Name,
* ServiceName: exampleSpringCloudService.Name,
* })
* if err != nil {
* return err
* }
* exampleCNameRecord, err := dns.NewCNameRecord(ctx, "example", &dns.CNameRecordArgs{
* Name: pulumi.String("record1"),
* ZoneName: pulumi.String(example.ApplyT(func(example dns.GetZoneResult) (*string, error) {
* return &example.Name, nil
* }).(pulumi.StringPtrOutput)),
* ResourceGroupName: pulumi.String(example.ApplyT(func(example dns.GetZoneResult) (*string, error) {
* return &example.ResourceGroupName, nil
* }).(pulumi.StringPtrOutput)),
* Ttl: pulumi.Int(300),
* Record: exampleSpringCloudApp.Fqdn,
* })
* if err != nil {
* return err
* }
* _, err = appplatform.NewSpringCloudCustomDomain(ctx, "example", &appplatform.SpringCloudCustomDomainArgs{
* Name: pulumi.String(std.JoinOutput(ctx, std.JoinOutputArgs{
* Separator: pulumi.String("."),
* Input: pulumi.StringArray{
* exampleCNameRecord.Name,
* exampleCNameRecord.ZoneName,
* },
* }, nil).ApplyT(func(invoke std.JoinResult) (*string, error) {
* return invoke.Result, nil
* }).(pulumi.StringPtrOutput)),
* SpringCloudAppId: exampleSpringCloudApp.ID(),
* })
* 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.dns.DnsFunctions;
* import com.pulumi.azure.dns.inputs.GetZoneArgs;
* 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.dns.CNameRecord;
* import com.pulumi.azure.dns.CNameRecordArgs;
* import com.pulumi.azure.appplatform.SpringCloudCustomDomain;
* import com.pulumi.azure.appplatform.SpringCloudCustomDomainArgs;
* 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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
* .name("rg-example")
* .location("West Europe")
* .build());
* final var example = DnsFunctions.getZone(GetZoneArgs.builder()
* .name("mydomain.com")
* .resourceGroupName(exampleResourceGroup.name())
* .build());
* var exampleSpringCloudService = new SpringCloudService("exampleSpringCloudService", SpringCloudServiceArgs.builder()
* .name("example-springcloud")
* .resourceGroupName(exampleResourceGroup.name())
* .location(exampleResourceGroup.location())
* .build());
* var exampleSpringCloudApp = new SpringCloudApp("exampleSpringCloudApp", SpringCloudAppArgs.builder()
* .name("example-springcloudapp")
* .resourceGroupName(exampleResourceGroup.name())
* .serviceName(exampleSpringCloudService.name())
* .build());
* var exampleCNameRecord = new CNameRecord("exampleCNameRecord", CNameRecordArgs.builder()
* .name("record1")
* .zoneName(example.applyValue(getZoneResult -> getZoneResult).applyValue(example -> example.applyValue(getZoneResult -> getZoneResult.name())))
* .resourceGroupName(example.applyValue(getZoneResult -> getZoneResult).applyValue(example -> example.applyValue(getZoneResult -> getZoneResult.resourceGroupName())))
* .ttl(300)
* .record(exampleSpringCloudApp.fqdn())
* .build());
* var exampleSpringCloudCustomDomain = new SpringCloudCustomDomain("exampleSpringCloudCustomDomain", SpringCloudCustomDomainArgs.builder()
* .name(StdFunctions.join().applyValue(invoke -> invoke.result()))
* .springCloudAppId(exampleSpringCloudApp.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleResourceGroup:
* type: azure:core:ResourceGroup
* name: example
* properties:
* name: rg-example
* location: West Europe
* exampleSpringCloudService:
* type: azure:appplatform:SpringCloudService
* name: example
* properties:
* name: example-springcloud
* resourceGroupName: ${exampleResourceGroup.name}
* location: ${exampleResourceGroup.location}
* exampleSpringCloudApp:
* type: azure:appplatform:SpringCloudApp
* name: example
* properties:
* name: example-springcloudapp
* resourceGroupName: ${exampleResourceGroup.name}
* serviceName: ${exampleSpringCloudService.name}
* exampleCNameRecord:
* type: azure:dns:CNameRecord
* name: example
* properties:
* name: record1
* zoneName: ${example.name}
* resourceGroupName: ${example.resourceGroupName}
* ttl: 300
* record: ${exampleSpringCloudApp.fqdn}
* exampleSpringCloudCustomDomain:
* type: azure:appplatform:SpringCloudCustomDomain
* name: example
* properties:
* name:
* fn::invoke:
* Function: std:join
* Arguments:
* separator: .
* input:
* - ${exampleCNameRecord.name}
* - ${exampleCNameRecord.zoneName}
* Return: result
* springCloudAppId: ${exampleSpringCloudApp.id}
* variables:
* example:
* fn::invoke:
* Function: azure:dns:getZone
* Arguments:
* name: mydomain.com
* resourceGroupName: ${exampleResourceGroup.name}
* ```
*
* ## Import
* Spring Cloud Custom Domain can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:appplatform/springCloudCustomDomain:SpringCloudCustomDomain example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.AppPlatform/spring/spring1/apps/app1/domains/domain.com
* ```
*/
public class SpringCloudCustomDomain internal constructor(
override val javaResource: com.pulumi.azure.appplatform.SpringCloudCustomDomain,
) : KotlinCustomResource(javaResource, SpringCloudCustomDomainMapper) {
/**
* Specifies the name of the Spring Cloud Certificate that binds to the Spring Cloud Custom Domain. Required when `thumbprint` is specified
*/
public val certificateName: Output?
get() = javaResource.certificateName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the name of the Spring Cloud Custom Domain. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Specifies the resource ID of the Spring Cloud Application. Changing this forces a new resource to be created.
*/
public val springCloudAppId: Output
get() = javaResource.springCloudAppId().applyValue({ args0 -> args0 })
/**
* Specifies the thumbprint of the Spring Cloud Certificate that binds to the Spring Cloud Custom Domain. Required when `certificate_name` is specified. Changing this forces a new resource to be created.
*/
public val thumbprint: Output?
get() = javaResource.thumbprint().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object SpringCloudCustomDomainMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.appplatform.SpringCloudCustomDomain::class == javaResource::class
override fun map(javaResource: Resource): SpringCloudCustomDomain =
SpringCloudCustomDomain(javaResource as com.pulumi.azure.appplatform.SpringCloudCustomDomain)
}
/**
* @see [SpringCloudCustomDomain].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [SpringCloudCustomDomain].
*/
public suspend fun springCloudCustomDomain(
name: String,
block: suspend SpringCloudCustomDomainResourceBuilder.() -> Unit,
): SpringCloudCustomDomain {
val builder = SpringCloudCustomDomainResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [SpringCloudCustomDomain].
* @param name The _unique_ name of the resulting resource.
*/
public fun springCloudCustomDomain(name: String): SpringCloudCustomDomain {
val builder = SpringCloudCustomDomainResourceBuilder()
builder.name(name)
return builder.build()
}