1. Packages
  2. Incapsula Provider
  3. API Docs
  4. CustomCertificate
incapsula 3.33.0 published on Wednesday, Apr 30, 2025 by imperva

incapsula.CustomCertificate

Explore with Pulumi AI

incapsula logo
incapsula 3.33.0 published on Wednesday, Apr 30, 2025 by imperva

    Provides a Incapsula Custom Certificate resource. Custom certificates must be one of the following formats: PFX, PEM, or CER.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fs from "fs";
    import * as incapsula from "@pulumi/incapsula";
    
    const custom_certificate = new incapsula.CustomCertificate("custom-certificate", {
        siteId: incapsula_site["example-site"].id,
        certificate: fs.readFileSync("path/to/your/cert.crt", { encoding: "base64" }),
        privateKey: fs.readFileSync("path/to/your/private_key.key", { encoding: "base64" }),
        authType: "RSA/ECC",
        passphrase: "yourpassphrase",
    });
    
    import pulumi
    import base64
    import pulumi_incapsula as incapsula
    
    custom_certificate = incapsula.CustomCertificate("custom-certificate",
        site_id=incapsula_site["example-site"]["id"],
        certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("path/to/your/cert.crt"),
        private_key=(lambda path: base64.b64encode(open(path).read().encode()).decode())("path/to/your/private_key.key"),
        auth_type="RSA/ECC",
        passphrase="yourpassphrase")
    
    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.NewCustomCertificate(ctx, "custom-certificate", &incapsula.CustomCertificateArgs{
    			SiteId:      pulumi.Any(incapsula_site.ExampleSite.Id),
    			Certificate: pulumi.String(filebase64OrPanic("path/to/your/cert.crt")),
    			PrivateKey:  pulumi.String(filebase64OrPanic("path/to/your/private_key.key")),
    			AuthType:    pulumi.String("RSA/ECC"),
    			Passphrase:  pulumi.String("yourpassphrase"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 custom_certificate = new Incapsula.CustomCertificate("custom-certificate", new()
        {
            SiteId = incapsula_site.Example_site.Id,
            Certificate = ReadFileBase64("path/to/your/cert.crt"),
            PrivateKey = ReadFileBase64("path/to/your/private_key.key"),
            AuthType = "RSA/ECC",
            Passphrase = "yourpassphrase",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.incapsula.CustomCertificate;
    import com.pulumi.incapsula.CustomCertificateArgs;
    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 custom_certificate = new CustomCertificate("custom-certificate", CustomCertificateArgs.builder()
                .siteId(incapsula_site.example-site().id())
                .certificate(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("path/to/your/cert.crt"))))
                .privateKey(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("path/to/your/private_key.key"))))
                .authType("RSA/ECC")
                .passphrase("yourpassphrase")
                .build());
    
        }
    }
    
    Coming soon!
    

    Create CustomCertificate Resource

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

    Constructor syntax

    new CustomCertificate(name: string, args: CustomCertificateArgs, opts?: CustomResourceOptions);
    @overload
    def CustomCertificate(resource_name: str,
                          args: CustomCertificateArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def CustomCertificate(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          certificate: Optional[str] = None,
                          site_id: Optional[str] = None,
                          auth_type: Optional[str] = None,
                          custom_certificate_id: Optional[str] = None,
                          input_hash: Optional[str] = None,
                          passphrase: Optional[str] = None,
                          private_key: Optional[str] = None)
    func NewCustomCertificate(ctx *Context, name string, args CustomCertificateArgs, opts ...ResourceOption) (*CustomCertificate, error)
    public CustomCertificate(string name, CustomCertificateArgs args, CustomResourceOptions? opts = null)
    public CustomCertificate(String name, CustomCertificateArgs args)
    public CustomCertificate(String name, CustomCertificateArgs args, CustomResourceOptions options)
    
    type: incapsula:CustomCertificate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CustomCertificateArgs
    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 CustomCertificateArgs
    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 CustomCertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomCertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomCertificateArgs
    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 customCertificateResource = new Incapsula.CustomCertificate("customCertificateResource", new()
    {
        Certificate = "string",
        SiteId = "string",
        AuthType = "string",
        CustomCertificateId = "string",
        InputHash = "string",
        Passphrase = "string",
        PrivateKey = "string",
    });
    
    example, err := incapsula.NewCustomCertificate(ctx, "customCertificateResource", &incapsula.CustomCertificateArgs{
    	Certificate:         pulumi.String("string"),
    	SiteId:              pulumi.String("string"),
    	AuthType:            pulumi.String("string"),
    	CustomCertificateId: pulumi.String("string"),
    	InputHash:           pulumi.String("string"),
    	Passphrase:          pulumi.String("string"),
    	PrivateKey:          pulumi.String("string"),
    })
    
    var customCertificateResource = new CustomCertificate("customCertificateResource", CustomCertificateArgs.builder()
        .certificate("string")
        .siteId("string")
        .authType("string")
        .customCertificateId("string")
        .inputHash("string")
        .passphrase("string")
        .privateKey("string")
        .build());
    
    custom_certificate_resource = incapsula.CustomCertificate("customCertificateResource",
        certificate="string",
        site_id="string",
        auth_type="string",
        custom_certificate_id="string",
        input_hash="string",
        passphrase="string",
        private_key="string")
    
    const customCertificateResource = new incapsula.CustomCertificate("customCertificateResource", {
        certificate: "string",
        siteId: "string",
        authType: "string",
        customCertificateId: "string",
        inputHash: "string",
        passphrase: "string",
        privateKey: "string",
    });
    
    type: incapsula:CustomCertificate
    properties:
        authType: string
        certificate: string
        customCertificateId: string
        inputHash: string
        passphrase: string
        privateKey: string
        siteId: string
    

    CustomCertificate 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 CustomCertificate resource accepts the following input properties:

    Certificate string
    The certificate file in base64 format.
    SiteId string
    Numeric identifier of the site to operate on.
    AuthType string
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    CustomCertificateId string
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    InputHash string
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    Passphrase string
    The passphrase used to protect your SSL certificate.
    PrivateKey string
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    Certificate string
    The certificate file in base64 format.
    SiteId string
    Numeric identifier of the site to operate on.
    AuthType string
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    CustomCertificateId string
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    InputHash string
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    Passphrase string
    The passphrase used to protect your SSL certificate.
    PrivateKey string
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    certificate String
    The certificate file in base64 format.
    siteId String
    Numeric identifier of the site to operate on.
    authType String
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    customCertificateId String
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    inputHash String
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    passphrase String
    The passphrase used to protect your SSL certificate.
    privateKey String
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    certificate string
    The certificate file in base64 format.
    siteId string
    Numeric identifier of the site to operate on.
    authType string
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    customCertificateId string
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    inputHash string
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    passphrase string
    The passphrase used to protect your SSL certificate.
    privateKey string
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    certificate str
    The certificate file in base64 format.
    site_id str
    Numeric identifier of the site to operate on.
    auth_type str
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    custom_certificate_id str
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    input_hash str
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    passphrase str
    The passphrase used to protect your SSL certificate.
    private_key str
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    certificate String
    The certificate file in base64 format.
    siteId String
    Numeric identifier of the site to operate on.
    authType String
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    customCertificateId String
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    inputHash String
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    passphrase String
    The passphrase used to protect your SSL certificate.
    privateKey String
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.

    Outputs

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

    Get an existing CustomCertificate 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?: CustomCertificateState, opts?: CustomResourceOptions): CustomCertificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auth_type: Optional[str] = None,
            certificate: Optional[str] = None,
            custom_certificate_id: Optional[str] = None,
            input_hash: Optional[str] = None,
            passphrase: Optional[str] = None,
            private_key: Optional[str] = None,
            site_id: Optional[str] = None) -> CustomCertificate
    func GetCustomCertificate(ctx *Context, name string, id IDInput, state *CustomCertificateState, opts ...ResourceOption) (*CustomCertificate, error)
    public static CustomCertificate Get(string name, Input<string> id, CustomCertificateState? state, CustomResourceOptions? opts = null)
    public static CustomCertificate get(String name, Output<String> id, CustomCertificateState state, CustomResourceOptions options)
    resources:  _:    type: incapsula:CustomCertificate    get:      id: ${id}
    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:
    AuthType string
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    Certificate string
    The certificate file in base64 format.
    CustomCertificateId string
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    InputHash string
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    Passphrase string
    The passphrase used to protect your SSL certificate.
    PrivateKey string
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    SiteId string
    Numeric identifier of the site to operate on.
    AuthType string
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    Certificate string
    The certificate file in base64 format.
    CustomCertificateId string
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    InputHash string
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    Passphrase string
    The passphrase used to protect your SSL certificate.
    PrivateKey string
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    SiteId string
    Numeric identifier of the site to operate on.
    authType String
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    certificate String
    The certificate file in base64 format.
    customCertificateId String
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    inputHash String
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    passphrase String
    The passphrase used to protect your SSL certificate.
    privateKey String
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    siteId String
    Numeric identifier of the site to operate on.
    authType string
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    certificate string
    The certificate file in base64 format.
    customCertificateId string
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    inputHash string
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    passphrase string
    The passphrase used to protect your SSL certificate.
    privateKey string
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    siteId string
    Numeric identifier of the site to operate on.
    auth_type str
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    certificate str
    The certificate file in base64 format.
    custom_certificate_id str
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    input_hash str
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    passphrase str
    The passphrase used to protect your SSL certificate.
    private_key str
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    site_id str
    Numeric identifier of the site to operate on.
    authType String
    The authentication type of the certificate (RSA/ECC). If not provided then RSA will be taken as a default.
    certificate String
    The certificate file in base64 format.
    customCertificateId String
    At the moment, only one active certificate can be stored. This exported value is always set as 12345. This will be augmented in future versions of the API.
    inputHash String
    Currently ignored. If pulumi preview flags this field as changed, it means that any of: certificate, private_key, or passphrase has changed.
    passphrase String
    The passphrase used to protect your SSL certificate.
    privateKey String
    The private key of the certificate in base64 format. Optional in case of PFX certificate file format.
    siteId String
    Numeric identifier of the site to operate on.

    Import

    Custom Certificate cannot be imported.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    incapsula imperva/terraform-provider-incapsula
    License
    Notes
    This Pulumi package is based on the incapsula Terraform Provider.
    incapsula logo
    incapsula 3.33.0 published on Wednesday, Apr 30, 2025 by imperva