1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ga
  5. getDomains
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.ga.getDomains

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides Ga Domain available to the user.What is Domain

    NOTE: Available in 1.197.0+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    export = async () => {
        const default = await alicloud.ga.getAccelerators({
            status: "active",
        });
        const defaultAccelerator: alicloud.ga.Accelerator[] = [];
        for (const range = {value: 0}; range.value < (_default.accelerators.length > 0 ? 0 : 1); range.value++) {
            defaultAccelerator.push(new alicloud.ga.Accelerator(`default-${range.value}`, {
                duration: 1,
                autoUseCoupon: true,
                spec: "1",
            }));
        }
        const acceleratorId = _default.accelerators.length > 0 ? _default.accelerators?.[0]?.id : defaultAccelerator[0].id;
        const defaultGetDomains = await alicloud.ga.getDomains({
            acceleratorId: acceleratorIdLocals,
            domain: "your_domain",
        });
        return {
            alicloudGaDomainExampleId: defaultGetDomains.domains?.[0]?.id,
        };
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.ga.get_accelerators(status="active")
    default_accelerator = []
    for range in [{"value": i} for i in range(0, 0 if len(default.accelerators) > 0 else 1)]:
        default_accelerator.append(alicloud.ga.Accelerator(f"default-{range['value']}",
            duration=1,
            auto_use_coupon=True,
            spec="1"))
    accelerator_id = default.accelerators[0].id if len(default.accelerators) > 0 else default_accelerator[0].id
    default_get_domains = alicloud.ga.get_domains(accelerator_id=accelerator_id_locals,
        domain="your_domain")
    pulumi.export("alicloudGaDomainExampleId", default_get_domains.domains[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ga"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    _default, err := ga.GetAccelerators(ctx, &ga.GetAcceleratorsArgs{
    Status: pulumi.StringRef("active"),
    }, nil);
    if err != nil {
    return err
    }
    var defaultAccelerator []*ga.Accelerator
    for index := 0; index < %!v(PANIC=Format method: fatal: A failure has occurred: unlowered conditional expression @ example.pp:7,13-53); index++ {
        key0 := index
        _ := index
    __res, err := ga.NewAccelerator(ctx, fmt.Sprintf("default-%v", key0), &ga.AcceleratorArgs{
    Duration: pulumi.Int(1),
    AutoUseCoupon: pulumi.Bool(true),
    Spec: pulumi.String("1"),
    })
    if err != nil {
    return err
    }
    defaultAccelerator = append(defaultAccelerator, __res)
    }
    var tmp0 *string
    if len(_default.Accelerators) > 0 {
    tmp0 = _default.Accelerators[0].Id
    } else {
    tmp0 = defaultAccelerator[0].ID()
    }
    _ := tmp0;
    defaultGetDomains, err := ga.GetDomains(ctx, &ga.GetDomainsArgs{
    AcceleratorId: pulumi.StringRef(acceleratorIdLocals),
    Domain: pulumi.StringRef("your_domain"),
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("alicloudGaDomainExampleId", defaultGetDomains.Domains[0].Id)
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(async() => 
    {
        var @default = await AliCloud.Ga.GetAccelerators.InvokeAsync(new()
        {
            Status = "active",
        });
    
        var defaultAccelerator = new List<AliCloud.Ga.Accelerator>();
        for (var rangeIndex = 0; rangeIndex < @default.Accelerators.Length > 0 ? 0 : 1; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultAccelerator.Add(new AliCloud.Ga.Accelerator($"default-{range.Value}", new()
            {
                Duration = 1,
                AutoUseCoupon = true,
                Spec = "1",
            }));
        }
        var acceleratorId = @default.Accelerators.Length > 0 ? @default.Accelerators[0]?.Id : defaultAccelerator[0].Id;
    
        var defaultGetDomains = await AliCloud.Ga.GetDomains.InvokeAsync(new()
        {
            AcceleratorId = acceleratorIdLocals,
            Domain = "your_domain",
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudGaDomainExampleId"] = defaultGetDomains.Domains[0]?.Id,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ga.GaFunctions;
    import com.pulumi.alicloud.ga.inputs.GetAcceleratorsArgs;
    import com.pulumi.alicloud.ga.Accelerator;
    import com.pulumi.alicloud.ga.AcceleratorArgs;
    import com.pulumi.alicloud.ga.inputs.GetDomainsArgs;
    import com.pulumi.codegen.internal.KeyedValue;
    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 = GaFunctions.getAccelerators(GetAcceleratorsArgs.builder()
                .status("active")
                .build());
    
            for (var i = 0; i < default_.accelerators().length() > 0 ? 0 : 1; i++) {
                new Accelerator("defaultAccelerator-" + i, AcceleratorArgs.builder()
                    .duration(1)
                    .autoUseCoupon(true)
                    .spec("1")
                    .build());
    
            
    }
            final var acceleratorId = default_.accelerators().length() > 0 ? default_.accelerators()[0].id() : defaultAccelerator[0].id();
    
            final var defaultGetDomains = GaFunctions.getDomains(GetDomainsArgs.builder()
                .acceleratorId(acceleratorIdLocals)
                .domain("your_domain")
                .build());
    
            ctx.export("alicloudGaDomainExampleId", defaultGetDomains.applyValue(getDomainsResult -> getDomainsResult.domains()[0].id()));
        }
    }
    
    Coming soon!
    

    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(accelerator_id: Optional[str] = None,
                    domain: Optional[str] = None,
                    ids: Optional[Sequence[str]] = None,
                    output_file: Optional[str] = None,
                    page_number: Optional[int] = None,
                    page_size: Optional[int] = None,
                    status: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetDomainsResult
    def get_domains_output(accelerator_id: Optional[pulumi.Input[str]] = None,
                    domain: Optional[pulumi.Input[str]] = None,
                    ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    output_file: Optional[pulumi.Input[str]] = None,
                    page_number: Optional[pulumi.Input[int]] = None,
                    page_size: Optional[pulumi.Input[int]] = None,
                    status: Optional[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:ga/getDomains:getDomains
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AcceleratorId string
    The ID of the global acceleration instance.
    Domain string
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    Ids List<string>
    A list of Ga Domain IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    Status string
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    AcceleratorId string
    The ID of the global acceleration instance.
    Domain string
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    Ids []string
    A list of Ga Domain IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    Status string
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    acceleratorId String
    The ID of the global acceleration instance.
    domain String
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    ids List<String>
    A list of Ga Domain IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    status String
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    acceleratorId string
    The ID of the global acceleration instance.
    domain string
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    ids string[]
    A list of Ga Domain IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    status string
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    accelerator_id str
    The ID of the global acceleration instance.
    domain str
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    ids Sequence[str]
    A list of Ga Domain IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    status str
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    acceleratorId String
    The ID of the global acceleration instance.
    domain String
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    ids List<String>
    A list of Ga Domain IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number
    status String
    The status of the resource. Valid values: illegal, inactive, active, unknown.

    getDomains Result

    The following output properties are available:

    Domains List<Pulumi.AliCloud.Ga.Outputs.GetDomainsDomain>
    A list of Domain Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    AcceleratorId string
    The ID of the global acceleration instance.
    Domain string
    The accelerated domain name to be added.
    OutputFile string
    PageNumber int
    PageSize int
    Status string
    The status of the resource
    Domains []GetDomainsDomain
    A list of Domain Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    AcceleratorId string
    The ID of the global acceleration instance.
    Domain string
    The accelerated domain name to be added.
    OutputFile string
    PageNumber int
    PageSize int
    Status string
    The status of the resource
    domains List<GetDomainsDomain>
    A list of Domain Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    acceleratorId String
    The ID of the global acceleration instance.
    domain String
    The accelerated domain name to be added.
    outputFile String
    pageNumber Integer
    pageSize Integer
    status String
    The status of the resource
    domains GetDomainsDomain[]
    A list of Domain Entries. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    acceleratorId string
    The ID of the global acceleration instance.
    domain string
    The accelerated domain name to be added.
    outputFile string
    pageNumber number
    pageSize number
    status string
    The status of the resource
    domains Sequence[GetDomainsDomain]
    A list of Domain Entries. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    accelerator_id str
    The ID of the global acceleration instance.
    domain str
    The accelerated domain name to be added.
    output_file str
    page_number int
    page_size int
    status str
    The status of the resource
    domains List<Property Map>
    A list of Domain Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    acceleratorId String
    The ID of the global acceleration instance.
    domain String
    The accelerated domain name to be added.
    outputFile String
    pageNumber Number
    pageSize Number
    status String
    The status of the resource

    Supporting Types

    GetDomainsDomain

    AcceleratorId string
    The ID of the global acceleration instance.
    Domain string
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    Id string
    The ID of the Ga Domain.
    Status string
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    AcceleratorId string
    The ID of the global acceleration instance.
    Domain string
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    Id string
    The ID of the Ga Domain.
    Status string
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    acceleratorId String
    The ID of the global acceleration instance.
    domain String
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    id String
    The ID of the Ga Domain.
    status String
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    acceleratorId string
    The ID of the global acceleration instance.
    domain string
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    id string
    The ID of the Ga Domain.
    status string
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    accelerator_id str
    The ID of the global acceleration instance.
    domain str
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    id str
    The ID of the Ga Domain.
    status str
    The status of the resource. Valid values: illegal, inactive, active, unknown.
    acceleratorId String
    The ID of the global acceleration instance.
    domain String
    The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
    id String
    The ID of the Ga Domain.
    status String
    The status of the resource. Valid values: illegal, inactive, active, unknown.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi