Certificate

Manages an Certificate within an API Management Service.

Example Usage

With Base64 Certificate)

using System;
using System.Collections.Generic;
using System.IO;
using Pulumi;
using Azure = Pulumi.Azure;

	private static string ReadFileBase64(string path) {
		return Convert.ToBase64String(Encoding.UTF8.GetBytes(File.ReadAllText(path)))
	}

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleService = new Azure.ApiManagement.Service("exampleService", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        PublisherName = "My Company",
        PublisherEmail = "company@exmaple.com",
        SkuName = "Developer_1",
    });

    var exampleCertificate = new Azure.ApiManagement.Certificate("exampleCertificate", new()
    {
        ApiManagementName = exampleService.Name,
        ResourceGroupName = exampleResourceGroup.Name,
        Data = ReadFileBase64("example.pfx"),
    });

});
package main

import (
	"encoding/base64"
	"io/ioutil"

	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func filebase64OrPanic(path string) pulumi.StringPtrInput {
	if fileData, err := ioutil.ReadFile(path); err == nil {
		return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:]))
	} else {
		panic(err.Error())
	}
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			PublisherName:     pulumi.String("My Company"),
			PublisherEmail:    pulumi.String("company@exmaple.com"),
			SkuName:           pulumi.String("Developer_1"),
		})
		if err != nil {
			return err
		}
		_, err = apimanagement.NewCertificate(ctx, "exampleCertificate", &apimanagement.CertificateArgs{
			ApiManagementName: exampleService.Name,
			ResourceGroupName: exampleResourceGroup.Name,
			Data:              filebase64OrPanic("example.pfx"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleService = new Service("exampleService", ServiceArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .publisherName("My Company")
            .publisherEmail("company@exmaple.com")
            .skuName("Developer_1")
            .build());

        var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()        
            .apiManagementName(exampleService.name())
            .resourceGroupName(exampleResourceGroup.name())
            .data(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("example.pfx"))))
            .build());

    }
}
import pulumi
import base64
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_service = azure.apimanagement.Service("exampleService",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    publisher_name="My Company",
    publisher_email="company@exmaple.com",
    sku_name="Developer_1")
example_certificate = azure.apimanagement.Certificate("exampleCertificate",
    api_management_name=example_service.name,
    resource_group_name=example_resource_group.name,
    data=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.pfx"))
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as fs from "fs";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleService = new azure.apimanagement.Service("exampleService", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    publisherName: "My Company",
    publisherEmail: "company@exmaple.com",
    skuName: "Developer_1",
});
const exampleCertificate = new azure.apimanagement.Certificate("exampleCertificate", {
    apiManagementName: exampleService.name,
    resourceGroupName: exampleResourceGroup.name,
    data: Buffer.from(fs.readFileSync("example.pfx"), 'binary').toString('base64'),
});

Coming soon!

With Key Vault Certificate)

using System;
using System.Collections.Generic;
using System.IO;
using Pulumi;
using Azure = Pulumi.Azure;

	private static string ReadFileBase64(string path) {
		return Convert.ToBase64String(Encoding.UTF8.GetBytes(File.ReadAllText(path)))
	}

return await Deployment.RunAsync(() => 
{
    var current = Azure.Core.GetClientConfig.Invoke();

    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleService = new Azure.ApiManagement.Service("exampleService", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        PublisherName = "My Company",
        PublisherEmail = "company@terraform.io",
        SkuName = "Developer_1",
        Identity = new Azure.ApiManagement.Inputs.ServiceIdentityArgs
        {
            Type = "SystemAssigned",
        },
    });

    var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
        SkuName = "standard",
    });

    var exampleAccessPolicy = new Azure.KeyVault.AccessPolicy("exampleAccessPolicy", 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("exampleCertificate", new()
    {
        KeyVaultId = exampleKeyVault.Id,
        KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs
        {
            Contents = ReadFileBase64("example_cert.pfx"),
            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 exampleApimanagement_certificateCertificate = new Azure.ApiManagement.Certificate("exampleApimanagement/certificateCertificate", new()
    {
        ApiManagementName = exampleService.Name,
        ResourceGroupName = exampleResourceGroup.Name,
        KeyVaultSecretId = exampleCertificate.SecretId,
    });

});
package main

import (
	"encoding/base64"
	"io/ioutil"

	"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 filebase64OrPanic(path string) pulumi.StringPtrInput {
	if fileData, err := ioutil.ReadFile(path); err == nil {
		return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:]))
	} else {
		panic(err.Error())
	}
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := core.GetClientConfig(ctx, nil, nil)
		if err != nil {
			return err
		}
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			PublisherName:     pulumi.String("My Company"),
			PublisherEmail:    pulumi.String("company@terraform.io"),
			SkuName:           pulumi.String("Developer_1"),
			Identity: &apimanagement.ServiceIdentityArgs{
				Type: pulumi.String("SystemAssigned"),
			},
		})
		if err != nil {
			return err
		}
		exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			TenantId:          pulumi.String(current.TenantId),
			SkuName:           pulumi.String("standard"),
		})
		if err != nil {
			return err
		}
		_, err = keyvault.NewAccessPolicy(ctx, "exampleAccessPolicy", &keyvault.AccessPolicyArgs{
			KeyVaultId: exampleKeyVault.ID(),
			TenantId: exampleService.Identity.ApplyT(func(identity apimanagement.ServiceIdentity) (string, error) {
				return identity.TenantId, nil
			}).(pulumi.StringOutput),
			ObjectId: exampleService.Identity.ApplyT(func(identity apimanagement.ServiceIdentity) (string, error) {
				return identity.PrincipalId, nil
			}).(pulumi.StringOutput),
			SecretPermissions: pulumi.StringArray{
				pulumi.String("Get"),
			},
			CertificatePermissions: pulumi.StringArray{
				pulumi.String("Get"),
			},
		})
		if err != nil {
			return err
		}
		exampleCertificate, err := keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{
			KeyVaultId: exampleKeyVault.ID(),
			Certificate: &keyvault.CertificateCertificateArgs{
				Contents: filebase64OrPanic("example_cert.pfx"),
				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, "exampleApimanagement/certificateCertificate", &apimanagement.CertificateArgs{
			ApiManagementName: exampleService.Name,
			ResourceGroupName: exampleResourceGroup.Name,
			KeyVaultSecretId:  exampleCertificate.SecretId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleService = new Service("exampleService", ServiceArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .publisherName("My Company")
            .publisherEmail("company@terraform.io")
            .skuName("Developer_1")
            .identity(ServiceIdentityArgs.builder()
                .type("SystemAssigned")
                .build())
            .build());

        var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.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()        
            .keyVaultId(exampleKeyVault.id())
            .certificate(CertificateCertificateArgs.builder()
                .contents(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("example_cert.pfx"))))
                .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 exampleApimanagement_certificateCertificate = new Certificate("exampleApimanagement/certificateCertificate", CertificateArgs.builder()        
            .apiManagementName(exampleService.name())
            .resourceGroupName(exampleResourceGroup.name())
            .keyVaultSecretId(exampleCertificate.secretId())
            .build());

    }
}
import pulumi
import base64
import pulumi_azure as azure

current = azure.core.get_client_config()
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_service = azure.apimanagement.Service("exampleService",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    publisher_name="My Company",
    publisher_email="company@terraform.io",
    sku_name="Developer_1",
    identity=azure.apimanagement.ServiceIdentityArgs(
        type="SystemAssigned",
    ))
example_key_vault = azure.keyvault.KeyVault("exampleKeyVault",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    tenant_id=current.tenant_id,
    sku_name="standard")
example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy",
    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("exampleCertificate",
    key_vault_id=example_key_vault.id,
    certificate=azure.keyvault.CertificateCertificateArgs(
        contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example_cert.pfx"),
        password="terraform",
    ),
    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=False,
        ),
        secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs(
            content_type="application/x-pkcs12",
        ),
    ))
example_apimanagement_certificate_certificate = azure.apimanagement.Certificate("exampleApimanagement/certificateCertificate",
    api_management_name=example_service.name,
    resource_group_name=example_resource_group.name,
    key_vault_secret_id=example_certificate.secret_id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as fs from "fs";

const current = azure.core.getClientConfig({});
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleService = new azure.apimanagement.Service("exampleService", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    publisherName: "My Company",
    publisherEmail: "company@terraform.io",
    skuName: "Developer_1",
    identity: {
        type: "SystemAssigned",
    },
});
const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    tenantId: current.then(current => current.tenantId),
    skuName: "standard",
});
const exampleAccessPolicy = new azure.keyvault.AccessPolicy("exampleAccessPolicy", {
    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("exampleCertificate", {
    keyVaultId: exampleKeyVault.id,
    certificate: {
        contents: Buffer.from(fs.readFileSync("example_cert.pfx"), 'binary').toString('base64'),
        password: "terraform",
    },
    certificatePolicy: {
        issuerParameters: {
            name: "Self",
        },
        keyProperties: {
            exportable: true,
            keySize: 2048,
            keyType: "RSA",
            reuseKey: false,
        },
        secretProperties: {
            contentType: "application/x-pkcs12",
        },
    },
});
const exampleApimanagement_certificateCertificate = new azure.apimanagement.Certificate("exampleApimanagement/certificateCertificate", {
    apiManagementName: exampleService.name,
    resourceGroupName: exampleResourceGroup.name,
    keyVaultSecretId: exampleCertificate.secretId,
});

Coming soon!

Create Certificate Resource

new Certificate(name: string, args: CertificateArgs, opts?: CustomResourceOptions);
@overload
def Certificate(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                api_management_name: Optional[str] = None,
                data: Optional[str] = None,
                key_vault_identity_client_id: Optional[str] = None,
                key_vault_secret_id: Optional[str] = None,
                name: Optional[str] = None,
                password: Optional[str] = None,
                resource_group_name: Optional[str] = None)
@overload
def Certificate(resource_name: str,
                args: CertificateArgs,
                opts: Optional[ResourceOptions] = None)
func NewCertificate(ctx *Context, name string, args CertificateArgs, opts ...ResourceOption) (*Certificate, error)
public Certificate(string name, CertificateArgs args, CustomResourceOptions? opts = null)
public Certificate(String name, CertificateArgs args)
public Certificate(String name, CertificateArgs args, CustomResourceOptions options)
type: azure:apimanagement:Certificate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CertificateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args CertificateArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CertificateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CertificateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CertificateArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Certificate Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Certificate resource accepts the following input properties:

ApiManagementName string

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

ResourceGroupName string

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

Data string

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

KeyVaultIdentityClientId string

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

KeyVaultSecretId string

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

Name string

The name of the API Management Certificate. Changing this forces a new resource to be created.

Password string

The password used for this certificate. Changing this forces a new resource to be created.

ApiManagementName string

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

ResourceGroupName string

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

Data string

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

KeyVaultIdentityClientId string

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

KeyVaultSecretId string

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

Name string

The name of the API Management Certificate. Changing this forces a new resource to be created.

Password string

The password used for this certificate. Changing this forces a new resource to be created.

apiManagementName String

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

resourceGroupName String

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

data String

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

keyVaultIdentityClientId String

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

keyVaultSecretId String

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

name String

The name of the API Management Certificate. Changing this forces a new resource to be created.

password String

The password used for this certificate. Changing this forces a new resource to be created.

apiManagementName string

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

resourceGroupName string

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

data string

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

keyVaultIdentityClientId string

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

keyVaultSecretId string

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

name string

The name of the API Management Certificate. Changing this forces a new resource to be created.

password string

The password used for this certificate. Changing this forces a new resource to be created.

api_management_name str

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

resource_group_name str

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

data str

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

key_vault_identity_client_id str

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

key_vault_secret_id str

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

name str

The name of the API Management Certificate. Changing this forces a new resource to be created.

password str

The password used for this certificate. Changing this forces a new resource to be created.

apiManagementName String

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

resourceGroupName String

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

data String

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

keyVaultIdentityClientId String

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

keyVaultSecretId String

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

name String

The name of the API Management Certificate. Changing this forces a new resource to be created.

password String

The password used for this certificate. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the Certificate resource produces the following output properties:

Expiration string

The Expiration Date of this Certificate, formatted as an RFC3339 string.

Id string

The provider-assigned unique ID for this managed resource.

Subject string

The Subject of this Certificate.

Thumbprint string

The Thumbprint of this Certificate.

Expiration string

The Expiration Date of this Certificate, formatted as an RFC3339 string.

Id string

The provider-assigned unique ID for this managed resource.

Subject string

The Subject of this Certificate.

Thumbprint string

The Thumbprint of this Certificate.

expiration String

The Expiration Date of this Certificate, formatted as an RFC3339 string.

id String

The provider-assigned unique ID for this managed resource.

subject String

The Subject of this Certificate.

thumbprint String

The Thumbprint of this Certificate.

expiration string

The Expiration Date of this Certificate, formatted as an RFC3339 string.

id string

The provider-assigned unique ID for this managed resource.

subject string

The Subject of this Certificate.

thumbprint string

The Thumbprint of this Certificate.

expiration str

The Expiration Date of this Certificate, formatted as an RFC3339 string.

id str

The provider-assigned unique ID for this managed resource.

subject str

The Subject of this Certificate.

thumbprint str

The Thumbprint of this Certificate.

expiration String

The Expiration Date of this Certificate, formatted as an RFC3339 string.

id String

The provider-assigned unique ID for this managed resource.

subject String

The Subject of this Certificate.

thumbprint String

The Thumbprint of this Certificate.

Look up Existing Certificate Resource

Get an existing Certificate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: CertificateState, opts?: CustomResourceOptions): Certificate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_management_name: Optional[str] = None,
        data: Optional[str] = None,
        expiration: Optional[str] = None,
        key_vault_identity_client_id: Optional[str] = None,
        key_vault_secret_id: Optional[str] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        subject: Optional[str] = None,
        thumbprint: Optional[str] = None) -> Certificate
