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

mssql.SqlLogin

Explore with Pulumi AI

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

    Manages single login.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mssql = Pulumi.Mssql;
    using Mssql = Pulumiverse.Mssql;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleDatabase = Mssql.GetDatabase.Invoke(new()
        {
            Name = "example",
        });
    
        var exampleSqlLogin = new Mssql.SqlLogin("exampleSqlLogin", new()
        {
            Password = "Str0ngPa$$word12",
            MustChangePassword = true,
            DefaultDatabaseId = exampleDatabase.Apply(getDatabaseResult => getDatabaseResult.Id),
            DefaultLanguage = "english",
            CheckPasswordExpiration = true,
            CheckPasswordPolicy = true,
        });
    
        return new Dictionary<string, object?>
        {
            ["loginId"] = exampleSqlLogin.Id,
        };
    });
    
    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 {
    		exampleDatabase, err := mssql.LookupDatabase(ctx, &mssql.LookupDatabaseArgs{
    			Name: "example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleSqlLogin, err := mssql.NewSqlLogin(ctx, "exampleSqlLogin", &mssql.SqlLoginArgs{
    			Password:                pulumi.String("Str0ngPa$$word12"),
    			MustChangePassword:      pulumi.Bool(true),
    			DefaultDatabaseId:       *pulumi.String(exampleDatabase.Id),
    			DefaultLanguage:         pulumi.String("english"),
    			CheckPasswordExpiration: pulumi.Bool(true),
    			CheckPasswordPolicy:     pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("loginId", exampleSqlLogin.ID())
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mssql.MssqlFunctions;
    import com.pulumi.mssql.inputs.GetDatabaseArgs;
    import com.pulumi.mssql.SqlLogin;
    import com.pulumi.mssql.SqlLoginArgs;
    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 exampleDatabase = MssqlFunctions.getDatabase(GetDatabaseArgs.builder()
                .name("example")
                .build());
    
            var exampleSqlLogin = new SqlLogin("exampleSqlLogin", SqlLoginArgs.builder()        
                .password("Str0ngPa$$word12")
                .mustChangePassword(true)
                .defaultDatabaseId(exampleDatabase.applyValue(getDatabaseResult -> getDatabaseResult.id()))
                .defaultLanguage("english")
                .checkPasswordExpiration(true)
                .checkPasswordPolicy(true)
                .build());
    
            ctx.export("loginId", exampleSqlLogin.id());
        }
    }
    
    import pulumi
    import pulumi_mssql as mssql
    import pulumiverse_mssql as mssql
    
    example_database = mssql.get_database(name="example")
    example_sql_login = mssql.SqlLogin("exampleSqlLogin",
        password="Str0ngPa$$word12",
        must_change_password=True,
        default_database_id=example_database.id,
        default_language="english",
        check_password_expiration=True,
        check_password_policy=True)
    pulumi.export("loginId", example_sql_login.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as mssql from "@pulumi/mssql";
    import * as mssql from "@pulumiverse/mssql";
    
    const exampleDatabase = mssql.getDatabase({
        name: "example",
    });
    const exampleSqlLogin = new mssql.SqlLogin("exampleSqlLogin", {
        password: "Str0ngPa$$word12",
        mustChangePassword: true,
        defaultDatabaseId: exampleDatabase.then(exampleDatabase => exampleDatabase.id),
        defaultLanguage: "english",
        checkPasswordExpiration: true,
        checkPasswordPolicy: true,
    });
    export const loginId = exampleSqlLogin.id;
    
    resources:
      exampleSqlLogin:
        type: mssql:SqlLogin
        properties:
          password: Str0ngPa$$word12
          mustChangePassword: true
          defaultDatabaseId: ${exampleDatabase.id}
          defaultLanguage: english
          checkPasswordExpiration: true
          checkPasswordPolicy: true
    variables:
      exampleDatabase:
        fn::invoke:
          Function: mssql:getDatabase
          Arguments:
            name: example
    outputs:
      loginId: ${exampleSqlLogin.id}
    

    Create SqlLogin Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SqlLogin(name: string, args: SqlLoginArgs, opts?: CustomResourceOptions);
    @overload
    def SqlLogin(resource_name: str,
                 args: SqlLoginArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def SqlLogin(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 password: Optional[str] = None,
                 check_password_expiration: Optional[bool] = None,
                 check_password_policy: Optional[bool] = None,
                 default_database_id: Optional[str] = None,
                 default_language: Optional[str] = None,
                 must_change_password: Optional[bool] = None,
                 name: Optional[str] = None)
    func NewSqlLogin(ctx *Context, name string, args SqlLoginArgs, opts ...ResourceOption) (*SqlLogin, error)
    public SqlLogin(string name, SqlLoginArgs args, CustomResourceOptions? opts = null)
    public SqlLogin(String name, SqlLoginArgs args)
    public SqlLogin(String name, SqlLoginArgs args, CustomResourceOptions options)
    
    type: mssql:SqlLogin
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SqlLoginArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SqlLoginArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SqlLoginArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SqlLoginArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SqlLoginArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var sqlLoginResource = new Mssql.SqlLogin("sqlLoginResource", new()
    {
        Password = "string",
        CheckPasswordExpiration = false,
        CheckPasswordPolicy = false,
        DefaultDatabaseId = "string",
        DefaultLanguage = "string",
        MustChangePassword = false,
        Name = "string",
    });
    
    example, err := mssql.NewSqlLogin(ctx, "sqlLoginResource", &mssql.SqlLoginArgs{
    	Password:                pulumi.String("string"),
    	CheckPasswordExpiration: pulumi.Bool(false),
    	CheckPasswordPolicy:     pulumi.Bool(false),
    	DefaultDatabaseId:       pulumi.String("string"),
    	DefaultLanguage:         pulumi.String("string"),
    	MustChangePassword:      pulumi.Bool(false),
    	Name:                    pulumi.String("string"),
    })
    
    var sqlLoginResource = new SqlLogin("sqlLoginResource", SqlLoginArgs.builder()
        .password("string")
        .checkPasswordExpiration(false)
        .checkPasswordPolicy(false)
        .defaultDatabaseId("string")
        .defaultLanguage("string")
        .mustChangePassword(false)
        .name("string")
        .build());
    
    sql_login_resource = mssql.SqlLogin("sqlLoginResource",
        password="string",
        check_password_expiration=False,
        check_password_policy=False,
        default_database_id="string",
        default_language="string",
        must_change_password=False,
        name="string")
    
    const sqlLoginResource = new mssql.SqlLogin("sqlLoginResource", {
        password: "string",
        checkPasswordExpiration: false,
        checkPasswordPolicy: false,
        defaultDatabaseId: "string",
        defaultLanguage: "string",
        mustChangePassword: false,
        name: "string",
    });
    
    type: mssql:SqlLogin
    properties:
        checkPasswordExpiration: false
        checkPasswordPolicy: false
        defaultDatabaseId: string
        defaultLanguage: string
        mustChangePassword: false
        name: string
        password: string
    

    SqlLogin Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The SqlLogin resource accepts the following input properties:

    Password string
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    CheckPasswordExpiration bool
    When true, password expiration policy is enforced for this login. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    CheckPasswordPolicy bool
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    DefaultDatabaseId string
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    DefaultLanguage string
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    MustChangePassword bool
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    Name string
    Login name. Must follow Regular Identifiers rules and cannot contain \
    Password string
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    CheckPasswordExpiration bool
    When true, password expiration policy is enforced for this login. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    CheckPasswordPolicy bool
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    DefaultDatabaseId string
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    DefaultLanguage string
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    MustChangePassword bool
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    Name string
    Login name. Must follow Regular Identifiers rules and cannot contain \
    password String
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    checkPasswordExpiration Boolean
    When true, password expiration policy is enforced for this login. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    checkPasswordPolicy Boolean
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultDatabaseId String
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultLanguage String
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    mustChangePassword Boolean
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    name String
    Login name. Must follow Regular Identifiers rules and cannot contain \
    password string
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    checkPasswordExpiration boolean
    When true, password expiration policy is enforced for this login. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    checkPasswordPolicy boolean
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultDatabaseId string
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultLanguage string
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    mustChangePassword boolean
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    name string
    Login name. Must follow Regular Identifiers rules and cannot contain \
    password str
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    check_password_expiration bool
    When true, password expiration policy is enforced for this login. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    check_password_policy bool
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    default_database_id str
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    default_language str
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    must_change_password bool
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    name str
    Login name. Must follow Regular Identifiers rules and cannot contain \
    password String
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    checkPasswordExpiration Boolean
    When true, password expiration policy is enforced for this login. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    checkPasswordPolicy Boolean
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultDatabaseId String
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultLanguage String
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    mustChangePassword Boolean
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    name String
    Login name. Must follow Regular Identifiers rules and cannot contain \

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SqlLogin resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    PrincipalId string
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrincipalId string
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    id String
    The provider-assigned unique ID for this managed resource.
    principalId String
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    id string
    The provider-assigned unique ID for this managed resource.
    principalId string
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    id str
    The provider-assigned unique ID for this managed resource.
    principal_id str
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.
    id String
    The provider-assigned unique ID for this managed resource.
    principalId String
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.

    Look up Existing SqlLogin Resource

    Get an existing SqlLogin resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: SqlLoginState, opts?: CustomResourceOptions): SqlLogin
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            check_password_expiration: Optional[bool] = None,
            check_password_policy: Optional[bool] = None,
            default_database_id: Optional[str] = None,
            default_language: Optional[str] = None,
            must_change_password: Optional[bool] = None,
            name: Optional[str] = None,
            password: Optional[str] = None,
            principal_id: Optional[str] = None) -> SqlLogin
    func GetSqlLogin(ctx *Context, name string, id IDInput, state *SqlLoginState, opts ...ResourceOption) (*SqlLogin, error)
    public static SqlLogin Get(string name, Input<string> id, SqlLoginState? state, CustomResourceOptions? opts = null)
    public static SqlLogin get(String name, Output<String> id, SqlLoginState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CheckPasswordExpiration bool
    When true, password expiration policy is enforced for this login. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    CheckPasswordPolicy bool
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    DefaultDatabaseId string
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    DefaultLanguage string
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    MustChangePassword bool
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    Name string
    Login name. Must follow Regular Identifiers rules and cannot contain \
    Password string
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    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. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    CheckPasswordPolicy bool
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    DefaultDatabaseId string
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    DefaultLanguage string
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    MustChangePassword bool
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    Name string
    Login name. Must follow Regular Identifiers rules and cannot contain \
    Password string
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    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. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    checkPasswordPolicy Boolean
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultDatabaseId String
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultLanguage String
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    mustChangePassword Boolean
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    name String
    Login name. Must follow Regular Identifiers rules and cannot contain \
    password String
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    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. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    checkPasswordPolicy boolean
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultDatabaseId string
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultLanguage string
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    mustChangePassword boolean
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    name string
    Login name. Must follow Regular Identifiers rules and cannot contain \
    password string
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    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. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    check_password_policy bool
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    default_database_id str
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    default_language str
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    must_change_password bool
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    name str
    Login name. Must follow Regular Identifiers rules and cannot contain \
    password str
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    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. Defaults to false. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    checkPasswordPolicy Boolean
    When true, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults to true. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultDatabaseId String
    ID of login's default DB. The ID can be retrieved using mssql_database data resource. Defaults to ID of master. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    defaultLanguage String
    Default language assigned to login. Defaults to current default language of the server. If the default language of the server is later changed, the default language of the login remains unchanged. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    mustChangePassword Boolean
    When true, password change will be forced on first logon. Defaults to false. -> Note After password is changed, this flag is being reset to false, which will show as changes in Terraform plan. Use ignore_changes block to prevent this behavior. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored.
    name String
    Login name. Must follow Regular Identifiers rules and cannot contain \
    password String
    Password for the login. Must follow strong password policies defined for SQL server. Passwords are case-sensitive, length must be 8-128 chars, can include all characters except ' or name.
    principalId String
    ID used to reference SQL Login in other resources, e.g. server_role. Can be retrieved from sys.sql_logins.

    Import

    import using login ID - can be retrieved using SELECT SUSER_SID('<login_name>')

     $ pulumi import mssql:index/sqlLogin:SqlLogin example 0x27578D8516843E4094EFA2CEED085C82
    

    To learn more about importing existing cloud resources, see Importing resources.

    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