1. Packages
  2. Zscaler Private Access (ZPA)
  3. API Docs
  4. BrowserCertificate
Zscaler Private Access v0.0.12 published on Tuesday, Jul 30, 2024 by Zscaler

zpa.BrowserCertificate

Explore with Pulumi AI

Use the zpa_ba_certificate creates a browser access certificate with a private key in the Zscaler Private Access cloud. This resource is required when creating a browser access application segment resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as zpa from "@pulumi/zpa";

const foo = zpa.getBaCertificate({
    name: "example.acme.com",
});
Copy
import pulumi
import pulumi_zpa as zpa

foo = zpa.get_ba_certificate(name="example.acme.com")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/zscaler/pulumi-zpa/sdk/go/zpa"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := zpa.GetBaCertificate(ctx, &zpa.GetBaCertificateArgs{
			Name: pulumi.StringRef("example.acme.com"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Zpa = Pulumi.Zpa;

return await Deployment.RunAsync(() => 
{
    var foo = Zpa.GetBaCertificate.Invoke(new()
    {
        Name = "example.acme.com",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zpa.ZpaFunctions;
import com.pulumi.zpa.inputs.GetBaCertificateArgs;
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 foo = ZpaFunctions.getBaCertificate(GetBaCertificateArgs.builder()
            .name("example.acme.com")
            .build());

    }
}
Copy
variables:
  foo:
    fn::invoke:
      Function: zpa:getBaCertificate
      Arguments:
        name: example.acme.com
Copy

######### PASSWORDS OR RELATED CREDENTIALS ATTRIBUTES IN THIS FILE #########
######### ARE FOR EXAMPLE ONLY AND NOT USED IN PRODUCTION SYSTEMS ##########

import * as pulumi from "@pulumi/pulumi";
import * as zpa from "@bdzscaler/pulumi-zpa";

// ZPA Browser Access resource
const _this = new zpa.BrowserCertificate("this", {
    certBlob: `-----BEGIN PRIVATE KEY-----
MIIDyzCCArOgA
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIDyzCCArOgAwIBAgIUekBD+iu64583B3u5ew7Bqj2O5cQwDQYJKoZIhvcNAQEL
-----END CERTIFICATE-----

`,
    description: "server.example.com",
});
Copy
import pulumi
import zscaler_pulumi_zpa as zpa

# ZPA Browser Access resource
this = zpa.BrowserCertificate("this",
    cert_blob="""-----BEGIN PRIVATE KEY-----
MIIDyzCCArOgA
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIDyzCCArOgAwIBAgIUekBD+iu64583B3u5ew7Bqj2O5cQwDQYJKoZIhvcNAQEL
-----END CERTIFICATE-----

""",
    description="server.example.com")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/zscaler/pulumi-zpa/sdk/go/zpa"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// ZPA Browser Access resource
		_, err := zpa.NewBrowserCertificate(ctx, "this", &zpa.BrowserCertificateArgs{
			CertBlob: pulumi.String(`-----BEGIN PRIVATE KEY-----
MIIDyzCCArOgA
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIDyzCCArOgAwIBAgIUekBD+iu64583B3u5ew7Bqj2O5cQwDQYJKoZIhvcNAQEL
-----END CERTIFICATE-----

`),
			Description: pulumi.String("server.example.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Zpa = Zscaler.Zpa;

return await Deployment.RunAsync(() => 
{
    // ZPA Browser Access resource
    var @this = new Zpa.BrowserCertificate("this", new()
    {
        CertBlob = @"-----BEGIN PRIVATE KEY-----
MIIDyzCCArOgA
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIDyzCCArOgAwIBAgIUekBD+iu64583B3u5ew7Bqj2O5cQwDQYJKoZIhvcNAQEL
-----END CERTIFICATE-----

",
        Description = "server.example.com",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zpa.BrowserCertificate;
import com.pulumi.zpa.BrowserCertificateArgs;
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) {
        // ZPA Browser Access resource
        var this_ = new BrowserCertificate("this", BrowserCertificateArgs.builder()
            .certBlob("""
-----BEGIN PRIVATE KEY-----
MIIDyzCCArOgA
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIDyzCCArOgAwIBAgIUekBD+iu64583B3u5ew7Bqj2O5cQwDQYJKoZIhvcNAQEL
-----END CERTIFICATE-----

            """)
            .description("server.example.com")
            .build());

    }
}
Copy
resources:
  # ZPA Browser Access resource
  this:
    type: zpa:BrowserCertificate
    properties:
      certBlob: |+
        -----BEGIN PRIVATE KEY-----
        MIIDyzCCArOgA
        -----END PRIVATE KEY-----
        -----BEGIN CERTIFICATE-----
        MIIDyzCCArOgAwIBAgIUekBD+iu64583B3u5ew7Bqj2O5cQwDQYJKoZIhvcNAQEL
        -----END CERTIFICATE-----        

      description: server.example.com
Copy

Let’s Encrypt Certbot

This example demonstrates generatoring a domain certificate with letsencrypt certbot https://letsencrypt.org/getting-started/

$ certbot certonly --manual --preferred-challenges dns --key-type rsa -d [DOMAIN]

Use letsencrypt’s certbot to generate domain certificates in RSA output mode. The generator’s output corresponds to zpa.BrowserCertificate fields in the following manner.

Zscaler FieldCertbot file
certblobcert.pem
certblobprivkey.pem

Create BrowserCertificate Resource

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

Constructor syntax

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

@overload
def BrowserCertificate(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       cert_blob: Optional[str] = None,
                       description: Optional[str] = None,
                       microtenant_id: Optional[str] = None,
                       name: Optional[str] = None)
func NewBrowserCertificate(ctx *Context, name string, args *BrowserCertificateArgs, opts ...ResourceOption) (*BrowserCertificate, error)
public BrowserCertificate(string name, BrowserCertificateArgs? args = null, CustomResourceOptions? opts = null)
public BrowserCertificate(String name, BrowserCertificateArgs args)
public BrowserCertificate(String name, BrowserCertificateArgs args, CustomResourceOptions options)
type: zpa:BrowserCertificate
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 BrowserCertificateArgs
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 BrowserCertificateArgs
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 BrowserCertificateArgs
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 BrowserCertificateArgs
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. BrowserCertificateArgs
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 browserCertificateResource = new Zpa.BrowserCertificate("browserCertificateResource", new()
{
    CertBlob = "string",
    Description = "string",
    MicrotenantId = "string",
    Name = "string",
});
Copy
example, err := zpa.NewBrowserCertificate(ctx, "browserCertificateResource", &zpa.BrowserCertificateArgs{
	CertBlob:      pulumi.String("string"),
	Description:   pulumi.String("string"),
	MicrotenantId: pulumi.String("string"),
	Name:          pulumi.String("string"),
})
Copy
var browserCertificateResource = new BrowserCertificate("browserCertificateResource", BrowserCertificateArgs.builder()
    .certBlob("string")
    .description("string")
    .microtenantId("string")
    .name("string")
    .build());
Copy
browser_certificate_resource = zpa.BrowserCertificate("browserCertificateResource",
    cert_blob="string",
    description="string",
    microtenant_id="string",
    name="string")
Copy
const browserCertificateResource = new zpa.BrowserCertificate("browserCertificateResource", {
    certBlob: "string",
    description: "string",
    microtenantId: "string",
    name: "string",
});
Copy
type: zpa:BrowserCertificate
properties:
    certBlob: string
    description: string
    microtenantId: string
    name: string
Copy

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

CertBlob Changes to this property will trigger replacement. string
The description of the certificate
Description string
The description of the certificate
MicrotenantId string
The unique identifier of the Microtenant
Name string
The name of the certificate.
CertBlob Changes to this property will trigger replacement. string
The description of the certificate
Description string
The description of the certificate
MicrotenantId string
The unique identifier of the Microtenant
Name string
The name of the certificate.
certBlob Changes to this property will trigger replacement. String
The description of the certificate
description String
The description of the certificate
microtenantId String
The unique identifier of the Microtenant
name String
The name of the certificate.
certBlob Changes to this property will trigger replacement. string
The description of the certificate
description string
The description of the certificate
microtenantId string
The unique identifier of the Microtenant
name string
The name of the certificate.
cert_blob Changes to this property will trigger replacement. str
The description of the certificate
description str
The description of the certificate
microtenant_id str
The unique identifier of the Microtenant
name str
The name of the certificate.
certBlob Changes to this property will trigger replacement. String
The description of the certificate
description String
The description of the certificate
microtenantId String
The unique identifier of the Microtenant
name String
The name of the certificate.

Outputs

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

Certificate string
The certificate text in PEM format
Id string
The provider-assigned unique ID for this managed resource.
Certificate string
The certificate text in PEM format
Id string
The provider-assigned unique ID for this managed resource.
certificate String
The certificate text in PEM format
id String
The provider-assigned unique ID for this managed resource.
certificate string
The certificate text in PEM format
id string
The provider-assigned unique ID for this managed resource.
certificate str
The certificate text in PEM format
id str
The provider-assigned unique ID for this managed resource.
certificate String
The certificate text in PEM format
id String
The provider-assigned unique ID for this managed resource.

Look up Existing BrowserCertificate Resource

Get an existing BrowserCertificate 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?: BrowserCertificateState, opts?: CustomResourceOptions): BrowserCertificate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cert_blob: Optional[str] = None,
        certificate: Optional[str] = None,
        description: Optional[str] = None,
        microtenant_id: Optional[str] = None,
        name: Optional[str] = None) -> BrowserCertificate
func GetBrowserCertificate(ctx *Context, name string, id IDInput, state *BrowserCertificateState, opts ...ResourceOption) (*BrowserCertificate, error)
public static BrowserCertificate Get(string name, Input<string> id, BrowserCertificateState? state, CustomResourceOptions? opts = null)
public static BrowserCertificate get(String name, Output<String> id, BrowserCertificateState state, CustomResourceOptions options)
resources:  _:    type: zpa:BrowserCertificate    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:
CertBlob Changes to this property will trigger replacement. string
The description of the certificate
Certificate string
The certificate text in PEM format
Description string
The description of the certificate
MicrotenantId string
The unique identifier of the Microtenant
Name string
The name of the certificate.
CertBlob Changes to this property will trigger replacement. string
The description of the certificate
Certificate string
The certificate text in PEM format
Description string
The description of the certificate
MicrotenantId string
The unique identifier of the Microtenant
Name string
The name of the certificate.
certBlob Changes to this property will trigger replacement. String
The description of the certificate
certificate String
The certificate text in PEM format
description String
The description of the certificate
microtenantId String
The unique identifier of the Microtenant
name String
The name of the certificate.
certBlob Changes to this property will trigger replacement. string
The description of the certificate
certificate string
The certificate text in PEM format
description string
The description of the certificate
microtenantId string
The unique identifier of the Microtenant
name string
The name of the certificate.
cert_blob Changes to this property will trigger replacement. str
The description of the certificate
certificate str
The certificate text in PEM format
description str
The description of the certificate
microtenant_id str
The unique identifier of the Microtenant
name str
The name of the certificate.
certBlob Changes to this property will trigger replacement. String
The description of the certificate
certificate String
The certificate text in PEM format
description String
The description of the certificate
microtenantId String
The unique identifier of the Microtenant
name String
The name of the certificate.

Import

This resource does not support importing.

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

Package Details

Repository
zpa zscaler/pulumi-zpa
License
MIT
Notes
This Pulumi package is based on the zpa Terraform Provider.