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

com.pulumi.azure.apimanagement.kotlin.CertificateArgs.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.CertificateArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages an Certificate within an API Management Service.
 * ## Example Usage
 * ### With Base64 Certificate)
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleService = new azure.apimanagement.Service("example", {
 *     name: "example-apim",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     publisherName: "My Company",
 *     publisherEmail: "[email protected]",
 *     skuName: "Developer_1",
 * });
 * const exampleCertificate = new azure.apimanagement.Certificate("example", {
 *     name: "example-cert",
 *     apiManagementName: exampleService.name,
 *     resourceGroupName: example.name,
 *     data: std.filebase64({
 *         input: "example.pfx",
 *     }).then(invoke => invoke.result),
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_std as std
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_service = azure.apimanagement.Service("example",
 *     name="example-apim",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     publisher_name="My Company",
 *     publisher_email="[email protected]",
 *     sku_name="Developer_1")
 * example_certificate = azure.apimanagement.Certificate("example",
 *     name="example-cert",
 *     api_management_name=example_service.name,
 *     resource_group_name=example.name,
 *     data=std.filebase64(input="example.pfx").result)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleService = new Azure.ApiManagement.Service("example", new()
 *     {
 *         Name = "example-apim",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         PublisherName = "My Company",
 *         PublisherEmail = "[email protected]",
 *         SkuName = "Developer_1",
 *     });
 *     var exampleCertificate = new Azure.ApiManagement.Certificate("example", new()
 *     {
 *         Name = "example-cert",
 *         ApiManagementName = exampleService.Name,
 *         ResourceGroupName = example.Name,
 *         Data = Std.Filebase64.Invoke(new()
 *         {
 *             Input = "example.pfx",
 *         }).Apply(invoke => invoke.Result),
 *     });
 * });
 * ```
 * ```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-std/sdk/go/std"
 * 	"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
 * 		}
 * 		exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
 * 			Name:              pulumi.String("example-apim"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			PublisherName:     pulumi.String("My Company"),
 * 			PublisherEmail:    pulumi.String("[email protected]"),
 * 			SkuName:           pulumi.String("Developer_1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
 * 			Input: "example.pfx",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = apimanagement.NewCertificate(ctx, "example", &apimanagement.CertificateArgs{
 * 			Name:              pulumi.String("example-cert"),
 * 			ApiManagementName: exampleService.Name,
 * 			ResourceGroupName: example.Name,
 * 			Data:              pulumi.String(invokeFilebase64.Result),
 * 		})
 * 		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.apimanagement.Service;
 * import com.pulumi.azure.apimanagement.ServiceArgs;
 * import com.pulumi.azure.apimanagement.Certificate;
 * import com.pulumi.azure.apimanagement.CertificateArgs;
 * 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 exampleService = new Service("exampleService", ServiceArgs.builder()
 *             .name("example-apim")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .publisherName("My Company")
 *             .publisherEmail("[email protected]")
 *             .skuName("Developer_1")
 *             .build());
 *         var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
 *             .name("example-cert")
 *             .apiManagementName(exampleService.name())
 *             .resourceGroupName(example.name())
 *             .data(StdFunctions.filebase64(Filebase64Args.builder()
 *                 .input("example.pfx")
 *                 .build()).result())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleService:
 *     type: azure:apimanagement:Service
 *     name: example
 *     properties:
 *       name: example-apim
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       publisherName: My Company
 *       publisherEmail: [email protected]
 *       skuName: Developer_1
 *   exampleCertificate:
 *     type: azure:apimanagement:Certificate
 *     name: example
 *     properties:
 *       name: example-cert
 *       apiManagementName: ${exampleService.name}
 *       resourceGroupName: ${example.name}
 *       data:
 *         fn::invoke:
 *           Function: std:filebase64
 *           Arguments:
 *             input: example.pfx
 *           Return: result
 * ```
 * 
 * ### With Key Vault Certificate)
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 * const current = azure.core.getClientConfig({});
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleService = new azure.apimanagement.Service("example", {
 *     name: "example-apim",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     publisherName: "My Company",
 *     publisherEmail: "[email protected]",
 *     skuName: "Developer_1",
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * const exampleKeyVault = new azure.keyvault.KeyVault("example", {
 *     name: "examplekeyvault",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     tenantId: current.then(current => current.tenantId),
 *     skuName: "standard",
 * });
 * const exampleAccessPolicy = new azure.keyvault.AccessPolicy("example", {
 *     keyVaultId: exampleKeyVault.id,
 *     tenantId: exampleService.identity.apply(identity => identity?.tenantId),
 *     objectId: exampleService.identity.apply(identity => identity?.principalId),
 *     secretPermissions: ["Get"],
 *     certificatePermissions: ["Get"],
 * });
 * const exampleCertificate = new azure.keyvault.Certificate("example", {
 *     name: "example-cert",
 *     keyVaultId: exampleKeyVault.id,
 *     certificate: {
 *         contents: std.filebase64({
 *             input: "example_cert.pfx",
 *         }).then(invoke => invoke.result),
 *         password: "terraform",
 *     },
 *     certificatePolicy: {
 *         issuerParameters: {
 *             name: "Self",
 *         },
 *         keyProperties: {
 *             exportable: true,
 *             keySize: 2048,
 *             keyType: "RSA",
 *             reuseKey: false,
 *         },
 *         secretProperties: {
 *             contentType: "application/x-pkcs12",
 *         },
 *     },
 * });
 * const exampleCertificate2 = new azure.apimanagement.Certificate("example", {
 *     name: "example-cert",
 *     apiManagementName: exampleService.name,
 *     resourceGroupName: example.name,
 *     keyVaultSecretId: exampleCertificate.secretId,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_std as std
 * current = azure.core.get_client_config()
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_service = azure.apimanagement.Service("example",
 *     name="example-apim",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     publisher_name="My Company",
 *     publisher_email="[email protected]",
 *     sku_name="Developer_1",
 *     identity={
 *         "type": "SystemAssigned",
 *     })
 * example_key_vault = azure.keyvault.KeyVault("example",
 *     name="examplekeyvault",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     tenant_id=current.tenant_id,
 *     sku_name="standard")
 * example_access_policy = azure.keyvault.AccessPolicy("example",
 *     key_vault_id=example_key_vault.id,
 *     tenant_id=example_service.identity.tenant_id,
 *     object_id=example_service.identity.principal_id,
 *     secret_permissions=["Get"],
 *     certificate_permissions=["Get"])
 * example_certificate = azure.keyvault.Certificate("example",
 *     name="example-cert",
 *     key_vault_id=example_key_vault.id,
 *     certificate={
 *         "contents": std.filebase64(input="example_cert.pfx").result,
 *         "password": "terraform",
 *     },
 *     certificate_policy={
 *         "issuer_parameters": {
 *             "name": "Self",
 *         },
 *         "key_properties": {
 *             "exportable": True,
 *             "key_size": 2048,
 *             "key_type": "RSA",
 *             "reuse_key": False,
 *         },
 *         "secret_properties": {
 *             "content_type": "application/x-pkcs12",
 *         },
 *     })
 * example_certificate2 = azure.apimanagement.Certificate("example",
 *     name="example-cert",
 *     api_management_name=example_service.name,
 *     resource_group_name=example.name,
 *     key_vault_secret_id=example_certificate.secret_id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var current = Azure.Core.GetClientConfig.Invoke();
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleService = new Azure.ApiManagement.Service("example", new()
 *     {
 *         Name = "example-apim",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         PublisherName = "My Company",
 *         PublisherEmail = "[email protected]",
 *         SkuName = "Developer_1",
 *         Identity = new Azure.ApiManagement.Inputs.ServiceIdentityArgs
 *         {
 *             Type = "SystemAssigned",
 *         },
 *     });
 *     var exampleKeyVault = new Azure.KeyVault.KeyVault("example", new()
 *     {
 *         Name = "examplekeyvault",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
 *         SkuName = "standard",
 *     });
 *     var exampleAccessPolicy = new Azure.KeyVault.AccessPolicy("example", new()
 *     {
 *         KeyVaultId = exampleKeyVault.Id,
 *         TenantId = exampleService.Identity.Apply(identity => identity?.TenantId),
 *         ObjectId = exampleService.Identity.Apply(identity => identity?.PrincipalId),
 *         SecretPermissions = new[]
 *         {
 *             "Get",
 *         },
 *         CertificatePermissions = new[]
 *         {
 *             "Get",
 *         },
 *     });
 *     var exampleCertificate = new Azure.KeyVault.Certificate("example", new()
 *     {
 *         Name = "example-cert",
 *         KeyVaultId = exampleKeyVault.Id,
 *         KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs
 *         {
 *             Contents = Std.Filebase64.Invoke(new()
 *             {
 *                 Input = "example_cert.pfx",
 *             }).Apply(invoke => invoke.Result),
 *             Password = "terraform",
 *         },
 *         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 = false,
 *             },
 *             SecretProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicySecretPropertiesArgs
 *             {
 *                 ContentType = "application/x-pkcs12",
 *             },
 *         },
 *     });
 *     var exampleCertificate2 = new Azure.ApiManagement.Certificate("example", new()
 *     {
 *         Name = "example-cert",
 *         ApiManagementName = exampleService.Name,
 *         ResourceGroupName = example.Name,
 *         KeyVaultSecretId = exampleCertificate.SecretId,
 *     });
 * });
 * ```
 * ```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-std/sdk/go/std"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		current, err := core.GetClientConfig(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
 * 			Name:              pulumi.String("example-apim"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			PublisherName:     pulumi.String("My Company"),
 * 			PublisherEmail:    pulumi.String("[email protected]"),
 * 			SkuName:           pulumi.String("Developer_1"),
 * 			Identity: &apimanagement.ServiceIdentityArgs{
 * 				Type: pulumi.String("SystemAssigned"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleKeyVault, err := keyvault.NewKeyVault(ctx, "example", &keyvault.KeyVaultArgs{
 * 			Name:              pulumi.String("examplekeyvault"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			TenantId:          pulumi.String(current.TenantId),
 * 			SkuName:           pulumi.String("standard"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = keyvault.NewAccessPolicy(ctx, "example", &keyvault.AccessPolicyArgs{
 * 			KeyVaultId: exampleKeyVault.ID(),
 * 			TenantId: pulumi.String(exampleService.Identity.ApplyT(func(identity apimanagement.ServiceIdentity) (*string, error) {
 * 				return &identity.TenantId, nil
 * 			}).(pulumi.StringPtrOutput)),
 * 			ObjectId: pulumi.String(exampleService.Identity.ApplyT(func(identity apimanagement.ServiceIdentity) (*string, error) {
 * 				return &identity.PrincipalId, nil
 * 			}).(pulumi.StringPtrOutput)),
 * 			SecretPermissions: pulumi.StringArray{
 * 				pulumi.String("Get"),
 * 			},
 * 			CertificatePermissions: pulumi.StringArray{
 * 				pulumi.String("Get"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
 * 			Input: "example_cert.pfx",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleCertificate, err := keyvault.NewCertificate(ctx, "example", &keyvault.CertificateArgs{
 * 			Name:       pulumi.String("example-cert"),
 * 			KeyVaultId: exampleKeyVault.ID(),
 * 			Certificate: &keyvault.CertificateCertificateArgs{
 * 				Contents: pulumi.String(invokeFilebase64.Result),
 * 				Password: pulumi.String("terraform"),
 * 			},
 * 			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(false),
 * 				},
 * 				SecretProperties: &keyvault.CertificateCertificatePolicySecretPropertiesArgs{
 * 					ContentType: pulumi.String("application/x-pkcs12"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = apimanagement.NewCertificate(ctx, "example", &apimanagement.CertificateArgs{
 * 			Name:              pulumi.String("example-cert"),
 * 			ApiManagementName: exampleService.Name,
 * 			ResourceGroupName: example.Name,
 * 			KeyVaultSecretId:  exampleCertificate.SecretId,
 * 		})
 * 		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.CoreFunctions;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.apimanagement.Service;
 * import com.pulumi.azure.apimanagement.ServiceArgs;
 * import com.pulumi.azure.apimanagement.inputs.ServiceIdentityArgs;
 * import com.pulumi.azure.keyvault.KeyVault;
 * import com.pulumi.azure.keyvault.KeyVaultArgs;
 * import com.pulumi.azure.keyvault.AccessPolicy;
 * import com.pulumi.azure.keyvault.AccessPolicyArgs;
 * import com.pulumi.azure.keyvault.Certificate;
 * import com.pulumi.azure.keyvault.CertificateArgs;
 * import com.pulumi.azure.keyvault.inputs.CertificateCertificateArgs;
 * 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.apimanagement.Certificate;
 * import com.pulumi.azure.apimanagement.CertificateArgs;
 * 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) {
 *         final var current = CoreFunctions.getClientConfig();
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleService = new Service("exampleService", ServiceArgs.builder()
 *             .name("example-apim")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .publisherName("My Company")
 *             .publisherEmail("[email protected]")
 *             .skuName("Developer_1")
 *             .identity(ServiceIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 *         var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
 *             .name("examplekeyvault")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *             .skuName("standard")
 *             .build());
 *         var exampleAccessPolicy = new AccessPolicy("exampleAccessPolicy", AccessPolicyArgs.builder()
 *             .keyVaultId(exampleKeyVault.id())
 *             .tenantId(exampleService.identity().applyValue(identity -> identity.tenantId()))
 *             .objectId(exampleService.identity().applyValue(identity -> identity.principalId()))
 *             .secretPermissions("Get")
 *             .certificatePermissions("Get")
 *             .build());
 *         var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
 *             .name("example-cert")
 *             .keyVaultId(exampleKeyVault.id())
 *             .certificate(CertificateCertificateArgs.builder()
 *                 .contents(StdFunctions.filebase64(Filebase64Args.builder()
 *                     .input("example_cert.pfx")
 *                     .build()).result())
 *                 .password("terraform")
 *                 .build())
 *             .certificatePolicy(CertificateCertificatePolicyArgs.builder()
 *                 .issuerParameters(CertificateCertificatePolicyIssuerParametersArgs.builder()
 *                     .name("Self")
 *                     .build())
 *                 .keyProperties(CertificateCertificatePolicyKeyPropertiesArgs.builder()
 *                     .exportable(true)
 *                     .keySize(2048)
 *                     .keyType("RSA")
 *                     .reuseKey(false)
 *                     .build())
 *                 .secretProperties(CertificateCertificatePolicySecretPropertiesArgs.builder()
 *                     .contentType("application/x-pkcs12")
 *                     .build())
 *                 .build())
 *             .build());
 *         var exampleCertificate2 = new Certificate("exampleCertificate2", CertificateArgs.builder()
 *             .name("example-cert")
 *             .apiManagementName(exampleService.name())
 *             .resourceGroupName(example.name())
 *             .keyVaultSecretId(exampleCertificate.secretId())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleService:
 *     type: azure:apimanagement:Service
 *     name: example
 *     properties:
 *       name: example-apim
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       publisherName: My Company
 *       publisherEmail: [email protected]
 *       skuName: Developer_1
 *       identity:
 *         type: SystemAssigned
 *   exampleKeyVault:
 *     type: azure:keyvault:KeyVault
 *     name: example
 *     properties:
 *       name: examplekeyvault
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       tenantId: ${current.tenantId}
 *       skuName: standard
 *   exampleAccessPolicy:
 *     type: azure:keyvault:AccessPolicy
 *     name: example
 *     properties:
 *       keyVaultId: ${exampleKeyVault.id}
 *       tenantId: ${exampleService.identity.tenantId}
 *       objectId: ${exampleService.identity.principalId}
 *       secretPermissions:
 *         - Get
 *       certificatePermissions:
 *         - Get
 *   exampleCertificate:
 *     type: azure:keyvault:Certificate
 *     name: example
 *     properties:
 *       name: example-cert
 *       keyVaultId: ${exampleKeyVault.id}
 *       certificate:
 *         contents:
 *           fn::invoke:
 *             Function: std:filebase64
 *             Arguments:
 *               input: example_cert.pfx
 *             Return: result
 *         password: terraform
 *       certificatePolicy:
 *         issuerParameters:
 *           name: Self
 *         keyProperties:
 *           exportable: true
 *           keySize: 2048
 *           keyType: RSA
 *           reuseKey: false
 *         secretProperties:
 *           contentType: application/x-pkcs12
 *   exampleCertificate2:
 *     type: azure:apimanagement:Certificate
 *     name: example
 *     properties:
 *       name: example-cert
 *       apiManagementName: ${exampleService.name}
 *       resourceGroupName: ${example.name}
 *       keyVaultSecretId: ${exampleCertificate.secretId}
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getClientConfig
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * API Management Certificates can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:apimanagement/certificate:Certificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/certificates/certificate1
 * ```
 * @property apiManagementName The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
 * @property data The base-64 encoded certificate data, which must be a PFX file.
 * @property keyVaultIdentityClientId The Client ID of the User Assigned Managed Identity to use for retrieving certificate.
 * > **NOTE:** If not specified, will use System Assigned identity of the API Management Service.
 * @property keyVaultSecretId The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type `application/x-pkcs12`.
 * > **NOTE:** Setting this field requires the `identity` block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.
 * @property name The name of the API Management Certificate. Changing this forces a new resource to be created.
 * @property password The password used for this certificate.
 * @property resourceGroupName The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
 * > **NOTE:** Either `data` or `key_vault_secret_id` must be specified - but not both.
 */
public data class CertificateArgs(
    public val apiManagementName: Output? = null,
    public val `data`: Output? = null,
    public val keyVaultIdentityClientId: Output? = null,
    public val keyVaultSecretId: Output? = null,
    public val name: Output? = null,
    public val password: Output? = null,
    public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.apimanagement.CertificateArgs =
        com.pulumi.azure.apimanagement.CertificateArgs.builder()
            .apiManagementName(apiManagementName?.applyValue({ args0 -> args0 }))
            .`data`(`data`?.applyValue({ args0 -> args0 }))
            .keyVaultIdentityClientId(keyVaultIdentityClientId?.applyValue({ args0 -> args0 }))
            .keyVaultSecretId(keyVaultSecretId?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .password(password?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [CertificateArgs].
 */
@PulumiTagMarker
public class CertificateArgsBuilder internal constructor() {
    private var apiManagementName: Output? = null

    private var `data`: Output? = null

    private var keyVaultIdentityClientId: Output? = null

    private var keyVaultSecretId: Output? = null

    private var name: Output? = null

    private var password: Output? = null

    private var resourceGroupName: Output? = null

    /**
     * @param value The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
     */
    @JvmName("evliryyvalwmtcrg")
    public suspend fun apiManagementName(`value`: Output) {
        this.apiManagementName = value
    }

    /**
     * @param value The base-64 encoded certificate data, which must be a PFX file.
     */
    @JvmName("cpunlodboqumashh")
    public suspend fun `data`(`value`: Output) {
        this.`data` = value
    }

    /**
     * @param value The Client ID of the User Assigned Managed Identity to use for retrieving certificate.
     * > **NOTE:** If not specified, will use System Assigned identity of the API Management Service.
     */
    @JvmName("xpcnhiwusxntryfm")
    public suspend fun keyVaultIdentityClientId(`value`: Output) {
        this.keyVaultIdentityClientId = value
    }

    /**
     * @param value The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type `application/x-pkcs12`.
     * > **NOTE:** Setting this field requires the `identity` block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.
     */
    @JvmName("krgymodopgjxjisc")
    public suspend fun keyVaultSecretId(`value`: Output) {
        this.keyVaultSecretId = value
    }

    /**
     * @param value The name of the API Management Certificate. Changing this forces a new resource to be created.
     */
    @JvmName("topmpxgnkriptcxb")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The password used for this certificate.
     */
    @JvmName("lpmsqpuaxmjncsbd")
    public suspend fun password(`value`: Output) {
        this.password = value
    }

    /**
     * @param value The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
     * > **NOTE:** Either `data` or `key_vault_secret_id` must be specified - but not both.
     */
    @JvmName("lbrtfmlhnavrudjp")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.
     */
    @JvmName("twysxkwkopwfiebf")
    public suspend fun apiManagementName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiManagementName = mapped
    }

    /**
     * @param value The base-64 encoded certificate data, which must be a PFX file.
     */
    @JvmName("qftyxeoubhibyjjy")
    public suspend fun `data`(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.`data` = mapped
    }

    /**
     * @param value The Client ID of the User Assigned Managed Identity to use for retrieving certificate.
     * > **NOTE:** If not specified, will use System Assigned identity of the API Management Service.
     */
    @JvmName("dpmfhayjgjdmywkt")
    public suspend fun keyVaultIdentityClientId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.keyVaultIdentityClientId = mapped
    }

    /**
     * @param value The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type `application/x-pkcs12`.
     * > **NOTE:** Setting this field requires the `identity` block to be specified in API Management Service, since this identity is used to retrieve the Key Vault Certificate. Possible values are versioned or versionless secret ID. Auto-updating the Certificate from the Key Vault requires that Secret version isn't specified.
     */
    @JvmName("ajgmvscstgklrmnl")
    public suspend fun keyVaultSecretId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.keyVaultSecretId = mapped
    }

    /**
     * @param value The name of the API Management Certificate. Changing this forces a new resource to be created.
     */
    @JvmName("fjcbutvbnpbpmjhp")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The password used for this certificate.
     */
    @JvmName("tluffcmgxaihxtiw")
    public suspend fun password(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.password = mapped
    }

    /**
     * @param value The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
     * > **NOTE:** Either `data` or `key_vault_secret_id` must be specified - but not both.
     */
    @JvmName("hgxbhiyttxjtuyig")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    internal fun build(): CertificateArgs = CertificateArgs(
        apiManagementName = apiManagementName,
        `data` = `data`,
        keyVaultIdentityClientId = keyVaultIdentityClientId,
        keyVaultSecretId = keyVaultSecretId,
        name = name,
        password = password,
        resourceGroupName = resourceGroupName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy