Alibaba Cloud v3.88.1 published on Saturday, Nov 8, 2025 by Pulumi
Alibaba Cloud v3.88.1 published on Saturday, Nov 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";
const _default = alicloud.ga.getAccelerators({
status: "active",
});
const defaultAccelerator: alicloud.ga.Accelerator[] = [];
_default.then(_default => _default.accelerators).length.apply(length => {
for (const range = {value: 0}; range.value < (length > 0 ? 0 : 1); range.value++) {
defaultAccelerator.push(new alicloud.ga.Accelerator(`default-${range.value}`, {
duration: 1,
autoUseCoupon: true,
spec: "1",
}));
}
});
const acceleratorId = pulumi.all([_default.then(_default => _default.accelerators).length, _default, defaultAccelerator[0].id]).apply(([length, _default, id]) => length > 0 ? _default.accelerators?.[0]?.id : id);
const defaultGetDomains = alicloud.ga.getDomains({
acceleratorId: acceleratorIdLocals,
domain: "your_domain",
});
export const alicloudGaDomainExampleId = defaultGetDomains.then(defaultGetDomains => defaultGetDomains.domains?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.ga.get_accelerators(status="active")
default_accelerator = []
def create_default(range_body):
for range in [{"value": i} for i in range(0, range_body)]:
default_accelerator.append(alicloud.ga.Accelerator(f"default-{range['value']}",
duration=1,
auto_use_coupon=True,
spec="1"))
len(default.accelerators).apply(lambda resolved_outputs: create_default(0 if resolved_outputs['length'] > 0 else 1))
accelerator_id = pulumi.Output.all(
length=len(default.accelerators),
id=default_accelerator[0].id
).apply(lambda resolved_outputs: default.accelerators[0].id if resolved_outputs['length'] > 0 else resolved_outputs['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 tmp0 float64
if length > 0 {
tmp0 = 0
} else {
tmp0 = 1
}
var defaultAccelerator []*ga.Accelerator
for index := 0; index < float64(len(_default.Accelerators).ApplyT(func(length int) (float64, error) {
return tmp0, nil
}).(pulumi.Float64Output)); 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 length > 0 {
tmp1 = _default.Accelerators[0].Id
} else {
tmp1 = id
}
_ = pulumi.All(len(_default.Accelerators), defaultAccelerator[0].ID()).ApplyT(func(_args []interface{}) (*string, error) {
length := _args[0].(int)
id := _args[1].(string)
return &tmp1, nil
}).(pulumi.StringPtrOutput)
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 Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.Ga.GetAccelerators.Invoke(new()
{
Status = "active",
});
var defaultAccelerator = new List<AliCloud.Ga.Accelerator>();
for (var rangeIndex = 0; rangeIndex < @default.Apply(@default => @default.Apply(getAcceleratorsResult => getAcceleratorsResult.Accelerators)).Length.Apply(length => 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 = Output.Tuple(@default.Apply(@default => @default.Apply(getAcceleratorsResult => getAcceleratorsResult.Accelerators)).Length, @default, defaultAccelerator[0].Id).Apply(values =>
{
var length = values.Item1;
var @default = values.Item2;
var id = values.Item3;
return length > 0 ? @default.Apply(getAcceleratorsResult => getAcceleratorsResult.Accelerators[0]?.Id) : id;
});
var defaultGetDomains = AliCloud.Ga.GetDomains.Invoke(new()
{
AcceleratorId = acceleratorIdLocals,
Domain = "your_domain",
});
return new Dictionary<string, object?>
{
["alicloudGaDomainExampleId"] = defaultGetDomains.Apply(getDomainsResult => getDomainsResult.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().applyValue(_length -> _length > 0 ? 0 : 1); i++) {
new Accelerator("defaultAccelerator-" + i, AcceleratorArgs.builder()
.duration(1)
.autoUseCoupon(true)
.spec("1")
.build());
}
final var acceleratorId = Output.tuple(default_.accelerators().length(), defaultAccelerator[0].id()).applyValue(values -> {
var length = values.t1;
var id = values.t2;
return length > 0 ? default_.accelerators()[0].id() : id;
});
final var defaultGetDomains = GaFunctions.getDomains(GetDomainsArgs.builder()
.acceleratorId(acceleratorIdLocals)
.domain("your_domain")
.build());
ctx.export("alicloudGaDomainExampleId", defaultGetDomains.domains()[0].id());
}
}
Example 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)
public static Output<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:ga/getDomains:getDomains
arguments:
# arguments dictionaryThe following arguments are supported:
- Accelerator
Id 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.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Page
Number int - Page
Size int - Status string
- The status of the resource. Valid values:
illegal,inactive,active,unknown.
- Accelerator
Id 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.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Page
Number int - Page
Size int - Status string
- The status of the resource. Valid values:
illegal,inactive,active,unknown.
- accelerator
Id 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.
- output
File String - File name where to save data source results (after running
pulumi preview). - page
Number Integer - page
Size Integer - status String
- The status of the resource. Valid values:
illegal,inactive,active,unknown.
- accelerator
Id 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.
- output
File string - File name where to save data source results (after running
pulumi preview). - page
Number number - page
Size 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.
- accelerator
Id 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.
- output
File String - File name where to save data source results (after running
pulumi preview). - page
Number Number - page
Size 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.
Ali Cloud. Ga. Outputs. Get Domains Domain> - 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>
- Accelerator
Id string - The ID of the global acceleration instance.
- Domain string
- The accelerated domain name to be added.
- Output
File string - Page
Number int - Page
Size int - Status string
- The status of the resource
- Domains
[]Get
Domains Domain - A list of Domain Entries. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Accelerator
Id string - The ID of the global acceleration instance.
- Domain string
- The accelerated domain name to be added.
- Output
File string - Page
Number int - Page
Size int - Status string
- The status of the resource
- domains
List<Get
Domains Domain> - 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>
- accelerator
Id String - The ID of the global acceleration instance.
- domain String
- The accelerated domain name to be added.
- output
File String - page
Number Integer - page
Size Integer - status String
- The status of the resource
- domains
Get
Domains Domain[] - A list of Domain Entries. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- accelerator
Id string - The ID of the global acceleration instance.
- domain string
- The accelerated domain name to be added.
- output
File string - page
Number number - page
Size number - status string
- The status of the resource
- domains
Sequence[Get
Domains Domain] - 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>
- accelerator
Id String - The ID of the global acceleration instance.
- domain String
- The accelerated domain name to be added.
- output
File String - page
Number Number - page
Size Number - status String
- The status of the resource
Supporting Types
GetDomainsDomain
- Accelerator
Id 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 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 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 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.
- accelerator
Id 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
alicloudTerraform Provider.
Alibaba Cloud v3.88.1 published on Saturday, Nov 8, 2025 by Pulumi
