Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

ServiceCertificate

Provides a SSL Certificates Certificate resource.

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

NOTE: Available in v1.129.0+.

Example Usage

using System.IO;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new AliCloud.Cas.ServiceCertificate("example", new AliCloud.Cas.ServiceCertificateArgs
        {
            CertificateName = "test",
            Cert = File.ReadAllText($"{path.Module}/test.crt"),
            Key = File.ReadAllText($"{path.Module}/test.key"),
        });
    }

}
package main

import (
	"fmt"
	"io/ioutil"

	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cas.NewServiceCertificate(ctx, "example", &cas.ServiceCertificateArgs{
			CertificateName: pulumi.String("test"),
			Cert:            readFileOrPanic(fmt.Sprintf("%v/test.crt", path.Module)),
			Key:             readFileOrPanic(fmt.Sprintf("%v/test.key", path.Module)),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cas.ServiceCertificate;
import com.pulumi.alicloud.cas.ServiceCertificateArgs;
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 example = new ServiceCertificate("example", ServiceCertificateArgs.builder()        
            .certificateName("test")
            .cert(Files.readString(Paths.get(String.format("%s/test.crt", path.module()))))
            .key(Files.readString(Paths.get(String.format("%s/test.key", path.module()))))
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.cas.ServiceCertificate("example",
    certificate_name="test",
    cert=(lambda path: open(path).read())(f"{path['module']}/test.crt"),
    key=(lambda path: open(path).read())(f"{path['module']}/test.key"))
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as fs from "fs";

const example = new alicloud.cas.ServiceCertificate("example", {
    certificateName: "test",
    cert: fs.readFileSync(`${path.module}/test.crt`),
    key: fs.readFileSync(`${path.module}/test.key`),
});

Coming soon!

Create a ServiceCertificate Resource

new ServiceCertificate(name: string, args: ServiceCertificateArgs, opts?: CustomResourceOptions);
@overload
def ServiceCertificate(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       cert: Optional[str] = None,
                       certificate_name: Optional[str] = None,
                       key: Optional[str] = None,
                       lang: Optional[str] = None,
                       name: Optional[str] = None)
@overload
def ServiceCertificate(resource_name: str,
                       args: ServiceCertificateArgs,
                       opts: Optional[ResourceOptions] = None)
func NewServiceCertificate(ctx *Context, name string, args ServiceCertificateArgs, opts ...ResourceOption) (*ServiceCertificate, error)
public ServiceCertificate(string name, ServiceCertificateArgs args, CustomResourceOptions? opts = null)
public ServiceCertificate(String name, ServiceCertificateArgs args)
public ServiceCertificate(String name, ServiceCertificateArgs args, CustomResourceOptions options)
type: alicloud:cas:ServiceCertificate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ServiceCertificateArgs
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 ServiceCertificateArgs
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 ServiceCertificateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ServiceCertificateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ServiceCertificateArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ServiceCertificate Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ServiceCertificate resource accepts the following input properties:

Cert string

Cert of the Certificate in which the Certificate will add.

Key string

Key of the Certificate in which the Certificate will add.

CertificateName string

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

Lang string

The lang.

Name string

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

Cert string

Cert of the Certificate in which the Certificate will add.

Key string

Key of the Certificate in which the Certificate will add.

CertificateName string

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

Lang string

The lang.

Name string

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

cert String

Cert of the Certificate in which the Certificate will add.

key String

Key of the Certificate in which the Certificate will add.

certificateName String

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

lang String

The lang.

name String

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

cert string

Cert of the Certificate in which the Certificate will add.

key string

Key of the Certificate in which the Certificate will add.

certificateName string

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

lang string

The lang.

name string

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

cert str

Cert of the Certificate in which the Certificate will add.

key str

Key of the Certificate in which the Certificate will add.

certificate_name str

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

lang str

The lang.

name str

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

cert String

Cert of the Certificate in which the Certificate will add.

key String

Key of the Certificate in which the Certificate will add.

certificateName String

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

lang String

The lang.

name String

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

Outputs

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

Get an existing ServiceCertificate 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?: ServiceCertificateState, opts?: CustomResourceOptions): ServiceCertificate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cert: Optional[str] = None,
        certificate_name: Optional[str] = None,
        key: Optional[str] = None,
        lang: Optional[str] = None,
        name: Optional[str] = None) -> ServiceCertificate
func GetServiceCertificate(ctx *Context, name string, id IDInput, state *ServiceCertificateState, opts ...ResourceOption) (*ServiceCertificate, error)
public static ServiceCertificate Get(string name, Input<string> id, ServiceCertificateState? state, CustomResourceOptions? opts = null)
public static ServiceCertificate get(String name, Output<String> id, ServiceCertificateState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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:
Cert string

Cert of the Certificate in which the Certificate will add.

CertificateName string

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

Key string

Key of the Certificate in which the Certificate will add.

Lang string

The lang.

Name string

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

Cert string

Cert of the Certificate in which the Certificate will add.

CertificateName string

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

Key string

Key of the Certificate in which the Certificate will add.

Lang string

The lang.

Name string

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

cert String

Cert of the Certificate in which the Certificate will add.

certificateName String

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

key String

Key of the Certificate in which the Certificate will add.

lang String

The lang.

name String

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

cert string

Cert of the Certificate in which the Certificate will add.

certificateName string

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

key string

Key of the Certificate in which the Certificate will add.

lang string

The lang.

name string

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

cert str

Cert of the Certificate in which the Certificate will add.

certificate_name str

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

key str

Key of the Certificate in which the Certificate will add.

lang str

The lang.

name str

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

cert String

Cert of the Certificate in which the Certificate will add.

certificateName String

Name of the Certificate. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix .sh and .tel are not supported. NOTE: One of certificate_name and name must be specified.

key String

Key of the Certificate in which the Certificate will add.

lang String

The lang.

name String

It has been deprecated from version 1.129.0 and using certificate_name instead.

Deprecated:

attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.

Import

SSL Certificates Certificate can be imported using the id, e.g.

 $ pulumi import alicloud:cas/serviceCertificate:ServiceCertificate example <id>

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.