1. Packages
  2. MSSQL
  3. API Docs
  4. getSqlLogins
Microsoft SQL Server v0.0.8 published on Wednesday, Nov 1, 2023 by pulumiverse

mssql.getSqlLogins

Explore with Pulumi AI

mssql logo
Microsoft SQL Server v0.0.8 published on Wednesday, Nov 1, 2023 by pulumiverse

    Obtains information about all SQL logins found in SQL Server instance.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mssql = Pulumi.Mssql;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Mssql.GetSqlLogins.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["databases"] = example.Apply(getSqlLoginsResult => getSqlLoginsResult.Logins),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-mssql/sdk/go/mssql"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := mssql.GetSqlLogins(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("databases", example.Logins)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mssql.MssqlFunctions;
    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 example = MssqlFunctions.getSqlLogins();
    
            ctx.export("databases", example.applyValue(getSqlLoginsResult -> getSqlLoginsResult.logins()));
        }
    }
    
    import pulumi
    import pulumi_mssql as mssql
    
    example = mssql.get_sql_logins()
    pulumi.export("databases", example.logins)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as mssql from "@pulumi/mssql";
    
    const example = mssql.getSqlLogins({});
    export const databases = example.then(example => example.logins);
    
    variables:
      example:
        fn::invoke:
          Function: mssql:getSqlLogins
          Arguments: {}
    outputs:
      databases: ${example.logins}
    

    Using getSqlLogins

    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 getSqlLogins(opts?: InvokeOptions): Promise<GetSqlLoginsResult>
    function getSqlLoginsOutput(opts?: InvokeOptions): Output<GetSqlLoginsResult>
    def get_sql_logins(opts: Optional[InvokeOptions] = None) -> GetSqlLoginsResult
    def get_sql_logins_output(opts: Optional[InvokeOptions] = None) -> Output[GetSqlLoginsResult]
    func GetSqlLogins(ctx *Context, opts ...InvokeOption) (*GetSqlLoginsResult, error)
    func GetSqlLoginsOutput(ctx *Context, opts ...InvokeOption) GetSqlLoginsResultOutput

    > Note: This function is named GetSqlLogins in the Go SDK.

    public static class GetSqlLogins 
    {
        public static Task<GetSqlLoginsResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetSqlLoginsResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSqlLoginsResult> getSqlLogins(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: mssql:index/getSqlLogins:getSqlLogins
      arguments:
        # arguments dictionary

    getSqlLogins Result

    The following output properties are available:

    Id string
    ID of the resource used only internally by the provider.
    Logins List<Pulumiverse.Mssql.Outputs.GetSqlLoginsLogin>
    Set of SQL login objects
    Id string
    ID of the resource used only internally by the provider.
    Logins []GetSqlLoginsLogin
    Set of SQL login objects
    id String
    ID of the resource used only internally by the provider.
    logins List<GetSqlLoginsLogin>
    Set of SQL login objects
    id string
    ID of the resource used only internally by the provider.
    logins GetSqlLoginsLogin[]
    Set of SQL login objects
    id str
    ID of the resource used only internally by the provider.
    logins Sequence[GetSqlLoginsLogin]
    Set of SQL login objects
    id String
    ID of the resource used only internally by the provider.
    logins List<Property Map>
    Set of SQL login objects

    Supporting Types

    GetSqlLoginsLogin

    CheckPasswordExpiration bool
    When true, password expiration policy is enforced for this login.
    CheckPasswordPolicy bool
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login.
    DefaultDatabaseId string
    ID of login's default DB. The ID can be retrieved using mssql.Database data resource.
    DefaultLanguage string
    Default language assigned to login.
    Id string
    Login SID. Can be retrieved using SELECT SUSER_SID('<login_name>').
    MustChangePassword bool
    When true, password change will be forced on first logon.
    Name string
    Login name. Must follow Regular Identifiers rules and cannot contain \
    PrincipalId string
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    CheckPasswordExpiration bool
    When true, password expiration policy is enforced for this login.
    CheckPasswordPolicy bool
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login.
    DefaultDatabaseId string
    ID of login's default DB. The ID can be retrieved using mssql.Database data resource.
    DefaultLanguage string
    Default language assigned to login.
    Id string
    Login SID. Can be retrieved using SELECT SUSER_SID('<login_name>').
    MustChangePassword bool
    When true, password change will be forced on first logon.
    Name string
    Login name. Must follow Regular Identifiers rules and cannot contain \
    PrincipalId string
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    checkPasswordExpiration Boolean
    When true, password expiration policy is enforced for this login.
    checkPasswordPolicy Boolean
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login.
    defaultDatabaseId String
    ID of login's default DB. The ID can be retrieved using mssql.Database data resource.
    defaultLanguage String
    Default language assigned to login.
    id String
    Login SID. Can be retrieved using SELECT SUSER_SID('<login_name>').
    mustChangePassword Boolean
    When true, password change will be forced on first logon.
    name String
    Login name. Must follow Regular Identifiers rules and cannot contain \
    principalId String
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    checkPasswordExpiration boolean
    When true, password expiration policy is enforced for this login.
    checkPasswordPolicy boolean
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login.
    defaultDatabaseId string
    ID of login's default DB. The ID can be retrieved using mssql.Database data resource.
    defaultLanguage string
    Default language assigned to login.
    id string
    Login SID. Can be retrieved using SELECT SUSER_SID('<login_name>').
    mustChangePassword boolean
    When true, password change will be forced on first logon.
    name string
    Login name. Must follow Regular Identifiers rules and cannot contain \
    principalId string
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    check_password_expiration bool
    When true, password expiration policy is enforced for this login.
    check_password_policy bool
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login.
    default_database_id str
    ID of login's default DB. The ID can be retrieved using mssql.Database data resource.
    default_language str
    Default language assigned to login.
    id str
    Login SID. Can be retrieved using SELECT SUSER_SID('<login_name>').
    must_change_password bool
    When true, password change will be forced on first logon.
    name str
    Login name. Must follow Regular Identifiers rules and cannot contain \
    principal_id str
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    checkPasswordExpiration Boolean
    When true, password expiration policy is enforced for this login.
    checkPasswordPolicy Boolean
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login.
    defaultDatabaseId String
    ID of login's default DB. The ID can be retrieved using mssql.Database data resource.
    defaultLanguage String
    Default language assigned to login.
    id String
    Login SID. Can be retrieved using SELECT SUSER_SID('<login_name>').
    mustChangePassword Boolean
    When true, password change will be forced on first logon.
    name String
    Login name. Must follow Regular Identifiers rules and cannot contain \
    principalId String
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.

    Package Details

    Repository
    mssql pulumiverse/pulumi-mssql
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mssql Terraform Provider.
    mssql logo
    Microsoft SQL Server v0.0.8 published on Wednesday, Nov 1, 2023 by pulumiverse