gcp.sql.User
Creates a new Google SQL User on a Google SQL User Instance. For more information, see the official documentation, or the JSON API.
Note: All arguments including the username and password will be stored in the raw state as plain-text.
Example Usage
Example creating a SQL User.
using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var dbNameSuffix = new Random.RandomId("dbNameSuffix", new()
{
ByteLength = 4,
});
var main = new Gcp.Sql.DatabaseInstance("main", new()
{
DatabaseVersion = "MYSQL_5_7",
Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
{
Tier = "db-f1-micro",
},
});
var users = new Gcp.Sql.User("users", new()
{
Instance = main.Name,
Host = "me.com",
Password = "changeme",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/sql"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := random.NewRandomId(ctx, "dbNameSuffix", &random.RandomIdArgs{
ByteLength: pulumi.Int(4),
})
if err != nil {
return err
}
main, err := sql.NewDatabaseInstance(ctx, "main", &sql.DatabaseInstanceArgs{
DatabaseVersion: pulumi.String("MYSQL_5_7"),
Settings: &sql.DatabaseInstanceSettingsArgs{
Tier: pulumi.String("db-f1-micro"),
},
})
if err != nil {
return err
}
_, err = sql.NewUser(ctx, "users", &sql.UserArgs{
Instance: main.Name,
Host: pulumi.String("me.com"),
Password: pulumi.String("changeme"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomId;
import com.pulumi.random.RandomIdArgs;
import com.pulumi.gcp.sql.DatabaseInstance;
import com.pulumi.gcp.sql.DatabaseInstanceArgs;
import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsArgs;
import com.pulumi.gcp.sql.User;
import com.pulumi.gcp.sql.UserArgs;
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) {
var dbNameSuffix = new RandomId("dbNameSuffix", RandomIdArgs.builder()
.byteLength(4)
.build());
var main = new DatabaseInstance("main", DatabaseInstanceArgs.builder()
.databaseVersion("MYSQL_5_7")
.settings(DatabaseInstanceSettingsArgs.builder()
.tier("db-f1-micro")
.build())
.build());
var users = new User("users", UserArgs.builder()
.instance(main.name())
.host("me.com")
.password("changeme")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
import pulumi_random as random
db_name_suffix = random.RandomId("dbNameSuffix", byte_length=4)
main = gcp.sql.DatabaseInstance("main",
database_version="MYSQL_5_7",
settings=gcp.sql.DatabaseInstanceSettingsArgs(
tier="db-f1-micro",
))
users = gcp.sql.User("users",
instance=main.name,
host="me.com",
password="changeme")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as random from "@pulumi/random";
const dbNameSuffix = new random.RandomId("dbNameSuffix", {byteLength: 4});
const main = new gcp.sql.DatabaseInstance("main", {
databaseVersion: "MYSQL_5_7",
settings: {
tier: "db-f1-micro",
},
});
const users = new gcp.sql.User("users", {
instance: main.name,
host: "me.com",
password: "changeme",
});
resources:
dbNameSuffix:
type: random:RandomId
properties:
byteLength: 4
main:
type: gcp:sql:DatabaseInstance
properties:
databaseVersion: MYSQL_5_7
settings:
tier: db-f1-micro
users:
type: gcp:sql:User
properties:
instance: ${main.name}
host: me.com
password: changeme
)
using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var dbNameSuffix = new Random.RandomId("dbNameSuffix", new()
{
ByteLength = 4,
});
var main = new Gcp.Sql.DatabaseInstance("main", new()
{
DatabaseVersion = "POSTGRES_9_6",
Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
{
Tier = "db-f1-micro",
DatabaseFlags = new[]
{
new Gcp.Sql.Inputs.DatabaseInstanceSettingsDatabaseFlagArgs
{
Name = "cloudsql.iam_authentication",
Value = "on",
},
},
},
});
var users = new Gcp.Sql.User("users", new()
{
Instance = main.Name,
Type = "CLOUD_IAM_USER",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/sql"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := random.NewRandomId(ctx, "dbNameSuffix", &random.RandomIdArgs{
ByteLength: pulumi.Int(4),
})
if err != nil {
return err
}
main, err := sql.NewDatabaseInstance(ctx, "main", &sql.DatabaseInstanceArgs{
DatabaseVersion: pulumi.String("POSTGRES_9_6"),
Settings: &sql.DatabaseInstanceSettingsArgs{
Tier: pulumi.String("db-f1-micro"),
DatabaseFlags: sql.DatabaseInstanceSettingsDatabaseFlagArray{
&sql.DatabaseInstanceSettingsDatabaseFlagArgs{
Name: pulumi.String("cloudsql.iam_authentication"),
Value: pulumi.String("on"),
},
},
},
})
if err != nil {
return err
}
_, err = sql.NewUser(ctx, "users", &sql.UserArgs{
Instance: main.Name,
Type: pulumi.String("CLOUD_IAM_USER"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomId;
import com.pulumi.random.RandomIdArgs;
import com.pulumi.gcp.sql.DatabaseInstance;
import com.pulumi.gcp.sql.DatabaseInstanceArgs;
import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsArgs;
import com.pulumi.gcp.sql.User;
import com.pulumi.gcp.sql.UserArgs;
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) {
var dbNameSuffix = new RandomId("dbNameSuffix", RandomIdArgs.builder()
.byteLength(4)
.build());
var main = new DatabaseInstance("main", DatabaseInstanceArgs.builder()
.databaseVersion("POSTGRES_9_6")
.settings(DatabaseInstanceSettingsArgs.builder()
.tier("db-f1-micro")
.databaseFlags(DatabaseInstanceSettingsDatabaseFlagArgs.builder()
.name("cloudsql.iam_authentication")
.value("on")
.build())
.build())
.build());
var users = new User("users", UserArgs.builder()
.instance(main.name())
.type("CLOUD_IAM_USER")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
import pulumi_random as random
db_name_suffix = random.RandomId("dbNameSuffix", byte_length=4)
main = gcp.sql.DatabaseInstance("main",
database_version="POSTGRES_9_6",
settings=gcp.sql.DatabaseInstanceSettingsArgs(
tier="db-f1-micro",
database_flags=[gcp.sql.DatabaseInstanceSettingsDatabaseFlagArgs(
name="cloudsql.iam_authentication",
value="on",
)],
))
users = gcp.sql.User("users",
instance=main.name,
type="CLOUD_IAM_USER")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as random from "@pulumi/random";
const dbNameSuffix = new random.RandomId("dbNameSuffix", {byteLength: 4});
const main = new gcp.sql.DatabaseInstance("main", {
databaseVersion: "POSTGRES_9_6",
settings: {
tier: "db-f1-micro",
databaseFlags: [{
name: "cloudsql.iam_authentication",
value: "on",
}],
},
});
const users = new gcp.sql.User("users", {
instance: main.name,
type: "CLOUD_IAM_USER",
});
resources:
dbNameSuffix:
type: random:RandomId
properties:
byteLength: 4
main:
type: gcp:sql:DatabaseInstance
properties:
databaseVersion: POSTGRES_9_6
settings:
tier: db-f1-micro
databaseFlags:
- name: cloudsql.iam_authentication
value: on
users:
type: gcp:sql:User
properties:
instance: ${main.name}
type: CLOUD_IAM_USER
Create User Resource
new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: str,
opts: Optional[ResourceOptions] = None,
deletion_policy: Optional[str] = None,
host: Optional[str] = None,
instance: Optional[str] = None,
name: Optional[str] = None,
password: Optional[str] = None,
password_policy: Optional[UserPasswordPolicyArgs] = None,
project: Optional[str] = None,
type: Optional[str] = None)
@overload
def User(resource_name: str,
args: UserArgs,
opts: Optional[ResourceOptions] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
type: gcp:sql:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserArgs
- 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 UserArgs
- 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 UserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
User 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 User resource accepts the following input properties:
- Instance string
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- Deletion
Policy string The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- Host string
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- Name string
The name of the user. Changing this forces a new resource to be created.
- Password string
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- Password
Policy UserPassword Policy Args - Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Type string
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- Instance string
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- Deletion
Policy string The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- Host string
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- Name string
The name of the user. Changing this forces a new resource to be created.
- Password string
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- Password
Policy UserPassword Policy Args - Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Type string
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- instance String
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- deletion
Policy String The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- host String
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- name String
The name of the user. Changing this forces a new resource to be created.
- password String
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- password
Policy UserPassword Policy Args - project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- type String
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- instance string
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- deletion
Policy string The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- host string
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- name string
The name of the user. Changing this forces a new resource to be created.
- password string
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- password
Policy UserPassword Policy Args - project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- type string
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- instance str
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- deletion_
policy str The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- host str
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- name str
The name of the user. Changing this forces a new resource to be created.
- password str
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- password_
policy UserPassword Policy Args - project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- type str
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- instance String
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- deletion
Policy String The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- host String
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- name String
The name of the user. Changing this forces a new resource to be created.
- password String
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- password
Policy Property Map - project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- type String
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
Outputs
All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Sql
Server List<UserUser Details Sql Server User Detail>
- Id string
The provider-assigned unique ID for this managed resource.
- Sql
Server []UserUser Details Sql Server User Detail
- id String
The provider-assigned unique ID for this managed resource.
- sql
Server List<UserUser Details Sql Server User Detail>
- id string
The provider-assigned unique ID for this managed resource.
- sql
Server UserUser Details Sql Server User Detail[]
- id str
The provider-assigned unique ID for this managed resource.
- sql_
server_ Sequence[Useruser_ details Sql Server User Detail]
- id String
The provider-assigned unique ID for this managed resource.
- sql
Server List<Property Map>User Details
Look up Existing User Resource
Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
deletion_policy: Optional[str] = None,
host: Optional[str] = None,
instance: Optional[str] = None,
name: Optional[str] = None,
password: Optional[str] = None,
password_policy: Optional[UserPasswordPolicyArgs] = None,
project: Optional[str] = None,
sql_server_user_details: Optional[Sequence[UserSqlServerUserDetailArgs]] = None,
type: Optional[str] = None) -> User
func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
public static User get(String name, Output<String> id, UserState 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.
- Deletion
Policy string The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- Host string
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- Instance string
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- Name string
The name of the user. Changing this forces a new resource to be created.
- Password string
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- Password
Policy UserPassword Policy Args - Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Sql
Server List<UserUser Details Sql Server User Detail Args> - Type string
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- Deletion
Policy string The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- Host string
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- Instance string
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- Name string
The name of the user. Changing this forces a new resource to be created.
- Password string
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- Password
Policy UserPassword Policy Args - Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Sql
Server []UserUser Details Sql Server User Detail Args - Type string
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- deletion
Policy String The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- host String
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- instance String
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- name String
The name of the user. Changing this forces a new resource to be created.
- password String
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- password
Policy UserPassword Policy Args - project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- sql
Server List<UserUser Details Sql Server User Detail Args> - type String
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- deletion
Policy string The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- host string
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- instance string
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- name string
The name of the user. Changing this forces a new resource to be created.
- password string
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- password
Policy UserPassword Policy Args - project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- sql
Server UserUser Details Sql Server User Detail Args[] - type string
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- deletion_
policy str The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- host str
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- instance str
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- name str
The name of the user. Changing this forces a new resource to be created.
- password str
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- password_
policy UserPassword Policy Args - project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- sql_
server_ Sequence[Useruser_ details Sql Server User Detail Args] - type str
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
- deletion
Policy String The deletion policy for the user. Setting
ABANDON
allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles.- host String
The host the user can connect from. This is only supported for BUILT_IN users in MySQL instances. Don't set this field for PostgreSQL and SQL Server instances. Can be an IP address. Changing this forces a new resource to be created.
- instance String
The name of the Cloud SQL instance. Changing this forces a new resource to be created.
- name String
The name of the user. Changing this forces a new resource to be created.
- password String
The password for the user. Can be updated. For Postgres instances this is a Required field, unless type is set to either CLOUD_IAM_USER or CLOUD_IAM_SERVICE_ACCOUNT. Don't set this field for CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNT user types for any Cloud SQL instance.
- password
Policy Property Map - project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- sql
Server List<Property Map>User Details - type String
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".
Supporting Types
UserPasswordPolicy
- Allowed
Failed intAttempts Number of failed attempts allowed before the user get locked.
- Enable
Failed boolAttempts Check If true, the check that will lock user after too many failed login attempts will be enabled.
- Enable
Password boolVerification If true, the user must specify the current password before changing the password. This flag is supported only for MySQL.
- Password
Expiration stringDuration Password expiration duration with one week grace period.
- Statuses
List<User
Password Policy Status>
- Allowed
Failed intAttempts Number of failed attempts allowed before the user get locked.
- Enable
Failed boolAttempts Check If true, the check that will lock user after too many failed login attempts will be enabled.
- Enable
Password boolVerification If true, the user must specify the current password before changing the password. This flag is supported only for MySQL.
- Password
Expiration stringDuration Password expiration duration with one week grace period.
- Statuses
[]User
Password Policy Status
- allowed
Failed IntegerAttempts Number of failed attempts allowed before the user get locked.
- enable
Failed BooleanAttempts Check If true, the check that will lock user after too many failed login attempts will be enabled.
- enable
Password BooleanVerification If true, the user must specify the current password before changing the password. This flag is supported only for MySQL.
- password
Expiration StringDuration Password expiration duration with one week grace period.
- statuses
List<User
Password Policy Status>
- allowed
Failed numberAttempts Number of failed attempts allowed before the user get locked.
- enable
Failed booleanAttempts Check If true, the check that will lock user after too many failed login attempts will be enabled.
- enable
Password booleanVerification If true, the user must specify the current password before changing the password. This flag is supported only for MySQL.
- password
Expiration stringDuration Password expiration duration with one week grace period.
- statuses
User
Password Policy Status[]
- allowed_
failed_ intattempts Number of failed attempts allowed before the user get locked.
- enable_
failed_ boolattempts_ check If true, the check that will lock user after too many failed login attempts will be enabled.
- enable_
password_ boolverification If true, the user must specify the current password before changing the password. This flag is supported only for MySQL.
- password_
expiration_ strduration Password expiration duration with one week grace period.
- statuses
Sequence[User
Password Policy Status]
- allowed
Failed NumberAttempts Number of failed attempts allowed before the user get locked.
- enable
Failed BooleanAttempts Check If true, the check that will lock user after too many failed login attempts will be enabled.
- enable
Password BooleanVerification If true, the user must specify the current password before changing the password. This flag is supported only for MySQL.
- password
Expiration StringDuration Password expiration duration with one week grace period.
- statuses List<Property Map>
UserPasswordPolicyStatus
- Locked bool
If true, user does not have login privileges.
- Password
Expiration stringTime Password expiration duration with one week grace period.
- Locked bool
If true, user does not have login privileges.
- Password
Expiration stringTime Password expiration duration with one week grace period.
- locked Boolean
If true, user does not have login privileges.
- password
Expiration StringTime Password expiration duration with one week grace period.
- locked boolean
If true, user does not have login privileges.
- password
Expiration stringTime Password expiration duration with one week grace period.
- locked bool
If true, user does not have login privileges.
- password_
expiration_ strtime Password expiration duration with one week grace period.
- locked Boolean
If true, user does not have login privileges.
- password
Expiration StringTime Password expiration duration with one week grace period.
UserSqlServerUserDetail
- Disabled bool
- Server
Roles List<string>
- Disabled bool
- Server
Roles []string
- disabled Boolean
- server
Roles List<String>
- disabled boolean
- server
Roles string[]
- disabled bool
- server_
roles Sequence[str]
- disabled Boolean
- server
Roles List<String>
Import
SQL users for MySQL databases can be imported using the project
, instance
, host
and name
, e.g.
$ pulumi import gcp:sql/user:User users my-project/main-instance/my-domain.com/me
SQL users for PostgreSQL databases can be imported using the project
, instance
and name
, e.g.
$ pulumi import gcp:sql/user:User users my-project/main-instance/me
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.