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

com.pulumi.azure.apimanagement.kotlin.CustomDomain.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.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.apimanagement.kotlin

import com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainDeveloperPortal
import com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainGateway
import com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainManagement
import com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainPortal
import com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainScm
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 com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainDeveloperPortal.Companion.toKotlin as customDomainDeveloperPortalToKotlin
import com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainGateway.Companion.toKotlin as customDomainGatewayToKotlin
import com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainManagement.Companion.toKotlin as customDomainManagementToKotlin
import com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainPortal.Companion.toKotlin as customDomainPortalToKotlin
import com.pulumi.azure.apimanagement.kotlin.outputs.CustomDomainScm.Companion.toKotlin as customDomainScmToKotlin

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

    public var args: CustomDomainArgs = CustomDomainArgs()

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

/**
 * Manages a API Management Custom Domain.
 * ## Disclaimers
 * > **Note:** It's possible to define Custom Domains both within the `azure.apimanagement.Service` resource via the `hostname_configurations` block and by using this resource. However it's not possible to use both methods to manage Custom Domains within an API Management Service, since there will be conflicts.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const exampleResourceGroup = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const example = azure.keyvault.getKeyVault({
 *     name: "mykeyvault",
 *     resourceGroupName: "some-resource-group",
 * });
 * const exampleService = new azure.apimanagement.Service("example", {
 *     name: "example-apim",
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 *     publisherName: "pub1",
 *     publisherEmail: "[email protected]",
 *     skuName: "Developer_1",
 * });
 * const exampleCertificate = new azure.keyvault.Certificate("example", {
 *     name: "example-certificate",
 *     keyVaultId: example.then(example => example.id),
 *     certificatePolicy: {
 *         issuerParameters: {
 *             name: "Self",
 *         },
 *         keyProperties: {
 *             exportable: true,
 *             keySize: 2048,
 *             keyType: "RSA",
 *             reuseKey: true,
 *         },
 *         lifetimeActions: [{
 *             action: {
 *                 actionType: "AutoRenew",
 *             },
 *             trigger: {
 *                 daysBeforeExpiry: 30,
 *             },
 *         }],
 *         secretProperties: {
 *             contentType: "application/x-pkcs12",
 *         },
 *         x509CertificateProperties: {
 *             keyUsages: [
 *                 "cRLSign",
 *                 "dataEncipherment",
 *                 "digitalSignature",
 *                 "keyAgreement",
 *                 "keyCertSign",
 *                 "keyEncipherment",
 *             ],
 *             subject: "CN=api.example.com",
 *             validityInMonths: 12,
 *             subjectAlternativeNames: {
 *                 dnsNames: [
 *                     "api.example.com",
 *                     "portal.example.com",
 *                 ],
 *             },
 *         },
 *     },
 * });
 * const exampleCustomDomain = new azure.apimanagement.CustomDomain("example", {
 *     apiManagementId: exampleService.id,
 *     gateways: [{
 *         hostName: "api.example.com",
 *         keyVaultId: exampleCertificate.versionlessSecretId,
 *     }],
 *     developerPortals: [{
 *         hostName: "portal.example.com",
 *         keyVaultId: exampleCertificate.versionlessSecretId,
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example_resource_group = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example = azure.keyvault.get_key_vault(name="mykeyvault",
 *     resource_group_name="some-resource-group")
 * example_service = azure.apimanagement.Service("example",
 *     name="example-apim",
 *     location=example_resource_group.location,
 *     resource_group_name=example_resource_group.name,
 *     publisher_name="pub1",
 *     publisher_email="[email protected]",
 *     sku_name="Developer_1")
 * example_certificate = azure.keyvault.Certificate("example",
 *     name="example-certificate",
 *     key_vault_id=example.id,
 *     certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs(
 *         issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs(
 *             name="Self",
 *         ),
 *         key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs(
 *             exportable=True,
 *             key_size=2048,
 *             key_type="RSA",
 *             reuse_key=True,
 *         ),
 *         lifetime_actions=[azure.keyvault.CertificateCertificatePolicyLifetimeActionArgs(
 *             action=azure.keyvault.CertificateCertificatePolicyLifetimeActionActionArgs(
 *                 action_type="AutoRenew",
 *             ),
 *             trigger=azure.keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs(
 *                 days_before_expiry=30,
 *             ),
 *         )],
 *         secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs(
 *             content_type="application/x-pkcs12",
 *         ),
 *         x509_certificate_properties=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs(
 *             key_usages=[
 *                 "cRLSign",
 *                 "dataEncipherment",
 *                 "digitalSignature",
 *                 "keyAgreement",
 *                 "keyCertSign",
 *                 "keyEncipherment",
 *             ],
 *             subject="CN=api.example.com",
 *             validity_in_months=12,
 *             subject_alternative_names=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs(
 *                 dns_names=[
 *                     "api.example.com",
 *                     "portal.example.com",
 *                 ],
 *             ),
 *         ),
 *     ))
 * example_custom_domain = azure.apimanagement.CustomDomain("example",
 *     api_management_id=example_service.id,
 *     gateways=[azure.apimanagement.CustomDomainGatewayArgs(
 *         host_name="api.example.com",
 *         key_vault_id=example_certificate.versionless_secret_id,
 *     )],
 *     developer_portals=[azure.apimanagement.CustomDomainDeveloperPortalArgs(
 *         host_name="portal.example.com",
 *         key_vault_id=example_certificate.versionless_secret_id,
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var example = Azure.KeyVault.GetKeyVault.Invoke(new()
 *     {
 *         Name = "mykeyvault",
 *         ResourceGroupName = "some-resource-group",
 *     });
 *     var exampleService = new Azure.ApiManagement.Service("example", new()
 *     {
 *         Name = "example-apim",
 *         Location = exampleResourceGroup.Location,
 *         ResourceGroupName = exampleResourceGroup.Name,
 *         PublisherName = "pub1",
 *         PublisherEmail = "[email protected]",
 *         SkuName = "Developer_1",
 *     });
 *     var exampleCertificate = new Azure.KeyVault.Certificate("example", new()
 *     {
 *         Name = "example-certificate",
 *         KeyVaultId = example.Apply(getKeyVaultResult => getKeyVaultResult.Id),
 *         CertificatePolicy = new Azure.KeyVault.Inputs.CertificateCertificatePolicyArgs
 *         {
 *             IssuerParameters = new Azure.KeyVault.Inputs.CertificateCertificatePolicyIssuerParametersArgs
 *             {
 *                 Name = "Self",
 *             },
 *             KeyProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyKeyPropertiesArgs
 *             {
 *                 Exportable = true,
 *                 KeySize = 2048,
 *                 KeyType = "RSA",
 *                 ReuseKey = true,
 *             },
 *             LifetimeActions = new[]
 *             {
 *                 new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionArgs
 *                 {
 *                     Action = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionActionArgs
 *                     {
 *                         ActionType = "AutoRenew",
 *                     },
 *                     Trigger = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionTriggerArgs
 *                     {
 *                         DaysBeforeExpiry = 30,
 *                     },
 *                 },
 *             },
 *             SecretProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicySecretPropertiesArgs
 *             {
 *                 ContentType = "application/x-pkcs12",
 *             },
 *             X509CertificateProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyX509CertificatePropertiesArgs
 *             {
 *                 KeyUsages = new[]
 *                 {
 *                     "cRLSign",
 *                     "dataEncipherment",
 *                     "digitalSignature",
 *                     "keyAgreement",
 *                     "keyCertSign",
 *                     "keyEncipherment",
 *                 },
 *                 Subject = "CN=api.example.com",
 *                 ValidityInMonths = 12,
 *                 SubjectAlternativeNames = new Azure.KeyVault.Inputs.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs
 *                 {
 *                     DnsNames = new[]
 *                     {
 *                         "api.example.com",
 *                         "portal.example.com",
 *                     },
 *                 },
 *             },
 *         },
 *     });
 *     var exampleCustomDomain = new Azure.ApiManagement.CustomDomain("example", new()
 *     {
 *         ApiManagementId = exampleService.Id,
 *         Gateways = new[]
 *         {
 *             new Azure.ApiManagement.Inputs.CustomDomainGatewayArgs
 *             {
 *                 HostName = "api.example.com",
 *                 KeyVaultId = exampleCertificate.VersionlessSecretId,
 *             },
 *         },
 *         DeveloperPortals = new[]
 *         {
 *             new Azure.ApiManagement.Inputs.CustomDomainDeveloperPortalArgs
 *             {
 *                 HostName = "portal.example.com",
 *                 KeyVaultId = exampleCertificate.VersionlessSecretId,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault"
 * 	"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("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{
 * 			Name:              "mykeyvault",
 * 			ResourceGroupName: "some-resource-group",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
 * 			Name:              pulumi.String("example-apim"),
 * 			Location:          exampleResourceGroup.Location,
 * 			ResourceGroupName: exampleResourceGroup.Name,
 * 			PublisherName:     pulumi.String("pub1"),
 * 			PublisherEmail:    pulumi.String("[email protected]"),
 * 			SkuName:           pulumi.String("Developer_1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleCertificate, err := keyvault.NewCertificate(ctx, "example", &keyvault.CertificateArgs{
 * 			Name:       pulumi.String("example-certificate"),
 * 			KeyVaultId: pulumi.String(example.Id),
 * 			CertificatePolicy: &keyvault.CertificateCertificatePolicyArgs{
 * 				IssuerParameters: &keyvault.CertificateCertificatePolicyIssuerParametersArgs{
 * 					Name: pulumi.String("Self"),
 * 				},
 * 				KeyProperties: &keyvault.CertificateCertificatePolicyKeyPropertiesArgs{
 * 					Exportable: pulumi.Bool(true),
 * 					KeySize:    pulumi.Int(2048),
 * 					KeyType:    pulumi.String("RSA"),
 * 					ReuseKey:   pulumi.Bool(true),
 * 				},
 * 				LifetimeActions: keyvault.CertificateCertificatePolicyLifetimeActionArray{
 * 					&keyvault.CertificateCertificatePolicyLifetimeActionArgs{
 * 						Action: &keyvault.CertificateCertificatePolicyLifetimeActionActionArgs{
 * 							ActionType: pulumi.String("AutoRenew"),
 * 						},
 * 						Trigger: &keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs{
 * 							DaysBeforeExpiry: pulumi.Int(30),
 * 						},
 * 					},
 * 				},
 * 				SecretProperties: &keyvault.CertificateCertificatePolicySecretPropertiesArgs{
 * 					ContentType: pulumi.String("application/x-pkcs12"),
 * 				},
 * 				X509CertificateProperties: &keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs{
 * 					KeyUsages: pulumi.StringArray{
 * 						pulumi.String("cRLSign"),
 * 						pulumi.String("dataEncipherment"),
 * 						pulumi.String("digitalSignature"),
 * 						pulumi.String("keyAgreement"),
 * 						pulumi.String("keyCertSign"),
 * 						pulumi.String("keyEncipherment"),
 * 					},
 * 					Subject:          pulumi.String("CN=api.example.com"),
 * 					ValidityInMonths: pulumi.Int(12),
 * 					SubjectAlternativeNames: &keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs{
 * 						DnsNames: pulumi.StringArray{
 * 							pulumi.String("api.example.com"),
 * 							pulumi.String("portal.example.com"),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = apimanagement.NewCustomDomain(ctx, "example", &apimanagement.CustomDomainArgs{
 * 			ApiManagementId: exampleService.ID(),
 * 			Gateways: apimanagement.CustomDomainGatewayArray{
 * 				&apimanagement.CustomDomainGatewayArgs{
 * 					HostName:   pulumi.String("api.example.com"),
 * 					KeyVaultId: exampleCertificate.VersionlessSecretId,
 * 				},
 * 			},
 * 			DeveloperPortals: apimanagement.CustomDomainDeveloperPortalArray{
 * 				&apimanagement.CustomDomainDeveloperPortalArgs{
 * 					HostName:   pulumi.String("portal.example.com"),
 * 					KeyVaultId: exampleCertificate.VersionlessSecretId,
 * 				},
 * 			},
 * 		})
 * 		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.keyvault.KeyvaultFunctions;
 * import com.pulumi.azure.keyvault.inputs.GetKeyVaultArgs;
 * import com.pulumi.azure.apimanagement.Service;
 * import com.pulumi.azure.apimanagement.ServiceArgs;
 * import com.pulumi.azure.keyvault.Certificate;
 * import com.pulumi.azure.keyvault.CertificateArgs;
 * import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicyArgs;
 * import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicyIssuerParametersArgs;
 * import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicyKeyPropertiesArgs;
 * import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicySecretPropertiesArgs;
 * import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicyX509CertificatePropertiesArgs;
 * import com.pulumi.azure.keyvault.inputs.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs;
 * import com.pulumi.azure.apimanagement.CustomDomain;
 * import com.pulumi.azure.apimanagement.CustomDomainArgs;
 * import com.pulumi.azure.apimanagement.inputs.CustomDomainGatewayArgs;
 * import com.pulumi.azure.apimanagement.inputs.CustomDomainDeveloperPortalArgs;
 * 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("example-resources")
 *             .location("West Europe")
 *             .build());
 *         final var example = KeyvaultFunctions.getKeyVault(GetKeyVaultArgs.builder()
 *             .name("mykeyvault")
 *             .resourceGroupName("some-resource-group")
 *             .build());
 *         var exampleService = new Service("exampleService", ServiceArgs.builder()
 *             .name("example-apim")
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .publisherName("pub1")
 *             .publisherEmail("[email protected]")
 *             .skuName("Developer_1")
 *             .build());
 *         var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
 *             .name("example-certificate")
 *             .keyVaultId(example.applyValue(getKeyVaultResult -> getKeyVaultResult.id()))
 *             .certificatePolicy(CertificateCertificatePolicyArgs.builder()
 *                 .issuerParameters(CertificateCertificatePolicyIssuerParametersArgs.builder()
 *                     .name("Self")
 *                     .build())
 *                 .keyProperties(CertificateCertificatePolicyKeyPropertiesArgs.builder()
 *                     .exportable(true)
 *                     .keySize(2048)
 *                     .keyType("RSA")
 *                     .reuseKey(true)
 *                     .build())
 *                 .lifetimeActions(CertificateCertificatePolicyLifetimeActionArgs.builder()
 *                     .action(CertificateCertificatePolicyLifetimeActionActionArgs.builder()
 *                         .actionType("AutoRenew")
 *                         .build())
 *                     .trigger(CertificateCertificatePolicyLifetimeActionTriggerArgs.builder()
 *                         .daysBeforeExpiry(30)
 *                         .build())
 *                     .build())
 *                 .secretProperties(CertificateCertificatePolicySecretPropertiesArgs.builder()
 *                     .contentType("application/x-pkcs12")
 *                     .build())
 *                 .x509CertificateProperties(CertificateCertificatePolicyX509CertificatePropertiesArgs.builder()
 *                     .keyUsages(
 *                         "cRLSign",
 *                         "dataEncipherment",
 *                         "digitalSignature",
 *                         "keyAgreement",
 *                         "keyCertSign",
 *                         "keyEncipherment")
 *                     .subject("CN=api.example.com")
 *                     .validityInMonths(12)
 *                     .subjectAlternativeNames(CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs.builder()
 *                         .dnsNames(
 *                             "api.example.com",
 *                             "portal.example.com")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *         var exampleCustomDomain = new CustomDomain("exampleCustomDomain", CustomDomainArgs.builder()
 *             .apiManagementId(exampleService.id())
 *             .gateways(CustomDomainGatewayArgs.builder()
 *                 .hostName("api.example.com")
 *                 .keyVaultId(exampleCertificate.versionlessSecretId())
 *                 .build())
 *             .developerPortals(CustomDomainDeveloperPortalArgs.builder()
 *                 .hostName("portal.example.com")
 *                 .keyVaultId(exampleCertificate.versionlessSecretId())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   exampleResourceGroup:
 *     type: azure:core:ResourceGroup
 *     name: example
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleService:
 *     type: azure:apimanagement:Service
 *     name: example
 *     properties:
 *       name: example-apim
 *       location: ${exampleResourceGroup.location}
 *       resourceGroupName: ${exampleResourceGroup.name}
 *       publisherName: pub1
 *       publisherEmail: [email protected]
 *       skuName: Developer_1
 *   exampleCertificate:
 *     type: azure:keyvault:Certificate
 *     name: example
 *     properties:
 *       name: example-certificate
 *       keyVaultId: ${example.id}
 *       certificatePolicy:
 *         issuerParameters:
 *           name: Self
 *         keyProperties:
 *           exportable: true
 *           keySize: 2048
 *           keyType: RSA
 *           reuseKey: true
 *         lifetimeActions:
 *           - action:
 *               actionType: AutoRenew
 *             trigger:
 *               daysBeforeExpiry: 30
 *         secretProperties:
 *           contentType: application/x-pkcs12
 *         x509CertificateProperties:
 *           keyUsages:
 *             - cRLSign
 *             - dataEncipherment
 *             - digitalSignature
 *             - keyAgreement
 *             - keyCertSign
 *             - keyEncipherment
 *           subject: CN=api.example.com
 *           validityInMonths: 12
 *           subjectAlternativeNames:
 *             dnsNames:
 *               - api.example.com
 *               - portal.example.com
 *   exampleCustomDomain:
 *     type: azure:apimanagement:CustomDomain
 *     name: example
 *     properties:
 *       apiManagementId: ${exampleService.id}
 *       gateways:
 *         - hostName: api.example.com
 *           keyVaultId: ${exampleCertificate.versionlessSecretId}
 *       developerPortals:
 *         - hostName: portal.example.com
 *           keyVaultId: ${exampleCertificate.versionlessSecretId}
 * variables:
 *   example:
 *     fn::invoke:
 *       Function: azure:keyvault:getKeyVault
 *       Arguments:
 *         name: mykeyvault
 *         resourceGroupName: some-resource-group
 * ```
 * 
 * ## Import
 * API Management Custom Domains can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:apimanagement/customDomain:CustomDomain example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/customDomains/default
 * ```
 */
public class CustomDomain internal constructor(
    override val javaResource: com.pulumi.azure.apimanagement.CustomDomain,
) : KotlinCustomResource(javaResource, CustomDomainMapper) {
    /**
     * The ID of the API Management service for which to configure Custom Domains. Changing this forces a new API Management Custom Domain resource to be created.
     */
    public val apiManagementId: Output
        get() = javaResource.apiManagementId().applyValue({ args0 -> args0 })

    /**
     * One or more `developer_portal` blocks as defined below.
     */
    public val developerPortals: Output>?
        get() = javaResource.developerPortals().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        customDomainDeveloperPortalToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * One or more `gateway` blocks as defined below.
     */
    public val gateways: Output>?
        get() = javaResource.gateways().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> customDomainGatewayToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * One or more `management` blocks as defined below.
     */
    public val managements: Output>?
        get() = javaResource.managements().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> customDomainManagementToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * One or more `portal` blocks as defined below.
     */
    public val portals: Output>?
        get() = javaResource.portals().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> customDomainPortalToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * One or more `scm` blocks as defined below.
     */
    public val scms: Output>?
        get() = javaResource.scms().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> customDomainScmToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object CustomDomainMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.apimanagement.CustomDomain::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy