Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getSaslUsers

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

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var saslUsersDs = Output.Create(AliCloud.ActionTrail.GetSaslUsers.InvokeAsync(new AliCloud.ActionTrail.GetSaslUsersArgs
        {
            InstanceId = "xxx",
            NameRegex = "username",
            OutputFile = "saslUsers.txt",
        }));
        this.FirstSaslUsername = saslUsersDs.Apply(saslUsersDs => saslUsersDs.Users?[0]?.Username);
    }

    [Output("firstSaslUsername")]
    public Output<string> FirstSaslUsername { get; set; }
}
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
	})
}
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()));
    }
}
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)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const saslUsersDs = pulumi.output(alicloud.actiontrail.getSaslUsers({
    instanceId: "xxx",
    nameRegex: "username",
    outputFile: "saslUsers.txt",
}));

export const firstSaslUsername = saslUsersDs.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:

InstanceId string

ID of the ALIKAFKA Instance that owns the sasl users.

NameRegex string

A regex string to filter results by the username.

OutputFile string
InstanceId string

ID of the ALIKAFKA Instance that owns the sasl users.

NameRegex string

A regex string to filter results by the username.

OutputFile string
instanceId String

ID of the ALIKAFKA Instance that owns the sasl users.

nameRegex String

A regex string to filter results by the username.

outputFile String
instanceId string

ID of the ALIKAFKA Instance that owns the sasl users.

nameRegex string

A regex string to filter results by the username.

outputFile string
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
instanceId String

ID of the ALIKAFKA Instance that owns the sasl users.

nameRegex String

A regex string to filter results by the username.

outputFile String

getSaslUsers Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

InstanceId string
Names List<string>

A list of sasl usernames.

Users List<Pulumi.AliCloud.ActionTrail.Outputs.GetSaslUsersUser>

A list of sasl users. Each element contains the following attributes:

NameRegex string
OutputFile string
Id string

The provider-assigned unique ID for this managed resource.

InstanceId string
Names []string

A list of sasl usernames.

Users []GetSaslUsersUser

A list of sasl users. Each element contains the following attributes:

NameRegex string
OutputFile string
id String

The provider-assigned unique ID for this managed resource.

instanceId String
names List<String>

A list of sasl usernames.

users List<GetSaslUsersUser>

A list of sasl users. Each element contains the following attributes:

nameRegex String
outputFile String
id string

The provider-assigned unique ID for this managed resource.

instanceId string
names string[]

A list of sasl usernames.

users GetSaslUsersUser[]

A list of sasl users. Each element contains the following attributes:

nameRegex string
outputFile 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[GetSaslUsersUser]

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.

instanceId String
names List<String>

A list of sasl usernames.

users List<Property Map>

A list of sasl users. Each element contains the following attributes:

nameRegex String
outputFile String

Supporting Types

GetSaslUsersUser

Password string

The password of the user.

Username string

The username of the user.

Password string

The password of the user.

Username string

The username of the user.

password String

The password of the user.

username String

The username of the user.

password string

The password of the user.

username string

The username of the user.

password str

The password of the user.

username str

The username of the user.

password String

The password of the user.

username String

The username of the user.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.