func GetCertificate(ctx *Context, name string, id IDInput, state *CertificateState, opts ...ResourceOption) (*Certificate, error)
public static Certificate Get(string name, Input<string> id, CertificateState? state, CustomResourceOptions? opts = null)
public static Certificate get(String name, Output<String> id, CertificateState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ApiManagementName string

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

Data string

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

Expiration string

The Expiration Date of this Certificate, formatted as an RFC3339 string.

KeyVaultIdentityClientId string

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

KeyVaultSecretId string

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

Name string

The name of the API Management Certificate. Changing this forces a new resource to be created.

Password string

The password used for this certificate. Changing this forces a new resource to be created.

ResourceGroupName string

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

Subject string

The Subject of this Certificate.

Thumbprint string

The Thumbprint of this Certificate.

ApiManagementName string

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

Data string

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

Expiration string

The Expiration Date of this Certificate, formatted as an RFC3339 string.

KeyVaultIdentityClientId string

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

KeyVaultSecretId string

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

Name string

The name of the API Management Certificate. Changing this forces a new resource to be created.

Password string

The password used for this certificate. Changing this forces a new resource to be created.

ResourceGroupName string

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

Subject string

The Subject of this Certificate.

Thumbprint string

The Thumbprint of this Certificate.

apiManagementName String

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

data String

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

expiration String

The Expiration Date of this Certificate, formatted as an RFC3339 string.

keyVaultIdentityClientId String

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

keyVaultSecretId String

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

name String

The name of the API Management Certificate. Changing this forces a new resource to be created.

password String

The password used for this certificate. Changing this forces a new resource to be created.

resourceGroupName String

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

subject String

The Subject of this Certificate.

thumbprint String

The Thumbprint of this Certificate.

apiManagementName string

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

data string

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

expiration string

The Expiration Date of this Certificate, formatted as an RFC3339 string.

keyVaultIdentityClientId string

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

keyVaultSecretId string

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

name string

The name of the API Management Certificate. Changing this forces a new resource to be created.

password string

The password used for this certificate. Changing this forces a new resource to be created.

resourceGroupName string

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

subject string

The Subject of this Certificate.

thumbprint string

The Thumbprint of this Certificate.

api_management_name str

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

data str

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

expiration str

The Expiration Date of this Certificate, formatted as an RFC3339 string.

key_vault_identity_client_id str

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

key_vault_secret_id str

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

name str

The name of the API Management Certificate. Changing this forces a new resource to be created.

password str

The password used for this certificate. Changing this forces a new resource to be created.

resource_group_name str

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

subject str

The Subject of this Certificate.

thumbprint str

The Thumbprint of this Certificate.

apiManagementName String

The Name of the API Management Service where this Service should be created. Changing this forces a new resource to be created.

data String

The base-64 encoded certificate data, which must be a PFX file. Changing this forces a new resource to be created.

expiration String

The Expiration Date of this Certificate, formatted as an RFC3339 string.

keyVaultIdentityClientId String

The Client ID of the User Assigned Managed Identity to use for retrieving certificate.

keyVaultSecretId String

The ID of the Key Vault Secret containing the SSL Certificate, which must be of the type application/x-pkcs12.

name String

The name of the API Management Certificate. Changing this forces a new resource to be created.

password String

The password used for this certificate. Changing this forces a new resource to be created.

resourceGroupName String

The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

subject String

The Subject of this Certificate.

thumbprint String

The Thumbprint of this Certificate.

Import

API Management Certificates can be imported using the resource id, e.g.

 $ pulumi import azure:apimanagement/certificate:Certificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/certificates/certificate1

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.