1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. actiontrail
  5. getSaslUsers
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.actiontrail.getSaslUsers

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    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:

    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
    File name where to save data source results (after running pulumi preview).
    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
    File name where to save data source results (after running pulumi preview).
    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
    File name where to save data source results (after running pulumi preview).
    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
    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).
    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
    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.
    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
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi