Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.actiontrail.getSaslUsers
Explore with Pulumi AI
This data source provides a list of ALIKAFKA Sasl users in an Alibaba Cloud account according to the specified filters.
NOTE: Available in 1.66.0+
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const saslUsersDs = alicloud.actiontrail.getSaslUsers({
instanceId: "xxx",
nameRegex: "username",
outputFile: "saslUsers.txt",
});
export const firstSaslUsername = saslUsersDs.then(saslUsersDs => saslUsersDs.users?.[0]?.username);
import pulumi
import pulumi_alicloud as alicloud
sasl_users_ds = alicloud.actiontrail.get_sasl_users(instance_id="xxx",
name_regex="username",
output_file="saslUsers.txt")
pulumi.export("firstSaslUsername", sasl_users_ds.users[0].username)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/actiontrail"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
saslUsersDs, err := actiontrail.GetSaslUsers(ctx, &actiontrail.GetSaslUsersArgs{
InstanceId: "xxx",
NameRegex: pulumi.StringRef("username"),
OutputFile: pulumi.StringRef("saslUsers.txt"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstSaslUsername", saslUsersDs.Users[0].Username)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var saslUsersDs = AliCloud.ActionTrail.GetSaslUsers.Invoke(new()
{
InstanceId = "xxx",
NameRegex = "username",
OutputFile = "saslUsers.txt",
});
return new Dictionary<string, object?>
{
["firstSaslUsername"] = saslUsersDs.Apply(getSaslUsersResult => getSaslUsersResult.Users[0]?.Username),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.actiontrail.ActiontrailFunctions;
import com.pulumi.alicloud.actiontrail.inputs.GetSaslUsersArgs;
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 saslUsersDs = ActiontrailFunctions.getSaslUsers(GetSaslUsersArgs.builder()
.instanceId("xxx")
.nameRegex("username")
.outputFile("saslUsers.txt")
.build());
ctx.export("firstSaslUsername", saslUsersDs.applyValue(getSaslUsersResult -> getSaslUsersResult.users()[0].username()));
}
}
variables:
saslUsersDs:
fn::invoke:
Function: alicloud:actiontrail:getSaslUsers
Arguments:
instanceId: xxx
nameRegex: username
outputFile: saslUsers.txt
outputs:
firstSaslUsername: ${saslUsersDs.users[0].username}
Using getSaslUsers
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 getSaslUsers(args: GetSaslUsersArgs, opts?: InvokeOptions): Promise<GetSaslUsersResult>
function getSaslUsersOutput(args: GetSaslUsersOutputArgs, opts?: InvokeOptions): Output<GetSaslUsersResult>
def get_sasl_users(instance_id: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSaslUsersResult
def get_sasl_users_output(instance_id: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSaslUsersResult]
func GetSaslUsers(ctx *Context, args *GetSaslUsersArgs, opts ...InvokeOption) (*GetSaslUsersResult, error)
func GetSaslUsersOutput(ctx *Context, args *GetSaslUsersOutputArgs, opts ...InvokeOption) GetSaslUsersResultOutput
> Note: This function is named GetSaslUsers
in the Go SDK.
public static class GetSaslUsers
{
public static Task<GetSaslUsersResult> InvokeAsync(GetSaslUsersArgs args, InvokeOptions? opts = null)
public static Output<GetSaslUsersResult> Invoke(GetSaslUsersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSaslUsersResult> getSaslUsers(GetSaslUsersArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:actiontrail/getSaslUsers:getSaslUsers
arguments:
# arguments dictionary
The following arguments are supported:
- Instance
Id string - ID of the ALIKAFKA Instance that owns the sasl users.
- Name
Regex string - A regex string to filter results by the username.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Instance
Id string - ID of the ALIKAFKA Instance that owns the sasl users.
- Name
Regex string - A regex string to filter results by the username.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- instance
Id String - ID of the ALIKAFKA Instance that owns the sasl users.
- name
Regex String - A regex string to filter results by the username.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- instance
Id string - ID of the ALIKAFKA Instance that owns the sasl users.
- name
Regex string - A regex string to filter results by the username.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- instance_
id str - ID of the ALIKAFKA Instance that owns the sasl users.
- name_
regex str - A regex string to filter results by the username.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- instance
Id String - ID of the ALIKAFKA Instance that owns the sasl users.
- name
Regex String - A regex string to filter results by the username.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getSaslUsers Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Id string - Names List<string>
- A list of sasl usernames.
- Users
List<Pulumi.
Ali Cloud. Action Trail. Outputs. Get Sasl Users User> - A list of sasl users. Each element contains the following attributes:
- Name
Regex string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Id string - Names []string
- A list of sasl usernames.
- Users
[]Get
Sasl Users User - A list of sasl users. Each element contains the following attributes:
- Name
Regex string - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Id String - names List<String>
- A list of sasl usernames.
- users
List<Get
Sasl Users User> - A list of sasl users. Each element contains the following attributes:
- name
Regex String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- instance
Id string - names string[]
- A list of sasl usernames.
- users
Get
Sasl Users User[] - A list of sasl users. Each element contains the following attributes:
- name
Regex string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- instance_
id str - names Sequence[str]
- A list of sasl usernames.
- users
Sequence[Get
Sasl Users User] - A list of sasl users. Each element contains the following attributes:
- name_
regex str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Id String - names List<String>
- A list of sasl usernames.
- users List<Property Map>
- A list of sasl users. Each element contains the following attributes:
- name
Regex String - output
File String
Supporting Types
GetSaslUsersUser
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.