1. Packages
  2. Alicloud Provider
  3. API Docs
  4. vod
  5. getDomains
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.vod.getDomains

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides the Vod Domains of the current Alibaba Cloud user.

    NOTE: Available in v1.136.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const defaultDomain = new alicloud.vod.Domain("default", {
        domainName: "your_domain_name",
        scope: "domestic",
        sources: [{
            sourceType: "domain",
            sourceContent: "your_source_content",
            sourcePort: "80",
        }],
        tags: {
            key1: "value1",
            key2: "value2",
        },
    });
    const default = alicloud.vod.getDomainsOutput({
        ids: [defaultDomain.id],
        tags: {
            key1: "value1",
            key2: "value2",
        },
    });
    export const vodDomain = _default.apply(_default => _default.domains?.[0]);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default_domain = alicloud.vod.Domain("default",
        domain_name="your_domain_name",
        scope="domestic",
        sources=[{
            "source_type": "domain",
            "source_content": "your_source_content",
            "source_port": "80",
        }],
        tags={
            "key1": "value1",
            "key2": "value2",
        })
    default = alicloud.vod.get_domains_output(ids=[default_domain.id],
        tags={
            "key1": "value1",
            "key2": "value2",
        })
    pulumi.export("vodDomain", default.domains[0])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vod"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultDomain, err := vod.NewDomain(ctx, "default", &vod.DomainArgs{
    			DomainName: pulumi.String("your_domain_name"),
    			Scope:      pulumi.String("domestic"),
    			Sources: vod.DomainSourceArray{
    				&vod.DomainSourceArgs{
    					SourceType:    pulumi.String("domain"),
    					SourceContent: pulumi.String("your_source_content"),
    					SourcePort:    pulumi.String("80"),
    				},
    			},
    			Tags: pulumi.StringMap{
    				"key1": pulumi.String("value1"),
    				"key2": pulumi.String("value2"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_default := vod.GetDomainsOutput(ctx, vod.GetDomainsOutputArgs{
    			Ids: pulumi.StringArray{
    				defaultDomain.ID(),
    			},
    			Tags: pulumi.StringMap{
    				"key1": pulumi.String("value1"),
    				"key2": pulumi.String("value2"),
    			},
    		}, nil)
    		ctx.Export("vodDomain", _default.ApplyT(func(_default vod.GetDomainsResult) (vod.GetDomainsDomain, error) {
    			return _default.Domains[0], nil
    		}).(vod.GetDomainsDomainOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultDomain = new AliCloud.Vod.Domain("default", new()
        {
            DomainName = "your_domain_name",
            Scope = "domestic",
            Sources = new[]
            {
                new AliCloud.Vod.Inputs.DomainSourceArgs
                {
                    SourceType = "domain",
                    SourceContent = "your_source_content",
                    SourcePort = "80",
                },
            },
            Tags = 
            {
                { "key1", "value1" },
                { "key2", "value2" },
            },
        });
    
        var @default = AliCloud.Vod.GetDomains.Invoke(new()
        {
            Ids = new[]
            {
                defaultDomain.Id,
            },
            Tags = 
            {
                { "key1", "value1" },
                { "key2", "value2" },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["vodDomain"] = @default.Apply(@default => @default.Apply(getDomainsResult => getDomainsResult.Domains[0])),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.vod.Domain;
    import com.pulumi.alicloud.vod.DomainArgs;
    import com.pulumi.alicloud.vod.inputs.DomainSourceArgs;
    import com.pulumi.alicloud.vod.VodFunctions;
    import com.pulumi.alicloud.vod.inputs.GetDomainsArgs;
    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 defaultDomain = new Domain("defaultDomain", DomainArgs.builder()
                .domainName("your_domain_name")
                .scope("domestic")
                .sources(DomainSourceArgs.builder()
                    .sourceType("domain")
                    .sourceContent("your_source_content")
                    .sourcePort("80")
                    .build())
                .tags(Map.ofEntries(
                    Map.entry("key1", "value1"),
                    Map.entry("key2", "value2")
                ))
                .build());
    
            final var default = VodFunctions.getDomains(GetDomainsArgs.builder()
                .ids(defaultDomain.id())
                .tags(Map.ofEntries(
                    Map.entry("key1", "value1"),
                    Map.entry("key2", "value2")
                ))
                .build());
    
            ctx.export("vodDomain", default_.applyValue(default_ -> default_.domains()[0]));
        }
    }
    
    resources:
      defaultDomain:
        type: alicloud:vod:Domain
        name: default
        properties:
          domainName: your_domain_name
          scope: domestic
          sources:
            - sourceType: domain
              sourceContent: your_source_content
              sourcePort: '80'
          tags:
            key1: value1
            key2: value2
    variables:
      default:
        fn::invoke:
          Function: alicloud:vod:getDomains
          Arguments:
            ids:
              - ${defaultDomain.id}
            tags:
              key1: value1
              key2: value2
    outputs:
      vodDomain: ${default.domains[0]}
    

    Using getDomains

    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 getDomains(args: GetDomainsArgs, opts?: InvokeOptions): Promise<GetDomainsResult>
    function getDomainsOutput(args: GetDomainsOutputArgs, opts?: InvokeOptions): Output<GetDomainsResult>
    def get_domains(domain_search_type: Optional[str] = None,
                    ids: Optional[Sequence[str]] = None,
                    name_regex: Optional[str] = None,
                    output_file: Optional[str] = None,
                    status: Optional[str] = None,
                    tags: Optional[Mapping[str, str]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetDomainsResult
    def get_domains_output(domain_search_type: Optional[pulumi.Input[str]] = None,
                    ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    name_regex: Optional[pulumi.Input[str]] = None,
                    output_file: Optional[pulumi.Input[str]] = None,
                    status: Optional[pulumi.Input[str]] = None,
                    tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetDomainsResult]
    func GetDomains(ctx *Context, args *GetDomainsArgs, opts ...InvokeOption) (*GetDomainsResult, error)
    func GetDomainsOutput(ctx *Context, args *GetDomainsOutputArgs, opts ...InvokeOption) GetDomainsResultOutput

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

    public static class GetDomains 
    {
        public static Task<GetDomainsResult> InvokeAsync(GetDomainsArgs args, InvokeOptions? opts = null)
        public static Output<GetDomainsResult> Invoke(GetDomainsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:vod/getDomains:getDomains
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DomainSearchType string
    The search method. Valid values:
    Ids List<string>
    A list of Domain IDs. Its element value is same as Domain Name.
    NameRegex string
    A regex string to filter results by Domain name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the domain name. The value of this parameter is used as a condition to filter domain names.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.

    • Key: It can be up to 64 characters in length. It cannot be a null string.
    • Value: It can be up to 128 characters in length. It can be a null string.
    DomainSearchType string
    The search method. Valid values:
    Ids []string
    A list of Domain IDs. Its element value is same as Domain Name.
    NameRegex string
    A regex string to filter results by Domain name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the domain name. The value of this parameter is used as a condition to filter domain names.
    Tags map[string]string
    A mapping of tags to assign to the resource.

    • Key: It can be up to 64 characters in length. It cannot be a null string.
    • Value: It can be up to 128 characters in length. It can be a null string.
    domainSearchType String
    The search method. Valid values:
    ids List<String>
    A list of Domain IDs. Its element value is same as Domain Name.
    nameRegex String
    A regex string to filter results by Domain name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the domain name. The value of this parameter is used as a condition to filter domain names.
    tags Map<String,String>
    A mapping of tags to assign to the resource.

    • Key: It can be up to 64 characters in length. It cannot be a null string.
    • Value: It can be up to 128 characters in length. It can be a null string.
    domainSearchType string
    The search method. Valid values:
    ids string[]
    A list of Domain IDs. Its element value is same as Domain Name.
    nameRegex string
    A regex string to filter results by Domain name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of the domain name. The value of this parameter is used as a condition to filter domain names.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.

    • Key: It can be up to 64 characters in length. It cannot be a null string.
    • Value: It can be up to 128 characters in length. It can be a null string.
    domain_search_type str
    The search method. Valid values:
    ids Sequence[str]
    A list of Domain IDs. Its element value is same as Domain Name.
    name_regex str
    A regex string to filter results by Domain name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of the domain name. The value of this parameter is used as a condition to filter domain names.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.

    • Key: It can be up to 64 characters in length. It cannot be a null string.
    • Value: It can be up to 128 characters in length. It can be a null string.
    domainSearchType String
    The search method. Valid values:
    ids List<String>
    A list of Domain IDs. Its element value is same as Domain Name.
    nameRegex String
    A regex string to filter results by Domain name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the domain name. The value of this parameter is used as a condition to filter domain names.
    tags Map<String>
    A mapping of tags to assign to the resource.

    • Key: It can be up to 64 characters in length. It cannot be a null string.
    • Value: It can be up to 128 characters in length. It can be a null string.

    getDomains Result

    The following output properties are available:

    Domains List<Pulumi.AliCloud.Vod.Outputs.GetDomainsDomain>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    DomainSearchType string
    NameRegex string
    OutputFile string
    Status string
    Tags Dictionary<string, string>
    Domains []GetDomainsDomain
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    DomainSearchType string
    NameRegex string
    OutputFile string
    Status string
    Tags map[string]string
    domains List<GetDomainsDomain>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    domainSearchType String
    nameRegex String
    outputFile String
    status String
    tags Map<String,String>
    domains GetDomainsDomain[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    domainSearchType string
    nameRegex string
    outputFile string
    status string
    tags {[key: string]: string}
    domains Sequence[GetDomainsDomain]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    domain_search_type str
    name_regex str
    output_file str
    status str
    tags Mapping[str, str]
    domains List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    domainSearchType String
    nameRegex String
    outputFile String
    status String
    tags Map<String>

    Supporting Types

    GetDomainsDomain

    Cname string
    The CNAME that is assigned to the domain name for CDN. You must add a CNAME record in the system of your Domain Name System (DNS) service provider to map the domain name for CDN to the CNAME.
    Description string
    The description of the domain name for CDN.
    DomainName string
    The domain name for CDN.
    GmtCreated string
    The time when the domain name for CDN was added. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    GmtModified string
    The last time when the domain name for CDN was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    Id string
    The ID of the Domain. Its value is same as Queue Name.
    SandBox string
    Indicates whether the domain name for CDN is in a sandbox environment.
    Sources List<Pulumi.AliCloud.Vod.Inputs.GetDomainsDomainSource>
    The information about the address of the origin server. For more information about the Sources parameter, See the following Block sources.
    SslProtocol string
    Indicates whether the Secure Sockets Layer (SSL) certificate is enabled. Valid values: on,off.
    Status string
    The status of the resource.
    Cname string
    The CNAME that is assigned to the domain name for CDN. You must add a CNAME record in the system of your Domain Name System (DNS) service provider to map the domain name for CDN to the CNAME.
    Description string
    The description of the domain name for CDN.
    DomainName string
    The domain name for CDN.
    GmtCreated string
    The time when the domain name for CDN was added. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    GmtModified string
    The last time when the domain name for CDN was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    Id string
    The ID of the Domain. Its value is same as Queue Name.
    SandBox string
    Indicates whether the domain name for CDN is in a sandbox environment.
    Sources []GetDomainsDomainSource
    The information about the address of the origin server. For more information about the Sources parameter, See the following Block sources.
    SslProtocol string
    Indicates whether the Secure Sockets Layer (SSL) certificate is enabled. Valid values: on,off.
    Status string
    The status of the resource.
    cname String
    The CNAME that is assigned to the domain name for CDN. You must add a CNAME record in the system of your Domain Name System (DNS) service provider to map the domain name for CDN to the CNAME.
    description String
    The description of the domain name for CDN.
    domainName String
    The domain name for CDN.
    gmtCreated String
    The time when the domain name for CDN was added. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    gmtModified String
    The last time when the domain name for CDN was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    id String
    The ID of the Domain. Its value is same as Queue Name.
    sandBox String
    Indicates whether the domain name for CDN is in a sandbox environment.
    sources List<GetDomainsDomainSource>
    The information about the address of the origin server. For more information about the Sources parameter, See the following Block sources.
    sslProtocol String
    Indicates whether the Secure Sockets Layer (SSL) certificate is enabled. Valid values: on,off.
    status String
    The status of the resource.
    cname string
    The CNAME that is assigned to the domain name for CDN. You must add a CNAME record in the system of your Domain Name System (DNS) service provider to map the domain name for CDN to the CNAME.
    description string
    The description of the domain name for CDN.
    domainName string
    The domain name for CDN.
    gmtCreated string
    The time when the domain name for CDN was added. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    gmtModified string
    The last time when the domain name for CDN was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    id string
    The ID of the Domain. Its value is same as Queue Name.
    sandBox string
    Indicates whether the domain name for CDN is in a sandbox environment.
    sources GetDomainsDomainSource[]
    The information about the address of the origin server. For more information about the Sources parameter, See the following Block sources.
    sslProtocol string
    Indicates whether the Secure Sockets Layer (SSL) certificate is enabled. Valid values: on,off.
    status string
    The status of the resource.
    cname str
    The CNAME that is assigned to the domain name for CDN. You must add a CNAME record in the system of your Domain Name System (DNS) service provider to map the domain name for CDN to the CNAME.
    description str
    The description of the domain name for CDN.
    domain_name str
    The domain name for CDN.
    gmt_created str
    The time when the domain name for CDN was added. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    gmt_modified str
    The last time when the domain name for CDN was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    id str
    The ID of the Domain. Its value is same as Queue Name.
    sand_box str
    Indicates whether the domain name for CDN is in a sandbox environment.
    sources Sequence[GetDomainsDomainSource]
    The information about the address of the origin server. For more information about the Sources parameter, See the following Block sources.
    ssl_protocol str
    Indicates whether the Secure Sockets Layer (SSL) certificate is enabled. Valid values: on,off.
    status str
    The status of the resource.
    cname String
    The CNAME that is assigned to the domain name for CDN. You must add a CNAME record in the system of your Domain Name System (DNS) service provider to map the domain name for CDN to the CNAME.
    description String
    The description of the domain name for CDN.
    domainName String
    The domain name for CDN.
    gmtCreated String
    The time when the domain name for CDN was added. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    gmtModified String
    The last time when the domain name for CDN was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    id String
    The ID of the Domain. Its value is same as Queue Name.
    sandBox String
    Indicates whether the domain name for CDN is in a sandbox environment.
    sources List<Property Map>
    The information about the address of the origin server. For more information about the Sources parameter, See the following Block sources.
    sslProtocol String
    Indicates whether the Secure Sockets Layer (SSL) certificate is enabled. Valid values: on,off.
    status String
    The status of the resource.

    GetDomainsDomainSource

    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.62.1 published on Monday, Sep 16, 2024 by Pulumi