1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ga
  5. getDomains
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.ga.getDomains

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

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

NOTE: Available since v1.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,
    };
}
Copy
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)
Copy
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 tmp0 float64
		if pulumi.Float64(len(_default.Accelerators)) > 0 {
			tmp0 = 0
		} else {
			tmp0 = 1
		}
		var defaultAccelerator []*ga.Accelerator
		for index := 0; index < tmp0; 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 tmp1 *string
		if pulumi.Float64(len(_default.Accelerators)) > 0 {
			tmp1 = _default.Accelerators[0].Id
		} else {
			tmp1 = defaultAccelerator[0].ID()
		}
		_ := tmp1
		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
	})
}
Copy
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,
    };
});
Copy
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()));
    }
}
Copy
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>
Copy
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]
Copy
func GetDomains(ctx *Context, args *GetDomainsArgs, opts ...InvokeOption) (*GetDomainsResult, error)
func GetDomainsOutput(ctx *Context, args *GetDomainsOutputArgs, opts ...InvokeOption) GetDomainsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOptions options)
public static Output<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:ga/getDomains:getDomains
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AcceleratorId Changes to this property will trigger replacement. string
The ID of the global acceleration instance.
Domain Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The status of the resource. Valid values: illegal, inactive, active, unknown.
AcceleratorId Changes to this property will trigger replacement. string
The ID of the global acceleration instance.
Domain Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The status of the resource. Valid values: illegal, inactive, active, unknown.
acceleratorId Changes to this property will trigger replacement. String
The ID of the global acceleration instance.
domain Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The status of the resource. Valid values: illegal, inactive, active, unknown.
acceleratorId Changes to this property will trigger replacement. string
The ID of the global acceleration instance.
domain Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The status of the resource. Valid values: illegal, inactive, active, unknown.
accelerator_id Changes to this property will trigger replacement. str
The ID of the global acceleration instance.
domain Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The status of the resource. Valid values: illegal, inactive, active, unknown.
acceleratorId Changes to this property will trigger replacement. String
The ID of the global acceleration instance.
domain Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 This property is required. string
The ID of the global acceleration instance.
Domain This property is required. string
The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
Id This property is required. string
The ID of the Ga Domain.
Status This property is required. string
The status of the resource. Valid values: illegal, inactive, active, unknown.
AcceleratorId This property is required. string
The ID of the global acceleration instance.
Domain This property is required. string
The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
Id This property is required. string
The ID of the Ga Domain.
Status This property is required. string
The status of the resource. Valid values: illegal, inactive, active, unknown.
acceleratorId This property is required. String
The ID of the global acceleration instance.
domain This property is required. String
The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
id This property is required. String
The ID of the Ga Domain.
status This property is required. String
The status of the resource. Valid values: illegal, inactive, active, unknown.
acceleratorId This property is required. string
The ID of the global acceleration instance.
domain This property is required. string
The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
id This property is required. string
The ID of the Ga Domain.
status This property is required. string
The status of the resource. Valid values: illegal, inactive, active, unknown.
accelerator_id This property is required. str
The ID of the global acceleration instance.
domain This property is required. str
The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
id This property is required. str
The ID of the Ga Domain.
status This property is required. str
The status of the resource. Valid values: illegal, inactive, active, unknown.
acceleratorId This property is required. String
The ID of the global acceleration instance.
domain This property is required. String
The accelerated domain name to be added. only top-level domain names are supported, such as 'example.com'.
id This property is required. String
The ID of the Ga Domain.
status This property is required. 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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi