1. Packages
  2. Incapsula Provider
  3. API Docs
  4. MtlsImpervaToOriginCertificate
incapsula 3.32.1 published on Monday, Apr 14, 2025 by imperva

incapsula.MtlsImpervaToOriginCertificate

Explore with Pulumi AI

Provides a Mutual TLS Imperva to Origin certificate resource. This resource is used to upload mTLS client certificates to enable mutual authentication between Imperva and origin servers. Mutual TLS Imperva to Origin Certificates must be in one of the following formats: pem, der, pfx, cert, crt, p7b, cer, p12, key, ca-bundle, bundle, priv, cert.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as incapsula from "@pulumi/incapsula";

const mtlsImpervaToOriginCertificate = new incapsula.MtlsImpervaToOriginCertificate("mtlsImpervaToOriginCertificate", {
    certificate: fs.readFileSync("path/to/your/cert.pem", { encoding: "base64" }),
    privateKey: fs.readFileSync("path/to/your/private_key.pem", { encoding: "base64" }),
    passphrase: "my_passphrase",
    certificateName: "pem certificate example",
    accountId: "incapsula_account.example-account.id",
});
Copy
import pulumi
import base64
import pulumi_incapsula as incapsula

mtls_imperva_to_origin_certificate = incapsula.MtlsImpervaToOriginCertificate("mtlsImpervaToOriginCertificate",
    certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("path/to/your/cert.pem"),
    private_key=(lambda path: base64.b64encode(open(path).read().encode()).decode())("path/to/your/private_key.pem"),
    passphrase="my_passphrase",
    certificate_name="pem certificate example",
    account_id="incapsula_account.example-account.id")
Copy
package main

import (
	"encoding/base64"
	"os"

	"github.com/pulumi/pulumi-terraform-provider/sdks/go/incapsula/v3/incapsula"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := incapsula.NewMtlsImpervaToOriginCertificate(ctx, "mtlsImpervaToOriginCertificate", &incapsula.MtlsImpervaToOriginCertificateArgs{
			Certificate:     pulumi.String(filebase64OrPanic("path/to/your/cert.pem")),
			PrivateKey:      pulumi.String(filebase64OrPanic("path/to/your/private_key.pem")),
			Passphrase:      pulumi.String("my_passphrase"),
			CertificateName: pulumi.String("pem certificate example"),
			AccountId:       pulumi.String("incapsula_account.example-account.id"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Incapsula = Pulumi.Incapsula;

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

return await Deployment.RunAsync(() => 
{
    var mtlsImpervaToOriginCertificate = new Incapsula.MtlsImpervaToOriginCertificate("mtlsImpervaToOriginCertificate", new()
    {
        Certificate = ReadFileBase64("path/to/your/cert.pem"),
        PrivateKey = ReadFileBase64("path/to/your/private_key.pem"),
        Passphrase = "my_passphrase",
        CertificateName = "pem certificate example",
        AccountId = "incapsula_account.example-account.id",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.incapsula.MtlsImpervaToOriginCertificate;
import com.pulumi.incapsula.MtlsImpervaToOriginCertificateArgs;
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 mtlsImpervaToOriginCertificate = new MtlsImpervaToOriginCertificate("mtlsImpervaToOriginCertificate", MtlsImpervaToOriginCertificateArgs.builder()
            .certificate(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("path/to/your/cert.pem"))))
            .privateKey(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("path/to/your/private_key.pem"))))
            .passphrase("my_passphrase")
            .certificateName("pem certificate example")
            .accountId("incapsula_account.example-account.id")
            .build());

    }
}
Copy
Coming soon!

Create MtlsImpervaToOriginCertificate Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new MtlsImpervaToOriginCertificate(name: string, args: MtlsImpervaToOriginCertificateArgs, opts?: CustomResourceOptions);
@overload
def MtlsImpervaToOriginCertificate(resource_name: str,
                                   args: MtlsImpervaToOriginCertificateArgs,
                                   opts: Optional[ResourceOptions] = None)

@overload
def MtlsImpervaToOriginCertificate(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   certificate: Optional[str] = None,
                                   account_id: Optional[str] = None,
                                   certificate_name: Optional[str] = None,
                                   input_hash: Optional[str] = None,
                                   mtls_imperva_to_origin_certificate_id: Optional[str] = None,
                                   passphrase: Optional[str] = None,
                                   private_key: Optional[str] = None)
func NewMtlsImpervaToOriginCertificate(ctx *Context, name string, args MtlsImpervaToOriginCertificateArgs, opts ...ResourceOption) (*MtlsImpervaToOriginCertificate, error)
public MtlsImpervaToOriginCertificate(string name, MtlsImpervaToOriginCertificateArgs args, CustomResourceOptions? opts = null)
public MtlsImpervaToOriginCertificate(String name, MtlsImpervaToOriginCertificateArgs args)
public MtlsImpervaToOriginCertificate(String name, MtlsImpervaToOriginCertificateArgs args, CustomResourceOptions options)
type: incapsula:MtlsImpervaToOriginCertificate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

The following reference example uses placeholder values for all input properties.

var mtlsImpervaToOriginCertificateResource = new Incapsula.MtlsImpervaToOriginCertificate("mtlsImpervaToOriginCertificateResource", new()
{
    Certificate = "string",
    AccountId = "string",
    CertificateName = "string",
    InputHash = "string",
    MtlsImpervaToOriginCertificateId = "string",
    Passphrase = "string",
    PrivateKey = "string",
});
Copy
example, err := incapsula.NewMtlsImpervaToOriginCertificate(ctx, "mtlsImpervaToOriginCertificateResource", &incapsula.MtlsImpervaToOriginCertificateArgs{
	Certificate:                      pulumi.String("string"),
	AccountId:                        pulumi.String("string"),
	CertificateName:                  pulumi.String("string"),
	InputHash:                        pulumi.String("string"),
	MtlsImpervaToOriginCertificateId: pulumi.String("string"),
	Passphrase:                       pulumi.String("string"),
	PrivateKey:                       pulumi.String("string"),
})
Copy
var mtlsImpervaToOriginCertificateResource = new MtlsImpervaToOriginCertificate("mtlsImpervaToOriginCertificateResource", MtlsImpervaToOriginCertificateArgs.builder()
    .certificate("string")
    .accountId("string")
    .certificateName("string")
    .inputHash("string")
    .mtlsImpervaToOriginCertificateId("string")
    .passphrase("string")
    .privateKey("string")
    .build());
Copy
mtls_imperva_to_origin_certificate_resource = incapsula.MtlsImpervaToOriginCertificate("mtlsImpervaToOriginCertificateResource",
    certificate="string",
    account_id="string",
    certificate_name="string",
    input_hash="string",
    mtls_imperva_to_origin_certificate_id="string",
    passphrase="string",
    private_key="string")
Copy
const mtlsImpervaToOriginCertificateResource = new incapsula.MtlsImpervaToOriginCertificate("mtlsImpervaToOriginCertificateResource", {
    certificate: "string",
    accountId: "string",
    certificateName: "string",
    inputHash: "string",
    mtlsImpervaToOriginCertificateId: "string",
    passphrase: "string",
    privateKey: "string",
});
Copy
type: incapsula:MtlsImpervaToOriginCertificate
properties:
    accountId: string
    certificate: string
    certificateName: string
    inputHash: string
    mtlsImpervaToOriginCertificateId: string
    passphrase: string
    privateKey: string
Copy

MtlsImpervaToOriginCertificate Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The MtlsImpervaToOriginCertificate resource accepts the following input properties:

Certificate This property is required. string
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
AccountId string
Numeric identifier of the account to operate on.
CertificateName string
A descriptive name for your mTLS Certificate.
InputHash string
MtlsImpervaToOriginCertificateId string
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
Passphrase string
Your private key passphrase. Leave empty if the private key is not password protected.
PrivateKey string
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
Certificate This property is required. string
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
AccountId string
Numeric identifier of the account to operate on.
CertificateName string
A descriptive name for your mTLS Certificate.
InputHash string
MtlsImpervaToOriginCertificateId string
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
Passphrase string
Your private key passphrase. Leave empty if the private key is not password protected.
PrivateKey string
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
certificate This property is required. String
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
accountId String
Numeric identifier of the account to operate on.
certificateName String
A descriptive name for your mTLS Certificate.
inputHash String
mtlsImpervaToOriginCertificateId String
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
passphrase String
Your private key passphrase. Leave empty if the private key is not password protected.
privateKey String
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
certificate This property is required. string
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
accountId string
Numeric identifier of the account to operate on.
certificateName string
A descriptive name for your mTLS Certificate.
inputHash string
mtlsImpervaToOriginCertificateId string
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
passphrase string
Your private key passphrase. Leave empty if the private key is not password protected.
privateKey string
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
certificate This property is required. str
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
account_id str
Numeric identifier of the account to operate on.
certificate_name str
A descriptive name for your mTLS Certificate.
input_hash str
mtls_imperva_to_origin_certificate_id str
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
passphrase str
Your private key passphrase. Leave empty if the private key is not password protected.
private_key str
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
certificate This property is required. String
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
accountId String
Numeric identifier of the account to operate on.
certificateName String
A descriptive name for your mTLS Certificate.
inputHash String
mtlsImpervaToOriginCertificateId String
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
passphrase String
Your private key passphrase. Leave empty if the private key is not password protected.
privateKey String
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.

Outputs

All input properties are implicitly available as output properties. Additionally, the MtlsImpervaToOriginCertificate 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 MtlsImpervaToOriginCertificate Resource

Get an existing MtlsImpervaToOriginCertificate 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?: MtlsImpervaToOriginCertificateState, opts?: CustomResourceOptions): MtlsImpervaToOriginCertificate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        certificate: Optional[str] = None,
        certificate_name: Optional[str] = None,
        input_hash: Optional[str] = None,
        mtls_imperva_to_origin_certificate_id: Optional[str] = None,
        passphrase: Optional[str] = None,
        private_key: Optional[str] = None) -> MtlsImpervaToOriginCertificate
