1. Packages
  2. Volcengine
  3. API Docs
  4. cdn
  5. CdnCertificate
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.cdn.CdnCertificate

Explore with Pulumi AI

Provides a resource to manage cdn certificate

Example Usage

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

const foo = new volcengine.cdn.CdnCertificate("foo", {
    certificate: "",
    desc: "tftest",
    privateKey: "",
    source: "cdn_cert_hosting",
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo = volcengine.cdn.CdnCertificate("foo",
    certificate="",
    desc="tftest",
    private_key="",
    source="cdn_cert_hosting")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/cdn"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cdn.NewCdnCertificate(ctx, "foo", &cdn.CdnCertificateArgs{
			Certificate: pulumi.String(""),
			Desc:        pulumi.String("tftest"),
			PrivateKey:  pulumi.String(""),
			Source:      pulumi.String("cdn_cert_hosting"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var foo = new Volcengine.Cdn.CdnCertificate("foo", new()
    {
        Certificate = "",
        Desc = "tftest",
        PrivateKey = "",
        Source = "cdn_cert_hosting",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.cdn.CdnCertificate;
import com.pulumi.volcengine.cdn.CdnCertificateArgs;
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 foo = new CdnCertificate("foo", CdnCertificateArgs.builder()        
            .certificate("")
            .desc("tftest")
            .privateKey("")
            .source("cdn_cert_hosting")
            .build());

    }
}
Copy
resources:
  foo:
    type: volcengine:cdn:CdnCertificate
    properties:
      certificate:
      desc: tftest
      privateKey:
      source: cdn_cert_hosting
Copy

Create CdnCertificate Resource

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

Constructor syntax

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

@overload
def CdnCertificate(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   certificate: Optional[str] = None,
                   desc: Optional[str] = None,
                   private_key: Optional[str] = None,
                   source: Optional[str] = None)
func NewCdnCertificate(ctx *Context, name string, args CdnCertificateArgs, opts ...ResourceOption) (*CdnCertificate, error)
public CdnCertificate(string name, CdnCertificateArgs args, CustomResourceOptions? opts = null)
public CdnCertificate(String name, CdnCertificateArgs args)
public CdnCertificate(String name, CdnCertificateArgs args, CustomResourceOptions options)
type: volcengine:cdn:CdnCertificate
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. CdnCertificateArgs
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. CdnCertificateArgs
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. CdnCertificateArgs
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. CdnCertificateArgs
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. CdnCertificateArgs
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 cdnCertificateResource = new Volcengine.Cdn.CdnCertificate("cdnCertificateResource", new()
{
    Certificate = "string",
    Desc = "string",
    PrivateKey = "string",
    Source = "string",
});
Copy
example, err := cdn.NewCdnCertificate(ctx, "cdnCertificateResource", &cdn.CdnCertificateArgs{
	Certificate: pulumi.String("string"),
	Desc:        pulumi.String("string"),
	PrivateKey:  pulumi.String("string"),
	Source:      pulumi.String("string"),
})
Copy
var cdnCertificateResource = new CdnCertificate("cdnCertificateResource", CdnCertificateArgs.builder()
    .certificate("string")
    .desc("string")
    .privateKey("string")
    .source("string")
    .build());
Copy
cdn_certificate_resource = volcengine.cdn.CdnCertificate("cdnCertificateResource",
    certificate="string",
    desc="string",
    private_key="string",
    source="string")
Copy
const cdnCertificateResource = new volcengine.cdn.CdnCertificate("cdnCertificateResource", {
    certificate: "string",
    desc: "string",
    privateKey: "string",
    source: "string",
});
Copy
type: volcengine:cdn:CdnCertificate
properties:
    certificate: string
    desc: string
    privateKey: string
    source: string
Copy

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

Certificate
This property is required.
Changes to this property will trigger replacement.
string
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
Desc
This property is required.
Changes to this property will trigger replacement.
string
Note on the certificate.
PrivateKey
This property is required.
Changes to this property will trigger replacement.
string
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
Source
This property is required.
Changes to this property will trigger replacement.
string
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
Certificate
This property is required.
Changes to this property will trigger replacement.
string
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
Desc
This property is required.
Changes to this property will trigger replacement.
string
Note on the certificate.
PrivateKey
This property is required.
Changes to this property will trigger replacement.
string
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
Source
This property is required.
Changes to this property will trigger replacement.
string
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
certificate
This property is required.
Changes to this property will trigger replacement.
String
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
desc
This property is required.
Changes to this property will trigger replacement.
String
Note on the certificate.
privateKey
This property is required.
Changes to this property will trigger replacement.
String
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
source
This property is required.
Changes to this property will trigger replacement.
String
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
certificate
This property is required.
Changes to this property will trigger replacement.
string
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
desc
This property is required.
Changes to this property will trigger replacement.
string
Note on the certificate.
privateKey
This property is required.
Changes to this property will trigger replacement.
string
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
source
This property is required.
Changes to this property will trigger replacement.
string
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
certificate
This property is required.
Changes to this property will trigger replacement.
str
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
desc
This property is required.
Changes to this property will trigger replacement.
str
Note on the certificate.
private_key
This property is required.
Changes to this property will trigger replacement.
str
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
source
This property is required.
Changes to this property will trigger replacement.
str
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
certificate
This property is required.
Changes to this property will trigger replacement.
String
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
desc
This property is required.
Changes to this property will trigger replacement.
String
Note on the certificate.
privateKey
This property is required.
Changes to this property will trigger replacement.
String
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
source
This property is required.
Changes to this property will trigger replacement.
String
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.

Outputs

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

Get an existing CdnCertificate 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?: CdnCertificateState, opts?: CustomResourceOptions): CdnCertificate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        certificate: Optional[str] = None,
        desc: Optional[str] = None,
        private_key: Optional[str] = None,
        source: Optional[str] = None) -> CdnCertificate
func GetCdnCertificate(ctx *Context, name string, id IDInput, state *CdnCertificateState, opts ...ResourceOption) (*CdnCertificate, error)
public static CdnCertificate Get(string name, Input<string> id, CdnCertificateState? state, CustomResourceOptions? opts = null)
public static CdnCertificate get(String name, Output<String> id, CdnCertificateState state, CustomResourceOptions options)
resources:  _:    type: volcengine:cdn:CdnCertificate    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:
Certificate Changes to this property will trigger replacement. string
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
Desc Changes to this property will trigger replacement. string
Note on the certificate.
PrivateKey Changes to this property will trigger replacement. string
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
Source Changes to this property will trigger replacement. string
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
Certificate Changes to this property will trigger replacement. string
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
Desc Changes to this property will trigger replacement. string
Note on the certificate.
PrivateKey Changes to this property will trigger replacement. string
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
Source Changes to this property will trigger replacement. string
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
certificate Changes to this property will trigger replacement. String
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
desc Changes to this property will trigger replacement. String
Note on the certificate.
privateKey Changes to this property will trigger replacement. String
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
source Changes to this property will trigger replacement. String
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
certificate Changes to this property will trigger replacement. string
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
desc Changes to this property will trigger replacement. string
Note on the certificate.
privateKey Changes to this property will trigger replacement. string
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
source Changes to this property will trigger replacement. string
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
certificate Changes to this property will trigger replacement. str
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
desc Changes to this property will trigger replacement. str
Note on the certificate.
private_key Changes to this property will trigger replacement. str
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
source Changes to this property will trigger replacement. str
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.
certificate Changes to this property will trigger replacement. String
Content of the specified certificate public key file. Line breaks in the content should be replaced with \r\n. The file extension for the certificate public key is .crt or .pem. The public key must include the complete certificate chain. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
desc Changes to this property will trigger replacement. String
Note on the certificate.
privateKey Changes to this property will trigger replacement. String
The content of the specified certificate private key file. Replace line breaks in the content with \r\n. The file extension for the certificate private key is .key or .pem. The private key must be unencrypted. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
source Changes to this property will trigger replacement. String
Specify the location for storing the certificate. The parameter can take the following values: volc_cert_center: indicates that the certificate will be stored in the certificate center.cdn_cert_hosting: indicates that the certificate will be hosted on the content delivery network.

Import

CdnCertificate can be imported using the id, e.g.

$ pulumi import volcengine:cdn/cdnCertificate:CdnCertificate default resource_id
Copy

You can delete the certificate hosted on the content delivery network. You can configure the HTTPS module to associate the certificate and domain name through the domain_config field of volcengine_cdn_domain. If the certificate to be deleted is already associated with a domain name, the deletion will fail. To remove the association between the domain name and the certificate, you can disable the HTTPS function for the domain name in the Content Delivery Network console.

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

Package Details

Repository
volcengine volcengine/pulumi-volcengine
License
Apache-2.0
Notes
This Pulumi package is based on the volcengine Terraform Provider.