Microsoft SQL Server v0.1.0 published on Tuesday, Oct 8, 2024 by pulumiverse
mssql.getSqlLogins
Explore with Pulumi AI

Microsoft SQL Server v0.1.0 published on Tuesday, Oct 8, 2024 by pulumiverse
Obtains information about all SQL logins found in SQL Server instance.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as mssql from "@pulumi/mssql";
const example = mssql.getSqlLogins({});
export const databases = example.then(example => example.logins);
import pulumi
import pulumi_mssql as mssql
example = mssql.get_sql_logins()
pulumi.export("databases", example.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
})
}
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 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()));
}
}
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)
public static Output<GetSqlLoginsResult> getSqlLogins(InvokeOptions options)
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. Get Sql Logins Login> - Set of SQL login objects
- Id string
- ID of the resource used only internally by the provider.
- Logins
[]Get
Sql Logins Login - Set of SQL login objects
- id String
- ID of the resource used only internally by the provider.
- logins
List<Get
Sql Logins Login> - Set of SQL login objects
- id string
- ID of the resource used only internally by the provider.
- logins
Get
Sql Logins Login[] - Set of SQL login objects
- id str
- ID of the resource used only internally by the provider.
- logins
Sequence[Get
Sql Logins Login] - 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
- Check
Password boolExpiration - When
true
, password expiration policy is enforced for this login. - Check
Password boolPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. - Default
Database stringId - ID of login's default DB. The ID can be retrieved using
mssql.Database
data resource. - Default
Language string - Default language assigned to login.
- Id string
- Login SID. Can be retrieved using
SELECT SUSER_SID('<login_name>')
. - Must
Change boolPassword - When true, password change will be forced on first logon.
- Name string
- Login name. Must follow Regular Identifiers rules and cannot contain
\
- Principal
Id string - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.sql_logins
.
- Check
Password boolExpiration - When
true
, password expiration policy is enforced for this login. - Check
Password boolPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. - Default
Database stringId - ID of login's default DB. The ID can be retrieved using
mssql.Database
data resource. - Default
Language string - Default language assigned to login.
- Id string
- Login SID. Can be retrieved using
SELECT SUSER_SID('<login_name>')
. - Must
Change boolPassword - When true, password change will be forced on first logon.
- Name string
- Login name. Must follow Regular Identifiers rules and cannot contain
\
- Principal
Id string - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.sql_logins
.
- check
Password BooleanExpiration - When
true
, password expiration policy is enforced for this login. - check
Password BooleanPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. - default
Database StringId - ID of login's default DB. The ID can be retrieved using
mssql.Database
data resource. - default
Language String - Default language assigned to login.
- id String
- Login SID. Can be retrieved using
SELECT SUSER_SID('<login_name>')
. - must
Change BooleanPassword - When true, password change will be forced on first logon.
- name String
- Login name. Must follow Regular Identifiers rules and cannot contain
\
- principal
Id String - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.sql_logins
.
- check
Password booleanExpiration - When
true
, password expiration policy is enforced for this login. - check
Password booleanPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. - default
Database stringId - ID of login's default DB. The ID can be retrieved using
mssql.Database
data resource. - default
Language string - Default language assigned to login.
- id string
- Login SID. Can be retrieved using
SELECT SUSER_SID('<login_name>')
. - must
Change booleanPassword - When true, password change will be forced on first logon.
- name string
- Login name. Must follow Regular Identifiers rules and cannot contain
\
- principal
Id string - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.sql_logins
.
- check_
password_ boolexpiration - When
true
, password expiration policy is enforced for this login. - check_
password_ boolpolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. - default_
database_ strid - 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_ boolpassword - 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 fromsys.sql_logins
.
- check
Password BooleanExpiration - When
true
, password expiration policy is enforced for this login. - check
Password BooleanPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. - default
Database StringId - ID of login's default DB. The ID can be retrieved using
mssql.Database
data resource. - default
Language String - Default language assigned to login.
- id String
- Login SID. Can be retrieved using
SELECT SUSER_SID('<login_name>')
. - must
Change BooleanPassword - When true, password change will be forced on first logon.
- name String
- Login name. Must follow Regular Identifiers rules and cannot contain
\
- principal
Id String - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.sql_logins
.
Package Details
- Repository
- mssql pulumiverse/pulumi-mssql
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mssql
Terraform Provider.

Microsoft SQL Server v0.1.0 published on Tuesday, Oct 8, 2024 by pulumiverse