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

alicloud.waf.Certificate

Explore with Pulumi AI

Provides a WAF Certificate resource.

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

NOTE: Available in v1.135.0+.

Example Usage

Basic Usage

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

const _default = new alicloud.waf.Certificate("default", {
    certificateName: "your_certificate_name",
    instanceId: "your_instance_id",
    domain: "your_domain_name",
    privateKey: "your_private_key",
    certificate: "your_certificate",
});
const default2 = new alicloud.waf.Certificate("default2", {
    instanceId: "your_instance_id",
    domain: "your_domain_name",
    certificateId: "your_certificate_id",
});
Copy
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.waf.Certificate("default",
    certificate_name="your_certificate_name",
    instance_id="your_instance_id",
    domain="your_domain_name",
    private_key="your_private_key",
    certificate="your_certificate")
default2 = alicloud.waf.Certificate("default2",
    instance_id="your_instance_id",
    domain="your_domain_name",
    certificate_id="your_certificate_id")
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/waf"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := waf.NewCertificate(ctx, "default", &waf.CertificateArgs{
			CertificateName: pulumi.String("your_certificate_name"),
			InstanceId:      pulumi.String("your_instance_id"),
			Domain:          pulumi.String("your_domain_name"),
			PrivateKey:      pulumi.String("your_private_key"),
			Certificate:     pulumi.String("your_certificate"),
		})
		if err != nil {
			return err
		}
		_, err = waf.NewCertificate(ctx, "default2", &waf.CertificateArgs{
			InstanceId:    pulumi.String("your_instance_id"),
			Domain:        pulumi.String("your_domain_name"),
			CertificateId: pulumi.String("your_certificate_id"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var @default = new AliCloud.Waf.Certificate("default", new()
    {
        CertificateName = "your_certificate_name",
        InstanceId = "your_instance_id",
        Domain = "your_domain_name",
        PrivateKey = "your_private_key",
        CertificateContents = "your_certificate",
    });

    var default2 = new AliCloud.Waf.Certificate("default2", new()
    {
        InstanceId = "your_instance_id",
        Domain = "your_domain_name",
        CertificateId = "your_certificate_id",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.waf.Certificate;
import com.pulumi.alicloud.waf.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) {
        var default_ = new Certificate("default", CertificateArgs.builder()
            .certificateName("your_certificate_name")
            .instanceId("your_instance_id")
            .domain("your_domain_name")
            .privateKey("your_private_key")
            .certificate("your_certificate")
            .build());

        var default2 = new Certificate("default2", CertificateArgs.builder()
            .instanceId("your_instance_id")
            .domain("your_domain_name")
            .certificateId("your_certificate_id")
            .build());

    }
}
Copy
resources:
  default:
    type: alicloud:waf:Certificate
    properties:
      certificateName: your_certificate_name
      instanceId: your_instance_id
      domain: your_domain_name
      privateKey: your_private_key
      certificate: your_certificate
  default2:
    type: alicloud:waf:Certificate
    properties:
      instanceId: your_instance_id
      domain: your_domain_name
      certificateId: your_certificate_id
Copy

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,
                domain: Optional[str] = None,
                instance_id: Optional[str] = None,
                certificate: Optional[str] = None,
                certificate_id: Optional[str] = None,
                certificate_name: Optional[str] = None,
                private_key: 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:waf:Certificate
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. CertificateArgs
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. 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 This property is required. string
The unique name of the resource.
args This property is required. CertificateArgs
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. CertificateArgs
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. 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 alicloudCertificateResource = new AliCloud.Waf.Certificate("alicloudCertificateResource", new()
{
    Domain = "string",
    InstanceId = "string",
    CertificateContents = "string",
    CertificateId = "string",
    CertificateName = "string",
    PrivateKey = "string",
});
Copy
example, err := waf.NewCertificate(ctx, "alicloudCertificateResource", &waf.CertificateArgs{
	Domain:          pulumi.String("string"),
	InstanceId:      pulumi.String("string"),
	Certificate:     pulumi.String("string"),
	CertificateId:   pulumi.String("string"),
	CertificateName: pulumi.String("string"),
	PrivateKey:      pulumi.String("string"),
})
Copy
var alicloudCertificateResource = new Certificate("alicloudCertificateResource", CertificateArgs.builder()
    .domain("string")
    .instanceId("string")
    .certificate("string")
    .certificateId("string")
    .certificateName("string")
    .privateKey("string")
    .build());
Copy
alicloud_certificate_resource = alicloud.waf.Certificate("alicloudCertificateResource",
    domain="string",
    instance_id="string",
    certificate="string",
    certificate_id="string",
    certificate_name="string",
    private_key="string")
Copy
const alicloudCertificateResource = new alicloud.waf.Certificate("alicloudCertificateResource", {
    domain: "string",
    instanceId: "string",
    certificate: "string",
    certificateId: "string",
    certificateName: "string",
    privateKey: "string",
});
Copy
type: alicloud:waf:Certificate
properties:
    certificate: string
    certificateId: string
    certificateName: string
    domain: string
    instanceId: string
    privateKey: string
Copy

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:

Domain
This property is required.
Changes to this property will trigger replacement.
string
The domain that you want to add to WAF.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the WAF instance.
CertificateContents Changes to this property will trigger replacement. string
Certificate file content.
CertificateId Changes to this property will trigger replacement. string
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
CertificateName Changes to this property will trigger replacement. string
Certificate file name.
PrivateKey Changes to this property will trigger replacement. string
The private key.
Domain
This property is required.
Changes to this property will trigger replacement.
string
The domain that you want to add to WAF.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the WAF instance.
Certificate Changes to this property will trigger replacement. string
Certificate file content.
CertificateId Changes to this property will trigger replacement. string
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
CertificateName Changes to this property will trigger replacement. string
Certificate file name.
PrivateKey Changes to this property will trigger replacement. string
The private key.
domain
This property is required.
Changes to this property will trigger replacement.
String
The domain that you want to add to WAF.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the WAF instance.
certificate Changes to this property will trigger replacement. String
Certificate file content.
certificateId Changes to this property will trigger replacement. String
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
certificateName Changes to this property will trigger replacement. String
Certificate file name.
privateKey Changes to this property will trigger replacement. String
The private key.
domain
This property is required.
Changes to this property will trigger replacement.
string
The domain that you want to add to WAF.
instanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the WAF instance.
certificate Changes to this property will trigger replacement. string
Certificate file content.
certificateId Changes to this property will trigger replacement. string
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
certificateName Changes to this property will trigger replacement. string
Certificate file name.
privateKey Changes to this property will trigger replacement. string
The private key.
domain
This property is required.
Changes to this property will trigger replacement.
str
The domain that you want to add to WAF.
instance_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the WAF instance.
certificate Changes to this property will trigger replacement. str
Certificate file content.
certificate_id Changes to this property will trigger replacement. str
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
certificate_name Changes to this property will trigger replacement. str
Certificate file name.
private_key Changes to this property will trigger replacement. str
The private key.
domain
This property is required.
Changes to this property will trigger replacement.
String
The domain that you want to add to WAF.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the WAF instance.
certificate Changes to this property will trigger replacement. String
Certificate file content.
certificateId Changes to this property will trigger replacement. String
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
certificateName Changes to this property will trigger replacement. String
Certificate file name.
privateKey Changes to this property will trigger replacement. String
The private key.

Outputs

All input properties are implicitly available as output properties. Additionally, the Certificate 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 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,
        certificate: Optional[str] = None,
        certificate_id: Optional[str] = None,
        certificate_name: Optional[str] = None,
        domain: Optional[str] = None,
        instance_id: Optional[str] = None,
        private_key: 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:waf:Certificate    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:
CertificateContents Changes to this property will trigger replacement. string
Certificate file content.
CertificateId Changes to this property will trigger replacement. string
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
CertificateName Changes to this property will trigger replacement. string
Certificate file name.
Domain Changes to this property will trigger replacement. string
The domain that you want to add to WAF.
InstanceId Changes to this property will trigger replacement. string
The ID of the WAF instance.
PrivateKey Changes to this property will trigger replacement. string
The private key.
Certificate Changes to this property will trigger replacement. string
Certificate file content.
CertificateId Changes to this property will trigger replacement. string
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
CertificateName Changes to this property will trigger replacement. string
Certificate file name.
Domain Changes to this property will trigger replacement. string
The domain that you want to add to WAF.
InstanceId Changes to this property will trigger replacement. string
The ID of the WAF instance.
PrivateKey Changes to this property will trigger replacement. string
The private key.
certificate Changes to this property will trigger replacement. String
Certificate file content.
certificateId Changes to this property will trigger replacement. String
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
certificateName Changes to this property will trigger replacement. String
Certificate file name.
domain Changes to this property will trigger replacement. String
The domain that you want to add to WAF.
instanceId Changes to this property will trigger replacement. String
The ID of the WAF instance.
privateKey Changes to this property will trigger replacement. String
The private key.
certificate Changes to this property will trigger replacement. string
Certificate file content.
certificateId Changes to this property will trigger replacement. string
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
certificateName Changes to this property will trigger replacement. string
Certificate file name.
domain Changes to this property will trigger replacement. string
The domain that you want to add to WAF.
instanceId Changes to this property will trigger replacement. string
The ID of the WAF instance.
privateKey Changes to this property will trigger replacement. string
The private key.
certificate Changes to this property will trigger replacement. str
Certificate file content.
certificate_id Changes to this property will trigger replacement. str
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
certificate_name Changes to this property will trigger replacement. str
Certificate file name.
domain Changes to this property will trigger replacement. str
The domain that you want to add to WAF.
instance_id Changes to this property will trigger replacement. str
The ID of the WAF instance.
private_key Changes to this property will trigger replacement. str
The private key.
certificate Changes to this property will trigger replacement. String
Certificate file content.
certificateId Changes to this property will trigger replacement. String
The certificate id is automatically generated when you upload your certificate content.NOTE: you can also use Certificate ID saved in SSL.
certificateName Changes to this property will trigger replacement. String
Certificate file name.
domain Changes to this property will trigger replacement. String
The domain that you want to add to WAF.
instanceId Changes to this property will trigger replacement. String
The ID of the WAF instance.
privateKey Changes to this property will trigger replacement. String
The private key.

Import

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

$ pulumi import alicloud:waf/certificate:Certificate example <instance_id>:<domain>:<certificate_id>
Copy

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.