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

incapsula.MtlsClientToImpervaCaCertificateSiteAssociation

Explore with Pulumi AI

Provides an Incapsula Mutual TLS Client to Imperva CA Certificate Association resource.

Example Usage

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

const accountData = incapsula.getAccountData({});
const example_site_1 = new incapsula.Site("example-site-1", {domain: "examplesite.com"});
const clientCaCertificate1 = new incapsula.MtlsClientToImpervaCaCertificate("clientCaCertificate1", {
    accountId: accountData.then(accountData => accountData.currentAccount),
    certificate: fs.readFileSync("./cert1.der", { encoding: "base64" }),
    certificateName: "der certificate example 1",
});
const clientCaCertificate2 = new incapsula.MtlsClientToImpervaCaCertificate("clientCaCertificate2", {
    accountId: accountData.then(accountData => accountData.currentAccount),
    certificate: fs.readFileSync("./cert2.pfx", { encoding: "base64" }),
    certificateName: "pfx certificate example 2",
});
const siteCertificateAssociation1 = new incapsula.MtlsClientToImpervaCaCertificateSiteAssociation("siteCertificateAssociation1", {
    certificateId: clientCaCertificate1.mtlsClientToImpervaCaCertificateId,
    siteId: example_site_1.siteId,
});
const siteCertificateAssociation2 = new incapsula.MtlsClientToImpervaCaCertificateSiteAssociation("siteCertificateAssociation2", {
    certificateId: clientCaCertificate2.mtlsClientToImpervaCaCertificateId,
    siteId: example_site_1.siteId,
});
Copy
import pulumi
import base64
import pulumi_incapsula as incapsula

account_data = incapsula.get_account_data()
example_site_1 = incapsula.Site("example-site-1", domain="examplesite.com")
client_ca_certificate1 = incapsula.MtlsClientToImpervaCaCertificate("clientCaCertificate1",
    account_id=account_data.current_account,
    certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("./cert1.der"),
    certificate_name="der certificate example 1")
client_ca_certificate2 = incapsula.MtlsClientToImpervaCaCertificate("clientCaCertificate2",
    account_id=account_data.current_account,
    certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("./cert2.pfx"),
    certificate_name="pfx certificate example 2")
site_certificate_association1 = incapsula.MtlsClientToImpervaCaCertificateSiteAssociation("siteCertificateAssociation1",
    certificate_id=client_ca_certificate1.mtls_client_to_imperva_ca_certificate_id,
    site_id=example_site_1.site_id)
site_certificate_association2 = incapsula.MtlsClientToImpervaCaCertificateSiteAssociation("siteCertificateAssociation2",
    certificate_id=client_ca_certificate2.mtls_client_to_imperva_ca_certificate_id,
    site_id=example_site_1.site_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 {
		accountData, err := incapsula.GetAccountData(ctx, &incapsula.GetAccountDataArgs{}, nil)
		if err != nil {
			return err
		}
		example_site_1, err := incapsula.NewSite(ctx, "example-site-1", &incapsula.SiteArgs{
			Domain: pulumi.String("examplesite.com"),
		})
		if err != nil {
			return err
		}
		clientCaCertificate1, err := incapsula.NewMtlsClientToImpervaCaCertificate(ctx, "clientCaCertificate1", &incapsula.MtlsClientToImpervaCaCertificateArgs{
			AccountId:       pulumi.String(accountData.CurrentAccount),
			Certificate:     pulumi.String(filebase64OrPanic("./cert1.der")),
			CertificateName: pulumi.String("der certificate example 1"),
		})
		if err != nil {
			return err
		}
		clientCaCertificate2, err := incapsula.NewMtlsClientToImpervaCaCertificate(ctx, "clientCaCertificate2", &incapsula.MtlsClientToImpervaCaCertificateArgs{
			AccountId:       pulumi.String(accountData.CurrentAccount),
			Certificate:     pulumi.String(filebase64OrPanic("./cert2.pfx")),
			CertificateName: pulumi.String("pfx certificate example 2"),
		})
		if err != nil {
			return err
		}
		_, err = incapsula.NewMtlsClientToImpervaCaCertificateSiteAssociation(ctx, "siteCertificateAssociation1", &incapsula.MtlsClientToImpervaCaCertificateSiteAssociationArgs{
			CertificateId: clientCaCertificate1.MtlsClientToImpervaCaCertificateId,
			SiteId:        example_site_1.SiteId,
		})
		if err != nil {
			return err
		}
		_, err = incapsula.NewMtlsClientToImpervaCaCertificateSiteAssociation(ctx, "siteCertificateAssociation2", &incapsula.MtlsClientToImpervaCaCertificateSiteAssociationArgs{
			CertificateId: clientCaCertificate2.MtlsClientToImpervaCaCertificateId,
			SiteId:        example_site_1.SiteId,
		})
		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 accountData = Incapsula.GetAccountData.Invoke();

    var example_site_1 = new Incapsula.Site("example-site-1", new()
    {
        Domain = "examplesite.com",
    });

    var clientCaCertificate1 = new Incapsula.MtlsClientToImpervaCaCertificate("clientCaCertificate1", new()
    {
        AccountId = accountData.Apply(getAccountDataResult => getAccountDataResult.CurrentAccount),
        Certificate = ReadFileBase64("./cert1.der"),
        CertificateName = "der certificate example 1",
    });

    var clientCaCertificate2 = new Incapsula.MtlsClientToImpervaCaCertificate("clientCaCertificate2", new()
    {
        AccountId = accountData.Apply(getAccountDataResult => getAccountDataResult.CurrentAccount),
        Certificate = ReadFileBase64("./cert2.pfx"),
        CertificateName = "pfx certificate example 2",
    });

    var siteCertificateAssociation1 = new Incapsula.MtlsClientToImpervaCaCertificateSiteAssociation("siteCertificateAssociation1", new()
    {
        CertificateId = clientCaCertificate1.MtlsClientToImpervaCaCertificateId,
        SiteId = example_site_1.SiteId,
    });

    var siteCertificateAssociation2 = new Incapsula.MtlsClientToImpervaCaCertificateSiteAssociation("siteCertificateAssociation2", new()
    {
        CertificateId = clientCaCertificate2.MtlsClientToImpervaCaCertificateId,
        SiteId = example_site_1.SiteId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.incapsula.IncapsulaFunctions;
import com.pulumi.incapsula.inputs.GetAccountDataArgs;
import com.pulumi.incapsula.Site;
import com.pulumi.incapsula.SiteArgs;
import com.pulumi.incapsula.MtlsClientToImpervaCaCertificate;
import com.pulumi.incapsula.MtlsClientToImpervaCaCertificateArgs;
import com.pulumi.incapsula.MtlsClientToImpervaCaCertificateSiteAssociation;
import com.pulumi.incapsula.MtlsClientToImpervaCaCertificateSiteAssociationArgs;
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 accountData = IncapsulaFunctions.getAccountData();

        var example_site_1 = new Site("example-site-1", SiteArgs.builder()
            .domain("examplesite.com")
            .build());

        var clientCaCertificate1 = new MtlsClientToImpervaCaCertificate("clientCaCertificate1", MtlsClientToImpervaCaCertificateArgs.builder()
            .accountId(accountData.applyValue(getAccountDataResult -> getAccountDataResult.currentAccount()))
            .certificate(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("./cert1.der"))))
            .certificateName("der certificate example 1")
            .build());

        var clientCaCertificate2 = new MtlsClientToImpervaCaCertificate("clientCaCertificate2", MtlsClientToImpervaCaCertificateArgs.builder()
            .accountId(accountData.applyValue(getAccountDataResult -> getAccountDataResult.currentAccount()))
            .certificate(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("./cert2.pfx"))))
            .certificateName("pfx certificate example 2")
            .build());

        var siteCertificateAssociation1 = new MtlsClientToImpervaCaCertificateSiteAssociation("siteCertificateAssociation1", MtlsClientToImpervaCaCertificateSiteAssociationArgs.builder()
            .certificateId(clientCaCertificate1.mtlsClientToImpervaCaCertificateId())
            .siteId(example_site_1.siteId())
            .build());

        var siteCertificateAssociation2 = new MtlsClientToImpervaCaCertificateSiteAssociation("siteCertificateAssociation2", MtlsClientToImpervaCaCertificateSiteAssociationArgs.builder()
            .certificateId(clientCaCertificate2.mtlsClientToImpervaCaCertificateId())
            .siteId(example_site_1.siteId())
            .build());

    }
}
Copy
Coming soon!

Create MtlsClientToImpervaCaCertificateSiteAssociation Resource

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

Constructor syntax

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

@overload
def MtlsClientToImpervaCaCertificateSiteAssociation(resource_name: str,
                                                    opts: Optional[ResourceOptions] = None,
                                                    certificate_id: Optional[str] = None,
                                                    site_id: Optional[str] = None,
                                                    mtls_client_to_imperva_ca_certificate_site_association_id: Optional[str] = None)
func NewMtlsClientToImpervaCaCertificateSiteAssociation(ctx *Context, name string, args MtlsClientToImpervaCaCertificateSiteAssociationArgs, opts ...ResourceOption) (*MtlsClientToImpervaCaCertificateSiteAssociation, error)
public MtlsClientToImpervaCaCertificateSiteAssociation(string name, MtlsClientToImpervaCaCertificateSiteAssociationArgs args, CustomResourceOptions? opts = null)
public MtlsClientToImpervaCaCertificateSiteAssociation(String name, MtlsClientToImpervaCaCertificateSiteAssociationArgs args)
public MtlsClientToImpervaCaCertificateSiteAssociation(String name, MtlsClientToImpervaCaCertificateSiteAssociationArgs args, CustomResourceOptions options)
type: incapsula:MtlsClientToImpervaCaCertificateSiteAssociation
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. MtlsClientToImpervaCaCertificateSiteAssociationArgs
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. MtlsClientToImpervaCaCertificateSiteAssociationArgs
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. MtlsClientToImpervaCaCertificateSiteAssociationArgs
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. MtlsClientToImpervaCaCertificateSiteAssociationArgs
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. MtlsClientToImpervaCaCertificateSiteAssociationArgs
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 mtlsClientToImpervaCaCertificateSiteAssociationResource = new Incapsula.MtlsClientToImpervaCaCertificateSiteAssociation("mtlsClientToImpervaCaCertificateSiteAssociationResource", new()
{
    CertificateId = "string",
    SiteId = "string",
    MtlsClientToImpervaCaCertificateSiteAssociationId = "string",
});
Copy
example, err := incapsula.NewMtlsClientToImpervaCaCertificateSiteAssociation(ctx, "mtlsClientToImpervaCaCertificateSiteAssociationResource", &incapsula.MtlsClientToImpervaCaCertificateSiteAssociationArgs{
CertificateId: pulumi.String("string"),
SiteId: pulumi.String("string"),
MtlsClientToImpervaCaCertificateSiteAssociationId: pulumi.String("string"),
})
Copy
var mtlsClientToImpervaCaCertificateSiteAssociationResource = new MtlsClientToImpervaCaCertificateSiteAssociation("mtlsClientToImpervaCaCertificateSiteAssociationResource", MtlsClientToImpervaCaCertificateSiteAssociationArgs.builder()
    .certificateId("string")
    .siteId("string")
    .mtlsClientToImpervaCaCertificateSiteAssociationId("string")
    .build());
Copy
mtls_client_to_imperva_ca_certificate_site_association_resource = incapsula.MtlsClientToImpervaCaCertificateSiteAssociation("mtlsClientToImpervaCaCertificateSiteAssociationResource",
    certificate_id="string",
    site_id="string",
    mtls_client_to_imperva_ca_certificate_site_association_id="string")
Copy
const mtlsClientToImpervaCaCertificateSiteAssociationResource = new incapsula.MtlsClientToImpervaCaCertificateSiteAssociation("mtlsClientToImpervaCaCertificateSiteAssociationResource", {
    certificateId: "string",
    siteId: "string",
    mtlsClientToImpervaCaCertificateSiteAssociationId: "string",
});
Copy
type: incapsula:MtlsClientToImpervaCaCertificateSiteAssociation
properties:
    certificateId: string
    mtlsClientToImpervaCaCertificateSiteAssociationId: string
    siteId: string
Copy

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

CertificateId This property is required. string
The Mutual TLS Client to Imperva CA Certificate ID.
SiteId This property is required. string
Numeric identifier of the site to operate on.
MtlsClientToImpervaCaCertificateSiteAssociationId string
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
CertificateId This property is required. string
The Mutual TLS Client to Imperva CA Certificate ID.
SiteId This property is required. string
Numeric identifier of the site to operate on.
MtlsClientToImpervaCaCertificateSiteAssociationId string
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
certificateId This property is required. String
The Mutual TLS Client to Imperva CA Certificate ID.
siteId This property is required. String
Numeric identifier of the site to operate on.
mtlsClientToImpervaCaCertificateSiteAssociationId String
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
certificateId This property is required. string
The Mutual TLS Client to Imperva CA Certificate ID.
siteId This property is required. string
Numeric identifier of the site to operate on.
mtlsClientToImpervaCaCertificateSiteAssociationId string
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
certificate_id This property is required. str
The Mutual TLS Client to Imperva CA Certificate ID.
site_id This property is required. str
Numeric identifier of the site to operate on.
mtls_client_to_imperva_ca_certificate_site_association_id str
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
certificateId This property is required. String
The Mutual TLS Client to Imperva CA Certificate ID.
siteId This property is required. String
Numeric identifier of the site to operate on.
mtlsClientToImpervaCaCertificateSiteAssociationId String
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.

Outputs

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

Get an existing MtlsClientToImpervaCaCertificateSiteAssociation 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?: MtlsClientToImpervaCaCertificateSiteAssociationState, opts?: CustomResourceOptions): MtlsClientToImpervaCaCertificateSiteAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        certificate_id: Optional[str] = None,
        mtls_client_to_imperva_ca_certificate_site_association_id: Optional[str] = None,
        site_id: Optional[str] = None) -> MtlsClientToImpervaCaCertificateSiteAssociation
func GetMtlsClientToImpervaCaCertificateSiteAssociation(ctx *Context, name string, id IDInput, state *MtlsClientToImpervaCaCertificateSiteAssociationState, opts ...ResourceOption) (*MtlsClientToImpervaCaCertificateSiteAssociation, error)
public static MtlsClientToImpervaCaCertificateSiteAssociation Get(string name, Input<string> id, MtlsClientToImpervaCaCertificateSiteAssociationState? state, CustomResourceOptions? opts = null)
public static MtlsClientToImpervaCaCertificateSiteAssociation get(String name, Output<String> id, MtlsClientToImpervaCaCertificateSiteAssociationState state, CustomResourceOptions options)
resources:  _:    type: incapsula:MtlsClientToImpervaCaCertificateSiteAssociation    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:
CertificateId string
The Mutual TLS Client to Imperva CA Certificate ID.
MtlsClientToImpervaCaCertificateSiteAssociationId string
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
SiteId string
Numeric identifier of the site to operate on.
CertificateId string
The Mutual TLS Client to Imperva CA Certificate ID.
MtlsClientToImpervaCaCertificateSiteAssociationId string
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
SiteId string
Numeric identifier of the site to operate on.
certificateId String
The Mutual TLS Client to Imperva CA Certificate ID.
mtlsClientToImpervaCaCertificateSiteAssociationId String
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
siteId String
Numeric identifier of the site to operate on.
certificateId string
The Mutual TLS Client to Imperva CA Certificate ID.
mtlsClientToImpervaCaCertificateSiteAssociationId string
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
siteId string
Numeric identifier of the site to operate on.
certificate_id str
The Mutual TLS Client to Imperva CA Certificate ID.
mtls_client_to_imperva_ca_certificate_site_association_id str
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
site_id str
Numeric identifier of the site to operate on.
certificateId String
The Mutual TLS Client to Imperva CA Certificate ID.
mtlsClientToImpervaCaCertificateSiteAssociationId String
Incapsula Mutual TLS Client to Imperva CA Certificate Association ID. The ID is composed of 2 parts: site_id and certificate_id separated by a slash.
siteId String
Numeric identifier of the site to operate on.

Import

Incapsula Mutual TLS Client to Imperva CA Certificate Association can be imported using site_id and certificate_id separated by a slash:

$ pulumi import incapsula:index/mtlsClientToImpervaCaCertificateSiteAssociation:MtlsClientToImpervaCaCertificateSiteAssociation site_certificate_association_1 site_id/certificate_id
Copy

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.