1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. waf
  5. getCertificates
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

alicloud.waf.getCertificates

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

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

    NOTE: Available since v1.135.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = alicloud.waf.getCertificates({
        ids: ["your_certificate_id"],
        instanceId: "your_instance_id",
        domain: "your_domain_name",
    });
    export const wafCertificate = _default.then(_default => _default.certificates?.[0]);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.waf.get_certificates(ids=["your_certificate_id"],
        instance_id="your_instance_id",
        domain="your_domain_name")
    pulumi.export("wafCertificate", default.certificates[0])
    
    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 {
    		_default, err := waf.GetCertificates(ctx, &waf.GetCertificatesArgs{
    			Ids: []string{
    				"your_certificate_id",
    			},
    			InstanceId: "your_instance_id",
    			Domain:     pulumi.StringRef("your_domain_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("wafCertificate", _default.Certificates[0])
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Waf.GetCertificates.Invoke(new()
        {
            Ids = new[]
            {
                "your_certificate_id",
            },
            InstanceId = "your_instance_id",
            Domain = "your_domain_name",
        });
    
        return new Dictionary<string, object?>
        {
            ["wafCertificate"] = @default.Apply(@default => @default.Apply(getCertificatesResult => getCertificatesResult.Certificates[0])),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.waf.WafFunctions;
    import com.pulumi.alicloud.waf.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 default = WafFunctions.getCertificates(GetCertificatesArgs.builder()
                .ids("your_certificate_id")
                .instanceId("your_instance_id")
                .domain("your_domain_name")
                .build());
    
            ctx.export("wafCertificate", default_.certificates()[0]);
        }
    }
    
    variables:
      default:
        fn::invoke:
          function: alicloud:waf:getCertificates
          arguments:
            ids:
              - your_certificate_id
            instanceId: your_instance_id
            domain: your_domain_name
    outputs:
      wafCertificate: ${default.certificates[0]}
    

    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(domain: Optional[str] = None,
                         ids: Optional[Sequence[str]] = None,
                         instance_id: Optional[str] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetCertificatesResult
    def get_certificates_output(domain: Optional[pulumi.Input[str]] = None,
                         ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         instance_id: 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)
    public static Output<GetCertificatesResult> getCertificates(GetCertificatesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: alicloud:waf/getCertificates:getCertificates
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    WAF instance ID.
    Domain string
    WAF domain name.
    Ids List<string>
    A list of Certificate IDs.
    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).
    InstanceId string
    WAF instance ID.
    Domain string
    WAF domain name.
    Ids []string
    A list of Certificate IDs.
    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).
    instanceId String
    WAF instance ID.
    domain String
    WAF domain name.
    ids List<String>
    A list of Certificate IDs.
    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).
    instanceId string
    WAF instance ID.
    domain string
    WAF domain name.
    ids string[]
    A list of Certificate IDs.
    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).
    instance_id str
    WAF instance ID.
    domain str
    WAF domain name.
    ids Sequence[str]
    A list of Certificate IDs.
    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).
    instanceId String
    WAF instance ID.
    domain String
    WAF domain name.
    ids List<String>
    A list of Certificate IDs.
    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).

    getCertificates Result

    The following output properties are available:

    Certificates List<Pulumi.AliCloud.Waf.Outputs.GetCertificatesCertificate>
    A list of Waf Certificates. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    InstanceId string
    WAF instance ID.
    Names List<string>
    A list of Certificate names.
    Domain string
    The domain that you want to add to WAF.
    NameRegex string
    OutputFile string
    Certificates []GetCertificatesCertificate
    A list of Waf Certificates. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    InstanceId string
    WAF instance ID.
    Names []string
    A list of Certificate names.
    Domain string
    The domain that you want to add to WAF.
    NameRegex string
    OutputFile string
    certificates List<GetCertificatesCertificate>
    A list of Waf Certificates. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    WAF instance ID.
    names List<String>
    A list of Certificate names.
    domain String
    The domain that you want to add to WAF.
    nameRegex String
    outputFile String
    certificates GetCertificatesCertificate[]
    A list of Waf Certificates. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instanceId string
    WAF instance ID.
    names string[]
    A list of Certificate names.
    domain string
    The domain that you want to add to WAF.
    nameRegex string
    outputFile string
    certificates Sequence[GetCertificatesCertificate]
    A list of Waf Certificates. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instance_id str
    WAF instance ID.
    names Sequence[str]
    A list of Certificate names.
    domain str
    The domain that you want to add to WAF.
    name_regex str
    output_file str
    certificates List<Property Map>
    A list of Waf Certificates. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    WAF instance ID.
    names List<String>
    A list of Certificate names.
    domain String
    The domain that you want to add to WAF.
    nameRegex String
    outputFile String

    Supporting Types

    GetCertificatesCertificate

    CertificateId string
    Certificate recording ID.
    CertificateName string
    Your certificate name.
    CommonName string
    Certificate bound to the domain name.
    Domain string
    WAF domain name.
    Id string
    The ID of the Certificate.
    InstanceId string
    WAF instance ID.
    IsUsing bool
    Sans List<string>
    CertificateId string
    Certificate recording ID.
    CertificateName string
    Your certificate name.
    CommonName string
    Certificate bound to the domain name.
    Domain string
    WAF domain name.
    Id string
    The ID of the Certificate.
    InstanceId string
    WAF instance ID.
    IsUsing bool
    Sans []string
    certificateId String
    Certificate recording ID.
    certificateName String
    Your certificate name.
    commonName String
    Certificate bound to the domain name.
    domain String
    WAF domain name.
    id String
    The ID of the Certificate.
    instanceId String
    WAF instance ID.
    isUsing Boolean
    sans List<String>
    certificateId string
    Certificate recording ID.
    certificateName string
    Your certificate name.
    commonName string
    Certificate bound to the domain name.
    domain string
    WAF domain name.
    id string
    The ID of the Certificate.
    instanceId string
    WAF instance ID.
    isUsing boolean
    sans string[]
    certificate_id str
    Certificate recording ID.
    certificate_name str
    Your certificate name.
    common_name str
    Certificate bound to the domain name.
    domain str
    WAF domain name.
    id str
    The ID of the Certificate.
    instance_id str
    WAF instance ID.
    is_using bool
    sans Sequence[str]
    certificateId String
    Certificate recording ID.
    certificateName String
    Your certificate name.
    commonName String
    Certificate bound to the domain name.
    domain String
    WAF domain name.
    id String
    The ID of the Certificate.
    instanceId String
    WAF instance ID.
    isUsing Boolean
    sans List<String>

    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.75.0 published on Friday, Mar 7, 2025 by Pulumi