1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cas
  5. getServiceCertificates
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.cas.getServiceCertificates

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    This data source provides the Ssl Certificates Service Certificates of the current Alibaba Cloud user.

    NOTE: Available in v1.129.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const certs = alicloud.cas.getCertificates({
        nameRegex: "^cas",
        ids: ["Certificate Id"],
    });
    export const cert = certs.then(certs => certs.certificates?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    certs = alicloud.cas.get_certificates(name_regex="^cas",
        ids=["Certificate Id"])
    pulumi.export("cert", certs.certificates[0].id)
    
    package main
    
    import (
    	"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"),
    			Ids: []string{
    				"Certificate Id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("cert", certs.Certificates[0].Id)
    		return nil
    	})
    }
    
    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",
            Ids = new[]
            {
                "Certificate Id",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["cert"] = certs.Apply(getCertificatesResult => getCertificatesResult.Certificates[0]?.Id),
        };
    });
    
    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")
                .ids("Certificate Id")
                .build());
    
            ctx.export("cert", certs.applyValue(getCertificatesResult -> getCertificatesResult.certificates()[0].id()));
        }
    }
    
    variables:
      certs:
        fn::invoke:
          Function: alicloud:cas:getCertificates
          Arguments:
            nameRegex: ^cas
            ids:
              - Certificate Id
    outputs:
      cert: ${certs.certificates[0].id}
    

    Using getServiceCertificates

    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 getServiceCertificates(args: GetServiceCertificatesArgs, opts?: InvokeOptions): Promise<GetServiceCertificatesResult>
    function getServiceCertificatesOutput(args: GetServiceCertificatesOutputArgs, opts?: InvokeOptions): Output<GetServiceCertificatesResult>
    def get_service_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) -> GetServiceCertificatesResult
    def get_service_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[GetServiceCertificatesResult]
    func GetServiceCertificates(ctx *Context, args *GetServiceCertificatesArgs, opts ...InvokeOption) (*GetServiceCertificatesResult, error)
    func GetServiceCertificatesOutput(ctx *Context, args *GetServiceCertificatesOutputArgs, opts ...InvokeOption) GetServiceCertificatesResultOutput

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

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

    The following arguments are supported:

    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of Certificate IDs.
    Lang string
    The lang.
    NameRegex string
    A regex string to filter results by Certificate name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of Certificate IDs.
    Lang string
    The lang.
    NameRegex string
    A regex string to filter results by Certificate name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Certificate IDs.
    lang String
    The lang.
    nameRegex String
    A regex string to filter results by Certificate name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of Certificate IDs.
    lang string
    The lang.
    nameRegex string
    A regex string to filter results by Certificate name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of Certificate IDs.
    lang str
    The lang.
    name_regex str
    A regex string to filter results by Certificate name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Certificate IDs.
    lang String
    The lang.
    nameRegex String
    A regex string to filter results by Certificate name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getServiceCertificates Result

    The following output properties are available:

    Certificates List<Pulumi.AliCloud.Cas.Outputs.GetServiceCertificatesCertificate>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    EnableDetails bool
    Lang string
    NameRegex string
    OutputFile string
    Certificates []GetServiceCertificatesCertificate
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    EnableDetails bool
    Lang string
    NameRegex string
    OutputFile string
    certificates List<GetServiceCertificatesCertificate>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    enableDetails Boolean
    lang String
    nameRegex String
    outputFile String
    certificates GetServiceCertificatesCertificate[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    enableDetails boolean
    lang string
    nameRegex string
    outputFile string
    certificates Sequence[GetServiceCertificatesCertificate]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    enable_details bool
    lang str
    name_regex str
    output_file str
    certificates List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    enableDetails Boolean
    lang String
    nameRegex String
    outputFile String

    Supporting Types

    GetServiceCertificatesCertificate

    BuyInAliyun bool
    The cert is buy from aliyun or not.
    Cert string
    The cert's Cert.
    CertId string
    The cert's id.
    CertificateName string
    The cert's name.
    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
    The cert's finger.
    Id string
    The cert's id.
    Issuer string
    The cert's Issuer.
    Key string
    Name string

    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
    The cert's Cert.
    CertId string
    The cert's id.
    CertificateName string
    The cert's name.
    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
    The cert's finger.
    Id string
    The cert's id.
    Issuer string
    The cert's Issuer.
    Key string
    Name string

    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
    The cert's Cert.
    certId String
    The cert's id.
    certificateName String
    The cert's name.
    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
    The cert's finger.
    id String
    The cert's id.
    issuer String
    The cert's Issuer.
    key String
    name String

    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
    The cert's Cert.
    certId string
    The cert's id.
    certificateName string
    The cert's name.
    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
    The cert's finger.
    id string
    The cert's id.
    issuer string
    The cert's Issuer.
    key string
    name string

    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
    The cert's Cert.
    cert_id str
    The cert's id.
    certificate_name str
    The cert's name.
    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
    The cert's finger.
    id str
    The cert's id.
    issuer str
    The cert's Issuer.
    key str
    name str

    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
    The cert's Cert.
    certId String
    The cert's id.
    certificateName String
    The cert's name.
    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
    The cert's finger.
    id String
    The cert's id.
    issuer String
    The cert's Issuer.
    key String
    name String

    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.
    alicloud logo
    Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi