1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. esa
  5. ClientCertificate
Alibaba Cloud v3.96.0 published on Tuesday, Mar 3, 2026 by Pulumi
alicloud logo
Alibaba Cloud v3.96.0 published on Tuesday, Mar 3, 2026 by Pulumi

    Provides a ESA Client Certificate resource.

    For information about ESA Client Certificate and how to use it, see What is Client Certificate.

    NOTE: Available since v1.244.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = alicloud.esa.getSites({
        planSubscribeType: "enterpriseplan",
        siteName: "gositecdn.cn",
    });
    const defaultClientCertificate = new alicloud.esa.ClientCertificate("default", {
        siteId: _default.then(_default => _default.sites?.[0]?.id),
        pkeyType: "RSA",
        validityDays: "365",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.esa.get_sites(plan_subscribe_type="enterpriseplan",
        site_name="gositecdn.cn")
    default_client_certificate = alicloud.esa.ClientCertificate("default",
        site_id=default.sites[0].id,
        pkey_type="RSA",
        validity_days="365")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := esa.GetSites(ctx, &esa.GetSitesArgs{
    			PlanSubscribeType: pulumi.StringRef("enterpriseplan"),
    			SiteName:          pulumi.StringRef("gositecdn.cn"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = esa.NewClientCertificate(ctx, "default", &esa.ClientCertificateArgs{
    			SiteId:       pulumi.Int(_default.Sites[0].Id),
    			PkeyType:     pulumi.String("RSA"),
    			ValidityDays: pulumi.String("365"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Esa.GetSites.Invoke(new()
        {
            PlanSubscribeType = "enterpriseplan",
            SiteName = "gositecdn.cn",
        });
    
        var defaultClientCertificate = new AliCloud.Esa.ClientCertificate("default", new()
        {
            SiteId = @default.Apply(@default => @default.Apply(getSitesResult => getSitesResult.Sites[0]?.Id)),
            PkeyType = "RSA",
            ValidityDays = "365",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.esa.EsaFunctions;
    import com.pulumi.alicloud.esa.inputs.GetSitesArgs;
    import com.pulumi.alicloud.esa.ClientCertificate;
    import com.pulumi.alicloud.esa.ClientCertificateArgs;
    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 default = EsaFunctions.getSites(GetSitesArgs.builder()
                .planSubscribeType("enterpriseplan")
                .siteName("gositecdn.cn")
                .build());
    
            var defaultClientCertificate = new ClientCertificate("defaultClientCertificate", ClientCertificateArgs.builder()
                .siteId(default_.sites()[0].id())
                .pkeyType("RSA")
                .validityDays("365")
                .build());
    
        }
    }
    
    resources:
      defaultClientCertificate:
        type: alicloud:esa:ClientCertificate
        name: default
        properties:
          siteId: ${default.sites[0].id}
          pkeyType: RSA
          validityDays: '365'
    variables:
      default:
        fn::invoke:
          function: alicloud:esa:getSites
          arguments:
            planSubscribeType: enterpriseplan
            siteName: gositecdn.cn
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create ClientCertificate Resource

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

    Constructor syntax

    new ClientCertificate(name: string, args: ClientCertificateArgs, opts?: CustomResourceOptions);
    @overload
    def ClientCertificate(resource_name: str,
                          args: ClientCertificateArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClientCertificate(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          site_id: Optional[str] = None,
                          validity_days: Optional[str] = None,
                          csr: Optional[str] = None,
                          pkey_type: Optional[str] = None,
                          status: Optional[str] = None)
    func NewClientCertificate(ctx *Context, name string, args ClientCertificateArgs, opts ...ResourceOption) (*ClientCertificate, error)
    public ClientCertificate(string name, ClientCertificateArgs args, CustomResourceOptions? opts = null)
    public ClientCertificate(String name, ClientCertificateArgs args)
    public ClientCertificate(String name, ClientCertificateArgs args, CustomResourceOptions options)
    
    type: alicloud:esa:ClientCertificate
    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 ClientCertificateArgs
    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 ClientCertificateArgs
    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 ClientCertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClientCertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClientCertificateArgs
    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 clientCertificateResource = new AliCloud.Esa.ClientCertificate("clientCertificateResource", new()
    {
        SiteId = "string",
        ValidityDays = "string",
        Csr = "string",
        PkeyType = "string",
        Status = "string",
    });
    
    example, err := esa.NewClientCertificate(ctx, "clientCertificateResource", &esa.ClientCertificateArgs{
    	SiteId:       pulumi.String("string"),
    	ValidityDays: pulumi.String("string"),
    	Csr:          pulumi.String("string"),
    	PkeyType:     pulumi.String("string"),
    	Status:       pulumi.String("string"),
    })
    
    var clientCertificateResource = new ClientCertificate("clientCertificateResource", ClientCertificateArgs.builder()
        .siteId("string")
        .validityDays("string")
        .csr("string")
        .pkeyType("string")
        .status("string")
        .build());
    
    client_certificate_resource = alicloud.esa.ClientCertificate("clientCertificateResource",
        site_id="string",
        validity_days="string",
        csr="string",
        pkey_type="string",
        status="string")
    
    const clientCertificateResource = new alicloud.esa.ClientCertificate("clientCertificateResource", {
        siteId: "string",
        validityDays: "string",
        csr: "string",
        pkeyType: "string",
        status: "string",
    });
    
    type: alicloud:esa:ClientCertificate
    properties:
        csr: string
        pkeyType: string
        siteId: string
        status: string
        validityDays: string
    

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

    SiteId string
    Site Id
    ValidityDays string

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    Csr string

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    PkeyType string

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    Status string
    The certificate status. Valid values: revoked, active.
    SiteId string
    Site Id
    ValidityDays string

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    Csr string

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    PkeyType string

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    Status string
    The certificate status. Valid values: revoked, active.
    siteId String
    Site Id
    validityDays String

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    csr String

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    pkeyType String

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    status String
    The certificate status. Valid values: revoked, active.
    siteId string
    Site Id
    validityDays string

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    csr string

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    pkeyType string

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    status string
    The certificate status. Valid values: revoked, active.
    site_id str
    Site Id
    validity_days str

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    csr str

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    pkey_type str

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    status str
    The certificate status. Valid values: revoked, active.
    siteId String
    Site Id
    validityDays String

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    csr String

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    pkeyType String

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    status String
    The certificate status. Valid values: revoked, active.

    Outputs

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

    ClientCertId string
    ClientCertificate Id
    CreateTime string
    The time when the certificate was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    ClientCertId string
    ClientCertificate Id
    CreateTime string
    The time when the certificate was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    clientCertId String
    ClientCertificate Id
    createTime String
    The time when the certificate was created.
    id String
    The provider-assigned unique ID for this managed resource.
    clientCertId string
    ClientCertificate Id
    createTime string
    The time when the certificate was created.
    id string
    The provider-assigned unique ID for this managed resource.
    client_cert_id str
    ClientCertificate Id
    create_time str
    The time when the certificate was created.
    id str
    The provider-assigned unique ID for this managed resource.
    clientCertId String
    ClientCertificate Id
    createTime String
    The time when the certificate was created.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ClientCertificate Resource

    Get an existing ClientCertificate 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?: ClientCertificateState, opts?: CustomResourceOptions): ClientCertificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            client_cert_id: Optional[str] = None,
            create_time: Optional[str] = None,
            csr: Optional[str] = None,
            pkey_type: Optional[str] = None,
            site_id: Optional[str] = None,
            status: Optional[str] = None,
            validity_days: Optional[str] = None) -> ClientCertificate
    func GetClientCertificate(ctx *Context, name string, id IDInput, state *ClientCertificateState, opts ...ResourceOption) (*ClientCertificate, error)
    public static ClientCertificate Get(string name, Input<string> id, ClientCertificateState? state, CustomResourceOptions? opts = null)
    public static ClientCertificate get(String name, Output<String> id, ClientCertificateState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:esa:ClientCertificate    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:
    ClientCertId string
    ClientCertificate Id
    CreateTime string
    The time when the certificate was created.
    Csr string

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    PkeyType string

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    SiteId string
    Site Id
    Status string
    The certificate status. Valid values: revoked, active.
    ValidityDays string

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    ClientCertId string
    ClientCertificate Id
    CreateTime string
    The time when the certificate was created.
    Csr string

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    PkeyType string

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    SiteId string
    Site Id
    Status string
    The certificate status. Valid values: revoked, active.
    ValidityDays string

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    clientCertId String
    ClientCertificate Id
    createTime String
    The time when the certificate was created.
    csr String

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    pkeyType String

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    siteId String
    Site Id
    status String
    The certificate status. Valid values: revoked, active.
    validityDays String

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    clientCertId string
    ClientCertificate Id
    createTime string
    The time when the certificate was created.
    csr string

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    pkeyType string

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    siteId string
    Site Id
    status string
    The certificate status. Valid values: revoked, active.
    validityDays string

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    client_cert_id str
    ClientCertificate Id
    create_time str
    The time when the certificate was created.
    csr str

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    pkey_type str

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    site_id str
    Site Id
    status str
    The certificate status. Valid values: revoked, active.
    validity_days str

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    clientCertId String
    ClientCertificate Id
    createTime String
    The time when the certificate was created.
    csr String

    Certificate signing request content.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    pkeyType String

    The private key algorithm type.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    siteId String
    Site Id
    status String
    The certificate status. Valid values: revoked, active.
    validityDays String

    Certificate validity period.

    NOTE: The parameter is immutable after resource creation. It only applies during resource creation and has no effect when modified post-creation.

    Import

    ESA Client Certificate can be imported using the id, e.g.

    $ pulumi import alicloud:esa/clientCertificate:ClientCertificate example <site_id>:<client_cert_id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.96.0 published on Tuesday, Mar 3, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate