Azure Classic

v5.25.0 published on Thursday, Nov 24, 2022 by Pulumi

Certificate

Manages a Certificate for an NGinx Deployment.

Example Usage

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

return await Deployment.RunAsync(() => 
{
    var test = new Azure.Nginx.Certificate("test", new()
    {
        NginxDeploymentId = azurerm_nginx_deployment.Test.Id,
        KeyVirtualPath = "/src/cert/soservermekey.key",
        CertificateVirtualPath = "/src/cert/server.cert",
        KeyVaultSecretId = azurerm_key_vault_secret.Test.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/nginx"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := nginx.NewCertificate(ctx, "test", &nginx.CertificateArgs{
			NginxDeploymentId:      pulumi.Any(azurerm_nginx_deployment.Test.Id),
			KeyVirtualPath:         pulumi.String("/src/cert/soservermekey.key"),
			CertificateVirtualPath: pulumi.String("/src/cert/server.cert"),
			KeyVaultSecretId:       pulumi.Any(azurerm_key_vault_secret.Test.Id),
		})
		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.nginx.Certificate;
import com.pulumi.azure.nginx.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 test = new Certificate("test", CertificateArgs.builder()        
            .nginxDeploymentId(azurerm_nginx_deployment.test().id())
            .keyVirtualPath("/src/cert/soservermekey.key")
            .certificateVirtualPath("/src/cert/server.cert")
            .keyVaultSecretId(azurerm_key_vault_secret.test().id())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

test = azure.nginx.Certificate("test",
    nginx_deployment_id=azurerm_nginx_deployment["test"]["id"],
    key_virtual_path="/src/cert/soservermekey.key",
    certificate_virtual_path="/src/cert/server.cert",
    key_vault_secret_id=azurerm_key_vault_secret["test"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const test = new azure.nginx.Certificate("test", {
    nginxDeploymentId: azurerm_nginx_deployment.test.id,
    keyVirtualPath: "/src/cert/soservermekey.key",
    certificateVirtualPath: "/src/cert/server.cert",
    keyVaultSecretId: azurerm_key_vault_secret.test.id,
});
resources:
  test:
    type: azure:nginx:Certificate
    properties:
      nginxDeploymentId: ${azurerm_nginx_deployment.test.id}
      keyVirtualPath: /src/cert/soservermekey.key
      certificateVirtualPath: /src/cert/server.cert
      keyVaultSecretId: ${azurerm_key_vault_secret.test.id}

Create Certificate Resource

new Certificate(name: string, args: CertificateArgs, opts?: CustomResourceOptions);
@overload
def Certificate(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                certificate_virtual_path: Optional[str] = None,
                key_vault_secret_id: Optional[str] = None,
                key_virtual_path: Optional[str] = None,
                name: Optional[str] = None,
                nginx_deployment_id: 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:nginx: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:

CertificateVirtualPath string

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

KeyVaultSecretId string

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

KeyVirtualPath string

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

NginxDeploymentId string

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

Name string

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

CertificateVirtualPath string

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

KeyVaultSecretId string

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

KeyVirtualPath string

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

NginxDeploymentId string

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

Name string

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

certificateVirtualPath String

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

keyVaultSecretId String

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

keyVirtualPath String

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

nginxDeploymentId String

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

name String

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

certificateVirtualPath string

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

keyVaultSecretId string

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

keyVirtualPath string

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

nginxDeploymentId string

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

name string

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

certificate_virtual_path str

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

key_vault_secret_id str

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

key_virtual_path str

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

nginx_deployment_id str

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

name str

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

certificateVirtualPath String

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

keyVaultSecretId String

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

keyVirtualPath String

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

nginxDeploymentId String

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

name String

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

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,
        certificate_virtual_path: Optional[str] = None,
        key_vault_secret_id: Optional[str] = None,
        key_virtual_path: Optional[str] = None,
        name: Optional[str] = None,
        nginx_deployment_id: 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:
CertificateVirtualPath string

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

KeyVaultSecretId string

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

KeyVirtualPath string

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

Name string

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

NginxDeploymentId string

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

CertificateVirtualPath string

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

KeyVaultSecretId string

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

KeyVirtualPath string

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

Name string

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

NginxDeploymentId string

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

certificateVirtualPath String

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

keyVaultSecretId String

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

keyVirtualPath String

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

name String

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

nginxDeploymentId String

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

certificateVirtualPath string

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

keyVaultSecretId string

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

keyVirtualPath string

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

name string

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

nginxDeploymentId string

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

certificate_virtual_path str

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

key_vault_secret_id str

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

key_virtual_path str

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

name str

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

nginx_deployment_id str

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

certificateVirtualPath String

Specify the path to the cert file of this certificate. Changing this forces a new Nginx Certificate to be created.

keyVaultSecretId String

Specify the ID of the Key Vault Secret for this certificate. Changing this forces a new Nginx Certificate to be created.

keyVirtualPath String

Specify the path to the key file of this certificate. Changing this forces a new Nginx Certificate to be created.

name String

The name which should be used for this Nginx Certificate. Changing this forces a new Nginx Certificate to be created.

nginxDeploymentId String

The ID of the Nginx Deployment that this Certificate should be associated with. Changing this forces a new Nginx Certificate to be created.

Import

An Nginx Certificate can be imported using the resource id, e.g.

 $ pulumi import azure:nginx/certificate:Certificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Nginx.NginxPlus/nginxDeployments/deploy1/certificates/cer1

Package Details

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

This Pulumi package is based on the azurerm Terraform Provider.