1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. esa
  5. Certificate
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.esa.Certificate

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

    Provides a ESA Certificate resource.

    For information about ESA Certificate and how to use it, see What is 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 defaultCertificate = new alicloud.esa.Certificate("default", {
        createdType: "free",
        domains: "101.gositecdn.cn",
        siteId: _default.then(_default => _default.sites?.[0]?.id),
        type: "lets_encrypt",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.esa.get_sites(plan_subscribe_type="enterpriseplan",
        site_name="gositecdn.cn")
    default_certificate = alicloud.esa.Certificate("default",
        created_type="free",
        domains="101.gositecdn.cn",
        site_id=default.sites[0].id,
        type="lets_encrypt")
    
    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.NewCertificate(ctx, "default", &esa.CertificateArgs{
    			CreatedType: pulumi.String("free"),
    			Domains:     pulumi.String("101.gositecdn.cn"),
    			SiteId:      pulumi.Int(_default.Sites[0].Id),
    			Type:        pulumi.String("lets_encrypt"),
    		})
    		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 defaultCertificate = new AliCloud.Esa.Certificate("default", new()
        {
            CreatedType = "free",
            Domains = "101.gositecdn.cn",
            SiteId = @default.Apply(@default => @default.Apply(getSitesResult => getSitesResult.Sites[0]?.Id)),
            Type = "lets_encrypt",
        });
    
    });
    
    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.Certificate;
    import com.pulumi.alicloud.esa.CertificateArgs;
    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 defaultCertificate = new Certificate("defaultCertificate", CertificateArgs.builder()
                .createdType("free")
                .domains("101.gositecdn.cn")
                .siteId(default_.sites()[0].id())
                .type("lets_encrypt")
                .build());
    
        }
    }
    
    resources:
      defaultCertificate:
        type: alicloud:esa:Certificate
        name: default
        properties:
          createdType: free
          domains: 101.gositecdn.cn
          siteId: ${default.sites[0].id}
          type: lets_encrypt
    variables:
      default:
        fn::invoke:
          function: alicloud:esa:getSites
          arguments:
            planSubscribeType: enterpriseplan
            siteName: gositecdn.cn
    

    Create Certificate Resource

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

    Constructor syntax

    new Certificate(name: string, args: CertificateArgs, opts?: CustomResourceOptions);
    @overload
    def Certificate(resource_name: str,
                    args: CertificateArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def Certificate(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    created_type: Optional[str] = None,
                    site_id: Optional[int] = None,
                    cas_id: Optional[str] = None,
                    cert_id: Optional[str] = None,
                    cert_name: Optional[str] = None,
                    certificate: Optional[str] = None,
                    domains: Optional[str] = None,
                    private_key: Optional[str] = None,
                    region: Optional[str] = None,
                    type: Optional[str] = None)
    func NewCertificate(ctx *Context, name string, args CertificateArgs, opts ...ResourceOption) (*Certificate, error)
    public Certificate(string name, CertificateArgs args, CustomResourceOptions? opts = null)
    public Certificate(String name, CertificateArgs args)
    public Certificate(String name, CertificateArgs args, CustomResourceOptions options)
    
    type: alicloud:esa:Certificate
    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 CertificateArgs
    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 CertificateArgs
    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 CertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CertificateArgs
    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 certificateResource = new AliCloud.Esa.Certificate("certificateResource", new()
    {
        CreatedType = "string",
        SiteId = 0,
        CasId = "string",
        CertId = "string",
        CertName = "string",
        CertificateValue = "string",
        Domains = "string",
        PrivateKey = "string",
        Region = "string",
        Type = "string",
    });
    
    example, err := esa.NewCertificate(ctx, "certificateResource", &esa.CertificateArgs{
    	CreatedType: pulumi.String("string"),
    	SiteId:      pulumi.Int(0),
    	CasId:       pulumi.String("string"),
    	CertId:      pulumi.String("string"),
    	CertName:    pulumi.String("string"),
    	Certificate: pulumi.String("string"),
    	Domains:     pulumi.String("string"),
    	PrivateKey:  pulumi.String("string"),
    	Region:      pulumi.String("string"),
    	Type:        pulumi.String("string"),
    })
    
    var certificateResource = new com.pulumi.alicloud.esa.Certificate("certificateResource", com.pulumi.alicloud.esa.CertificateArgs.builder()
        .createdType("string")
        .siteId(0)
        .casId("string")
        .certId("string")
        .certName("string")
        .certificate("string")
        .domains("string")
        .privateKey("string")
        .region("string")
        .type("string")
        .build());
    
    certificate_resource = alicloud.esa.Certificate("certificateResource",
        created_type="string",
        site_id=0,
        cas_id="string",
        cert_id="string",
        cert_name="string",
        certificate="string",
        domains="string",
        private_key="string",
        region="string",
        type="string")
    
    const certificateResource = new alicloud.esa.Certificate("certificateResource", {
        createdType: "string",
        siteId: 0,
        casId: "string",
        certId: "string",
        certName: "string",
        certificate: "string",
        domains: "string",
        privateKey: "string",
        region: "string",
        type: "string",
    });
    
    type: alicloud:esa:Certificate
    properties:
        casId: string
        certId: string
        certName: string
        certificate: string
        createdType: string
        domains: string
        privateKey: string
        region: string
        siteId: 0
        type: string
    

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

    CreatedType string
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    SiteId int
    The site ID, which can be obtained by calling the ListSites interface.
    CasId string
    Cloud certificate ID.
    CertId string
    The certificate Id.
    CertName string
    The certificate name.
    CertificateValue string
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    Domains string
    A list of domain names. Multiple domain names are separated by commas.
    PrivateKey string
    The certificate private key.
    Region string
    Geographical information.
    Type string
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    CreatedType string
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    SiteId int
    The site ID, which can be obtained by calling the ListSites interface.
    CasId string
    Cloud certificate ID.
    CertId string
    The certificate Id.
    CertName string
    The certificate name.
    Certificate string
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    Domains string
    A list of domain names. Multiple domain names are separated by commas.
    PrivateKey string
    The certificate private key.
    Region string
    Geographical information.
    Type string
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    createdType String
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    siteId Integer
    The site ID, which can be obtained by calling the ListSites interface.
    casId String
    Cloud certificate ID.
    certId String
    The certificate Id.
    certName String
    The certificate name.
    certificate String
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    domains String
    A list of domain names. Multiple domain names are separated by commas.
    privateKey String
    The certificate private key.
    region String
    Geographical information.
    type String
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    createdType string
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    siteId number
    The site ID, which can be obtained by calling the ListSites interface.
    casId string
    Cloud certificate ID.
    certId string
    The certificate Id.
    certName string
    The certificate name.
    certificate string
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    domains string
    A list of domain names. Multiple domain names are separated by commas.
    privateKey string
    The certificate private key.
    region string
    Geographical information.
    type string
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    created_type str
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    site_id int
    The site ID, which can be obtained by calling the ListSites interface.
    cas_id str
    Cloud certificate ID.
    cert_id str
    The certificate Id.
    cert_name str
    The certificate name.
    certificate str
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    domains str
    A list of domain names. Multiple domain names are separated by commas.
    private_key str
    The certificate private key.
    region str
    Geographical information.
    type str
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    createdType String
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    siteId Number
    The site ID, which can be obtained by calling the ListSites interface.
    casId String
    Cloud certificate ID.
    certId String
    The certificate Id.
    certName String
    The certificate name.
    certificate String
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    domains String
    A list of domain names. Multiple domain names are separated by commas.
    privateKey String
    The certificate private key.
    region String
    Geographical information.
    type String
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;

    Outputs

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

    CreateTime string
    Creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    CreateTime string
    Creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    createTime String
    Creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    createTime string
    Creation time.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    create_time str
    Creation time.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    createTime String
    Creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.

    Look up Existing Certificate Resource

    Get an existing Certificate 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?: CertificateState, opts?: CustomResourceOptions): Certificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cas_id: Optional[str] = None,
            cert_id: Optional[str] = None,
            cert_name: Optional[str] = None,
            certificate: Optional[str] = None,
            create_time: Optional[str] = None,
            created_type: Optional[str] = None,
            domains: Optional[str] = None,
            private_key: Optional[str] = None,
            region: Optional[str] = None,
            site_id: Optional[int] = None,
            status: Optional[str] = None,
            type: Optional[str] = None) -> Certificate
    func GetCertificate(ctx *Context, name string, id IDInput, state *CertificateState, opts ...ResourceOption) (*Certificate, error)
    public static Certificate Get(string name, Input<string> id, CertificateState? state, CustomResourceOptions? opts = null)
    public static Certificate get(String name, Output<String> id, CertificateState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:esa:Certificate    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:
    CasId string
    Cloud certificate ID.
    CertId string
    The certificate Id.
    CertName string
    The certificate name.
    CertificateValue string
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    CreateTime string
    Creation time.
    CreatedType string
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    Domains string
    A list of domain names. Multiple domain names are separated by commas.
    PrivateKey string
    The certificate private key.
    Region string
    Geographical information.
    SiteId int
    The site ID, which can be obtained by calling the ListSites interface.
    Status string
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    Type string
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    CasId string
    Cloud certificate ID.
    CertId string
    The certificate Id.
    CertName string
    The certificate name.
    Certificate string
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    CreateTime string
    Creation time.
    CreatedType string
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    Domains string
    A list of domain names. Multiple domain names are separated by commas.
    PrivateKey string
    The certificate private key.
    Region string
    Geographical information.
    SiteId int
    The site ID, which can be obtained by calling the ListSites interface.
    Status string
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    Type string
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    casId String
    Cloud certificate ID.
    certId String
    The certificate Id.
    certName String
    The certificate name.
    certificate String
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    createTime String
    Creation time.
    createdType String
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    domains String
    A list of domain names. Multiple domain names are separated by commas.
    privateKey String
    The certificate private key.
    region String
    Geographical information.
    siteId Integer
    The site ID, which can be obtained by calling the ListSites interface.
    status String
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    type String
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    casId string
    Cloud certificate ID.
    certId string
    The certificate Id.
    certName string
    The certificate name.
    certificate string
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    createTime string
    Creation time.
    createdType string
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    domains string
    A list of domain names. Multiple domain names are separated by commas.
    privateKey string
    The certificate private key.
    region string
    Geographical information.
    siteId number
    The site ID, which can be obtained by calling the ListSites interface.
    status string
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    type string
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    cas_id str
    Cloud certificate ID.
    cert_id str
    The certificate Id.
    cert_name str
    The certificate name.
    certificate str
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    create_time str
    Creation time.
    created_type str
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    domains str
    A list of domain names. Multiple domain names are separated by commas.
    private_key str
    The certificate private key.
    region str
    Geographical information.
    site_id int
    The site ID, which can be obtained by calling the ListSites interface.
    status str
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    type str
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;
    casId String
    Cloud certificate ID.
    certId String
    The certificate Id.
    certName String
    The certificate name.
    certificate String
    The certificate type. Valid values:

    • cas: a certificate purchased by using Certificate Management Service.
    • upload: a custom certificate that you upload.
    createTime String
    Creation time.
    createdType String
    The certificate type.

    • cas (Certificate Center Certificate)
    • upload (custom upload certificate)
    • free( Free certificate).
    domains String
    A list of domain names. Multiple domain names are separated by commas.
    privateKey String
    The certificate private key.
    region String
    Geographical information.
    siteId Number
    The site ID, which can be obtained by calling the ListSites interface.
    status String
    Certificate status.(within 30 days).- issued.- applying.- application failed.- canceled.
    type String
    Certificate type. Possible values: lets_encrypt: Let's Encrypt certificate;

    Import

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

    $ pulumi import alicloud:esa/certificate:Certificate example <site_id>:<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.76.0 published on Tuesday, Apr 8, 2025 by Pulumi