func GetMtlsImpervaToOriginCertificate(ctx *Context, name string, id IDInput, state *MtlsImpervaToOriginCertificateState, opts ...ResourceOption) (*MtlsImpervaToOriginCertificate, error)
public static MtlsImpervaToOriginCertificate Get(string name, Input<string> id, MtlsImpervaToOriginCertificateState? state, CustomResourceOptions? opts = null)
public static MtlsImpervaToOriginCertificate get(String name, Output<String> id, MtlsImpervaToOriginCertificateState state, CustomResourceOptions options)
resources:  _:    type: incapsula:MtlsImpervaToOriginCertificate    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AccountId string
Numeric identifier of the account to operate on.
Certificate string
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
CertificateName string
A descriptive name for your mTLS Certificate.
InputHash string
MtlsImpervaToOriginCertificateId string
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
Passphrase string
Your private key passphrase. Leave empty if the private key is not password protected.
PrivateKey string
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
AccountId string
Numeric identifier of the account to operate on.
Certificate string
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
CertificateName string
A descriptive name for your mTLS Certificate.
InputHash string
MtlsImpervaToOriginCertificateId string
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
Passphrase string
Your private key passphrase. Leave empty if the private key is not password protected.
PrivateKey string
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
accountId String
Numeric identifier of the account to operate on.
certificate String
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
certificateName String
A descriptive name for your mTLS Certificate.
inputHash String
mtlsImpervaToOriginCertificateId String
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
passphrase String
Your private key passphrase. Leave empty if the private key is not password protected.
privateKey String
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
accountId string
Numeric identifier of the account to operate on.
certificate string
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
certificateName string
A descriptive name for your mTLS Certificate.
inputHash string
mtlsImpervaToOriginCertificateId string
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
passphrase string
Your private key passphrase. Leave empty if the private key is not password protected.
privateKey string
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
account_id str
Numeric identifier of the account to operate on.
certificate str
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
certificate_name str
A descriptive name for your mTLS Certificate.
input_hash str
mtls_imperva_to_origin_certificate_id str
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
passphrase str
Your private key passphrase. Leave empty if the private key is not password protected.
private_key str
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.
accountId String
Numeric identifier of the account to operate on.
certificate String
Your mTLS client certificate file in base64 format. Supported formats: PEM, DER and PFX. Only RSA certificates are currently supported. The certificate RSA key size must be 2048 bit or less. The certificate must be issued by a certificate authority (CA) and cannot be self-signed.
certificateName String
A descriptive name for your mTLS Certificate.
inputHash String
mtlsImpervaToOriginCertificateId String
Unique identifier of the Mutual TLS Imperva to Origin Certificate.
passphrase String
Your private key passphrase. Leave empty if the private key is not password protected.
privateKey String
Your private key file. supported formats: pem, der, priv, key. If pfx or p12 certificate is used, then this field can remain empty.

Package Details

Repository
incapsula imperva/terraform-provider-incapsula
License
Notes
This Pulumi package is based on the incapsula Terraform Provider.