Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.dns.getGroups
Explore with Pulumi AI
This data source provides a list of DNS Domain Groups in an Alibaba Cloud account according to the specified filters.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const groupsDs = alicloud.dns.getGroups({
nameRegex: "^y[A-Za-z]+",
outputFile: "groups.txt",
});
export const firstGroupName = groupsDs.then(groupsDs => groupsDs.groups?.[0]?.groupName);
import pulumi
import pulumi_alicloud as alicloud
groups_ds = alicloud.dns.get_groups(name_regex="^y[A-Za-z]+",
output_file="groups.txt")
pulumi.export("firstGroupName", groups_ds.groups[0].group_name)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
groupsDs, err := dns.GetGroups(ctx, &dns.GetGroupsArgs{
NameRegex: pulumi.StringRef("^y[A-Za-z]+"),
OutputFile: pulumi.StringRef("groups.txt"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstGroupName", groupsDs.Groups[0].GroupName)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var groupsDs = AliCloud.Dns.GetGroups.Invoke(new()
{
NameRegex = "^y[A-Za-z]+",
OutputFile = "groups.txt",
});
return new Dictionary<string, object?>
{
["firstGroupName"] = groupsDs.Apply(getGroupsResult => getGroupsResult.Groups[0]?.GroupName),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dns.DnsFunctions;
import com.pulumi.alicloud.dns.inputs.GetGroupsArgs;
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 groupsDs = DnsFunctions.getGroups(GetGroupsArgs.builder()
.nameRegex("^y[A-Za-z]+")
.outputFile("groups.txt")
.build());
ctx.export("firstGroupName", groupsDs.applyValue(getGroupsResult -> getGroupsResult.groups()[0].groupName()));
}
}
variables:
groupsDs:
fn::invoke:
Function: alicloud:dns:getGroups
Arguments:
nameRegex: ^y[A-Za-z]+
outputFile: groups.txt
outputs:
firstGroupName: ${groupsDs.groups[0].groupName}
Using getGroups
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 getGroups(args: GetGroupsArgs, opts?: InvokeOptions): Promise<GetGroupsResult>
function getGroupsOutput(args: GetGroupsOutputArgs, opts?: InvokeOptions): Output<GetGroupsResult>
def get_groups(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetGroupsResult
def get_groups_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetGroupsResult]
func GetGroups(ctx *Context, args *GetGroupsArgs, opts ...InvokeOption) (*GetGroupsResult, error)
func GetGroupsOutput(ctx *Context, args *GetGroupsOutputArgs, opts ...InvokeOption) GetGroupsResultOutput
> Note: This function is named GetGroups
in the Go SDK.
public static class GetGroups
{
public static Task<GetGroupsResult> InvokeAsync(GetGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetGroupsResult> Invoke(GetGroupsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetGroupsResult> getGroups(GetGroupsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:dns/getGroups:getGroups
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of group IDs.
- Name
Regex string - A regex string to filter results by group name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Ids []string
- A list of group IDs.
- Name
Regex string - A regex string to filter results by group name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- ids List<String>
- A list of group IDs.
- name
Regex String - A regex string to filter results by group name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- ids string[]
- A list of group IDs.
- name
Regex string - A regex string to filter results by group name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- ids Sequence[str]
- A list of group IDs.
- name_
regex str - A regex string to filter results by group name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- ids List<String>
- A list of group IDs.
- name
Regex String - A regex string to filter results by group name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getGroups Result
The following output properties are available:
- Groups
List<Pulumi.
Ali Cloud. Dns. Outputs. Get Groups Group> - A list of groups. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of group IDs.
- Names List<string>
- A list of group names.
- Name
Regex string - Output
File string
- Groups
[]Get
Groups Group - A list of groups. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of group IDs.
- Names []string
- A list of group names.
- Name
Regex string - Output
File string
- groups
List<Get
Groups Group> - A list of groups. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of group IDs.
- names List<String>
- A list of group names.
- name
Regex String - output
File String
- groups
Get
Groups Group[] - A list of groups. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of group IDs.
- names string[]
- A list of group names.
- name
Regex string - output
File string
- groups
Sequence[Get
Groups Group] - A list of groups. Each element contains the following attributes:
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of group IDs.
- names Sequence[str]
- A list of group names.
- name_
regex str - output_
file str
- groups List<Property Map>
- A list of groups. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of group IDs.
- names List<String>
- A list of group names.
- name
Regex String - output
File String
Supporting Types
GetGroupsGroup
- group_
id str - Id of the group.
- group_
name str - Name of the group.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.