alicloud logo
Alibaba Cloud v3.38.0, Jun 2 23

alicloud.cas.getCertificates

Explore with Pulumi AI

Deprecated:

This resource has been deprecated in favour of getServiceCertificates

DEPRECATED: This datasource has been deprecated from version 1.129.0. Please use new datasource alicloud_ssl_certificates_service_certificates.

This data source provides a list of CAS Certificates in an Alibaba Cloud account according to the specified filters.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var certs = AliCloud.Cas.GetCertificates.Invoke(new()
    {
        NameRegex = "^cas",
        OutputFile = $"{path.Module}/cas_certificates.json",
    });

    return new Dictionary<string, object?>
    {
        ["cert"] = certs.Apply(getCertificatesResult => getCertificatesResult.Certificates[0]?.Id),
    };
});
package main

import (
	"fmt"

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		certs, err := cas.GetCertificates(ctx, &cas.GetCertificatesArgs{
			NameRegex:  pulumi.StringRef("^cas"),
			OutputFile: pulumi.StringRef(fmt.Sprintf("%v/cas_certificates.json", path.Module)),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("cert", certs.Certificates[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cas.CasFunctions;
import com.pulumi.alicloud.cas.inputs.GetCertificatesArgs;
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 certs = CasFunctions.getCertificates(GetCertificatesArgs.builder()
            .nameRegex("^cas")
            .outputFile(String.format("%s/cas_certificates.json", path.module()))
            .build());

        ctx.export("cert", certs.applyValue(getCertificatesResult -> getCertificatesResult.certificates()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

certs = alicloud.cas.get_certificates(name_regex="^cas",
    output_file=f"{path['module']}/cas_certificates.json")
pulumi.export("cert", certs.certificates[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const certs = alicloud.cas.getCertificates({
    nameRegex: "^cas",
    outputFile: `${path.module}/cas_certificates.json`,
});
export const cert = certs.then(certs => certs.certificates?.[0]?.id);
variables:
  certs:
    fn::invoke:
      Function: alicloud:cas:getCertificates
      Arguments:
        nameRegex: ^cas
        outputFile: ${path.module}/cas_certificates.json
outputs:
  cert: ${certs.certificates[0].id}

Using getCertificates

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getCertificates(args: GetCertificatesArgs, opts?: InvokeOptions): Promise<GetCertificatesResult>
function getCertificatesOutput(args: GetCertificatesOutputArgs, opts?: InvokeOptions): Output<GetCertificatesResult>
def get_certificates(enable_details: Optional[bool] = None,
                     ids: Optional[Sequence[str]] = None,
                     lang: Optional[str] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetCertificatesResult
def get_certificates_output(enable_details: Optional[pulumi.Input[bool]] = None,
                     ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     lang: Optional[pulumi.Input[str]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetCertificatesResult]
func GetCertificates(ctx *Context, args *GetCertificatesArgs, opts ...InvokeOption) (*GetCertificatesResult, error)
func GetCertificatesOutput(ctx *Context, args *GetCertificatesOutputArgs, opts ...InvokeOption) GetCertificatesResultOutput

> Note: This function is named GetCertificates in the Go SDK.

public static class GetCertificates 
{
    public static Task<GetCertificatesResult> InvokeAsync(GetCertificatesArgs args, InvokeOptions? opts = null)
    public static Output<GetCertificatesResult> Invoke(GetCertificatesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetCertificatesResult> getCertificates(GetCertificatesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:cas/getCertificates:getCertificates
  arguments:
    # arguments dictionary

The following arguments are supported:

EnableDetails bool
Ids List<string>

A list of cert IDs.

Lang string
NameRegex string

A regex string to filter results by the certificate name.

OutputFile string

File name where to save data source results (after running pulumi preview).

EnableDetails bool
Ids []string

A list of cert IDs.

Lang string
NameRegex string

A regex string to filter results by the certificate name.

OutputFile string

File name where to save data source results (after running pulumi preview).

enableDetails Boolean
ids List<String>

A list of cert IDs.

lang String
nameRegex String

A regex string to filter results by the certificate name.

outputFile String

File name where to save data source results (after running pulumi preview).

enableDetails boolean
ids string[]

A list of cert IDs.

lang string
nameRegex string

A regex string to filter results by the certificate name.

outputFile string

File name where to save data source results (after running pulumi preview).

enable_details bool
ids Sequence[str]

A list of cert IDs.

lang str
name_regex str

A regex string to filter results by the certificate name.

output_file str

File name where to save data source results (after running pulumi preview).

enableDetails Boolean
ids List<String>

A list of cert IDs.

lang String
nameRegex String

A regex string to filter results by the certificate name.

outputFile String

File name where to save data source results (after running pulumi preview).

getCertificates Result

The following output properties are available:

Certificates List<Pulumi.AliCloud.Cas.Outputs.GetCertificatesCertificate>

A list of apis. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of cert IDs.

Names List<string>

A list of cert names.

EnableDetails bool
Lang string
NameRegex string
OutputFile string
Certificates []GetCertificatesCertificate

A list of apis. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of cert IDs.

Names []string

A list of cert names.

EnableDetails bool
Lang string
NameRegex string
OutputFile string
certificates List<GetCertificatesCertificate>

A list of apis. Each element contains the following attributes:

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of cert IDs.

names List<String>

A list of cert names.

enableDetails Boolean
lang String
nameRegex String
outputFile String
certificates GetCertificatesCertificate[]

A list of apis. Each element contains the following attributes:

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of cert IDs.

names string[]

A list of cert names.

enableDetails boolean
lang string
nameRegex string
outputFile string
certificates Sequence[GetCertificatesCertificate]

A list of apis. Each element contains the following attributes:

id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of cert IDs.

names Sequence[str]

A list of cert names.

enable_details bool
lang str
name_regex str
output_file str
certificates List<Property Map>

A list of apis. Each element contains the following attributes:

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of cert IDs.

names List<String>

A list of cert names.

enableDetails Boolean
lang String
nameRegex String
outputFile String

Supporting Types

GetCertificatesCertificate

BuyInAliyun bool

The cert is buy from aliyun or not.

Cert string
CertId string
CertificateName string
City string

The cert's city.

Common string

The cert's common name.

Country string

The cert's country.

EndDate string

The cert's not valid after time.

Expired bool

The cert is expired or not.

Fingerprint string
Id string

The cert's id.

Issuer string

The cert's .

Key string
Name string

The cert's name.

Deprecated:

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

OrgName string

The cert's organization.

Province string

The cert's province.

Sans string

The cert's subject alternative name.

StartDate string

The cert's not valid before time.

BuyInAliyun bool

The cert is buy from aliyun or not.

Cert string
CertId string
CertificateName string
City string

The cert's city.

Common string

The cert's common name.

Country string

The cert's country.

EndDate string

The cert's not valid after time.

Expired bool

The cert is expired or not.

Fingerprint string
Id string

The cert's id.

Issuer string

The cert's .

Key string
Name string

The cert's name.

Deprecated:

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

OrgName string

The cert's organization.

Province string

The cert's province.

Sans string

The cert's subject alternative name.

StartDate string

The cert's not valid before time.

buyInAliyun Boolean

The cert is buy from aliyun or not.

cert String
certId String
certificateName String
city String

The cert's city.

common String

The cert's common name.

country String

The cert's country.

endDate String

The cert's not valid after time.

expired Boolean

The cert is expired or not.

fingerprint String
id String

The cert's id.

issuer String

The cert's .

key String
name String

The cert's name.

Deprecated:

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

orgName String

The cert's organization.

province String

The cert's province.

sans String

The cert's subject alternative name.

startDate String

The cert's not valid before time.

buyInAliyun boolean

The cert is buy from aliyun or not.

cert string
certId string
certificateName string
city string

The cert's city.

common string

The cert's common name.

country string

The cert's country.

endDate string

The cert's not valid after time.

expired boolean

The cert is expired or not.

fingerprint string
id string

The cert's id.

issuer string

The cert's .

key string
name string

The cert's name.

Deprecated:

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

orgName string

The cert's organization.

province string

The cert's province.

sans string

The cert's subject alternative name.

startDate string

The cert's not valid before time.

buy_in_aliyun bool

The cert is buy from aliyun or not.

cert str
cert_id str
certificate_name str
city str

The cert's city.

common str

The cert's common name.

country str

The cert's country.

end_date str

The cert's not valid after time.

expired bool

The cert is expired or not.

fingerprint str
id str

The cert's id.

issuer str

The cert's .

key str
name str

The cert's name.

Deprecated:

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

org_name str

The cert's organization.

province str

The cert's province.

sans str

The cert's subject alternative name.

start_date str

The cert's not valid before time.

buyInAliyun Boolean

The cert is buy from aliyun or not.

cert String
certId String
certificateName String
city String

The cert's city.

common String

The cert's common name.

country String

The cert's country.

endDate String

The cert's not valid after time.

expired Boolean

The cert is expired or not.

fingerprint String
id String

The cert's id.

issuer String

The cert's .

key String
name String

The cert's name.

Deprecated:

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

orgName String

The cert's organization.

province String

The cert's province.

sans String

The cert's subject alternative name.

startDate String

The cert's not valid before time.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.