mssql.SqlLogin
Explore with Pulumi AI
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
'
orname
. - Check
Password boolExpiration - When
true
, password expiration policy is enforced for this login. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Check
Password boolPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Default
Database stringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Default
Language 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.
- Must
Change boolPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - Check
Password boolExpiration - When
true
, password expiration policy is enforced for this login. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Check
Password boolPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Default
Database stringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Default
Language 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.
- Must
Change boolPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - check
Password BooleanExpiration - When
true
, password expiration policy is enforced for this login. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - check
Password BooleanPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Database StringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Language 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.
- must
Change BooleanPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - check
Password booleanExpiration - When
true
, password expiration policy is enforced for this login. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - check
Password booleanPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Database stringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Language 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.
- must
Change booleanPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - check_
password_ boolexpiration - When
true
, password expiration policy is enforced for this login. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - check_
password_ boolpolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default_
database_ strid - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> 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_ boolpassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - check
Password BooleanExpiration - When
true
, password expiration policy is enforced for this login. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - check
Password BooleanPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Database StringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Language 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.
- must
Change BooleanPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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.
- Principal
Id string - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.sql_logins
.
- Id string
- The provider-assigned unique ID for this managed resource.
- Principal
Id string - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.sql_logins
.
- id String
- The provider-assigned unique ID for this managed resource.
- principal
Id String - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.sql_logins
.
- id string
- The provider-assigned unique ID for this managed resource.
- principal
Id string - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.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 fromsys.sql_logins
.
- id String
- The provider-assigned unique ID for this managed resource.
- principal
Id String - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.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.
- Check
Password boolExpiration - When
true
, password expiration policy is enforced for this login. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Check
Password boolPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Default
Database stringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Default
Language 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.
- Must
Change boolPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - 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. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Check
Password boolPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Default
Database stringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - Default
Language 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.
- Must
Change boolPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - 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. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - check
Password BooleanPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Database StringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Language 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.
- must
Change BooleanPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - 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. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - check
Password booleanPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Database stringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Language 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.
- must
Change booleanPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - 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. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - check_
password_ boolpolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default_
database_ strid - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> 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_ boolpassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - 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. Defaults tofalse
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - check
Password BooleanPolicy - When
true
, the Windows password policies of the computer on which SQL Server is running are enforced on this login. Defaults totrue
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Database StringId - ID of login's default DB. The ID can be retrieved using
mssql_database
data resource. Defaults to ID ofmaster
. -> Note In case of Azure SQL, which does not support this feature, the flag will be ignored. - default
Language 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.
- must
Change BooleanPassword - When true, password change will be forced on first logon. Defaults to
false
. -> Note After password is changed, this flag is being reset tofalse
, which will show as changes in Terraform plan. Useignore_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
'
orname
. - principal
Id String - ID used to reference SQL Login in other resources, e.g.
server_role
. Can be retrieved fromsys.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.