ionoscloud.dbaas.MongoUser
Explore with Pulumi AI
Manages a DbaaS Mongo User. .
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
// Basic example
const datacenterExample = new ionoscloud.compute.Datacenter("datacenter_example", {
name: "example",
location: "de/txl",
description: "Datacenter for testing dbaas cluster",
});
const lanExample = new ionoscloud.compute.Lan("lan_example", {
datacenterId: datacenterExample.id,
"public": false,
name: "example",
});
const exampleMongoCluster = new ionoscloud.dbaas.MongoCluster("example_mongo_cluster", {
maintenanceWindow: {
dayOfTheWeek: "Sunday",
time: "09:00:00",
},
mongodbVersion: "5.0",
instances: 1,
displayName: "example_mongo_cluster",
location: datacenterExample.location,
connections: {
datacenterId: datacenterExample.id,
lanId: lanExample.id,
cidrLists: ["192.168.1.108/24"],
},
templateId: "6b78ea06-ee0e-4689-998c-fc9c46e781f6",
});
const exampleMongoUser = new ionoscloud.dbaas.MongoUser("example_mongo_user", {
clusterId: exampleMongoCluster.id,
username: "myUser",
password: "strongPassword",
roles: [
{
role: "read",
database: "db1",
},
{
role: "readWrite",
database: "db2",
},
],
});
import pulumi
import pulumi_ionoscloud as ionoscloud
# Basic example
datacenter_example = ionoscloud.compute.Datacenter("datacenter_example",
name="example",
location="de/txl",
description="Datacenter for testing dbaas cluster")
lan_example = ionoscloud.compute.Lan("lan_example",
datacenter_id=datacenter_example.id,
public=False,
name="example")
example_mongo_cluster = ionoscloud.dbaas.MongoCluster("example_mongo_cluster",
maintenance_window={
"day_of_the_week": "Sunday",
"time": "09:00:00",
},
mongodb_version="5.0",
instances=1,
display_name="example_mongo_cluster",
location=datacenter_example.location,
connections={
"datacenter_id": datacenter_example.id,
"lan_id": lan_example.id,
"cidr_lists": ["192.168.1.108/24"],
},
template_id="6b78ea06-ee0e-4689-998c-fc9c46e781f6")
example_mongo_user = ionoscloud.dbaas.MongoUser("example_mongo_user",
cluster_id=example_mongo_cluster.id,
username="myUser",
password="strongPassword",
roles=[
{
"role": "read",
"database": "db1",
},
{
"role": "readWrite",
"database": "db2",
},
])
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/compute"
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dbaas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Basic example
datacenterExample, err := compute.NewDatacenter(ctx, "datacenter_example", &compute.DatacenterArgs{
Name: pulumi.String("example"),
Location: pulumi.String("de/txl"),
Description: pulumi.String("Datacenter for testing dbaas cluster"),
})
if err != nil {
return err
}
lanExample, err := compute.NewLan(ctx, "lan_example", &compute.LanArgs{
DatacenterId: datacenterExample.ID(),
Public: pulumi.Bool(false),
Name: pulumi.String("example"),
})
if err != nil {
return err
}
exampleMongoCluster, err := dbaas.NewMongoCluster(ctx, "example_mongo_cluster", &dbaas.MongoClusterArgs{
MaintenanceWindow: &dbaas.MongoClusterMaintenanceWindowArgs{
DayOfTheWeek: pulumi.String("Sunday"),
Time: pulumi.String("09:00:00"),
},
MongodbVersion: pulumi.String("5.0"),
Instances: pulumi.Int(1),
DisplayName: pulumi.String("example_mongo_cluster"),
Location: datacenterExample.Location,
Connections: &dbaas.MongoClusterConnectionsArgs{
DatacenterId: datacenterExample.ID(),
LanId: lanExample.ID(),
CidrLists: pulumi.StringArray{
pulumi.String("192.168.1.108/24"),
},
},
TemplateId: pulumi.String("6b78ea06-ee0e-4689-998c-fc9c46e781f6"),
})
if err != nil {
return err
}
_, err = dbaas.NewMongoUser(ctx, "example_mongo_user", &dbaas.MongoUserArgs{
ClusterId: exampleMongoCluster.ID(),
Username: pulumi.String("myUser"),
Password: pulumi.String("strongPassword"),
Roles: dbaas.MongoUserRoleArray{
&dbaas.MongoUserRoleArgs{
Role: pulumi.String("read"),
Database: pulumi.String("db1"),
},
&dbaas.MongoUserRoleArgs{
Role: pulumi.String("readWrite"),
Database: pulumi.String("db2"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
// Basic example
var datacenterExample = new Ionoscloud.Compute.Datacenter("datacenter_example", new()
{
Name = "example",
Location = "de/txl",
Description = "Datacenter for testing dbaas cluster",
});
var lanExample = new Ionoscloud.Compute.Lan("lan_example", new()
{
DatacenterId = datacenterExample.Id,
Public = false,
Name = "example",
});
var exampleMongoCluster = new Ionoscloud.Dbaas.MongoCluster("example_mongo_cluster", new()
{
MaintenanceWindow = new Ionoscloud.Dbaas.Inputs.MongoClusterMaintenanceWindowArgs
{
DayOfTheWeek = "Sunday",
Time = "09:00:00",
},
MongodbVersion = "5.0",
Instances = 1,
DisplayName = "example_mongo_cluster",
Location = datacenterExample.Location,
Connections = new Ionoscloud.Dbaas.Inputs.MongoClusterConnectionsArgs
{
DatacenterId = datacenterExample.Id,
LanId = lanExample.Id,
CidrLists = new[]
{
"192.168.1.108/24",
},
},
TemplateId = "6b78ea06-ee0e-4689-998c-fc9c46e781f6",
});
var exampleMongoUser = new Ionoscloud.Dbaas.MongoUser("example_mongo_user", new()
{
ClusterId = exampleMongoCluster.Id,
Username = "myUser",
Password = "strongPassword",
Roles = new[]
{
new Ionoscloud.Dbaas.Inputs.MongoUserRoleArgs
{
Role = "read",
Database = "db1",
},
new Ionoscloud.Dbaas.Inputs.MongoUserRoleArgs
{
Role = "readWrite",
Database = "db2",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.compute.Datacenter;
import com.pulumi.ionoscloud.compute.DatacenterArgs;
import com.pulumi.ionoscloud.compute.Lan;
import com.pulumi.ionoscloud.compute.LanArgs;
import com.pulumi.ionoscloud.dbaas.MongoCluster;
import com.pulumi.ionoscloud.dbaas.MongoClusterArgs;
import com.pulumi.ionoscloud.dbaas.inputs.MongoClusterMaintenanceWindowArgs;
import com.pulumi.ionoscloud.dbaas.inputs.MongoClusterConnectionsArgs;
import com.pulumi.ionoscloud.dbaas.MongoUser;
import com.pulumi.ionoscloud.dbaas.MongoUserArgs;
import com.pulumi.ionoscloud.dbaas.inputs.MongoUserRoleArgs;
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) {
// Basic example
var datacenterExample = new Datacenter("datacenterExample", DatacenterArgs.builder()
.name("example")
.location("de/txl")
.description("Datacenter for testing dbaas cluster")
.build());
var lanExample = new Lan("lanExample", LanArgs.builder()
.datacenterId(datacenterExample.id())
.public_(false)
.name("example")
.build());
var exampleMongoCluster = new MongoCluster("exampleMongoCluster", MongoClusterArgs.builder()
.maintenanceWindow(MongoClusterMaintenanceWindowArgs.builder()
.dayOfTheWeek("Sunday")
.time("09:00:00")
.build())
.mongodbVersion("5.0")
.instances(1)
.displayName("example_mongo_cluster")
.location(datacenterExample.location())
.connections(MongoClusterConnectionsArgs.builder()
.datacenterId(datacenterExample.id())
.lanId(lanExample.id())
.cidrLists("192.168.1.108/24")
.build())
.templateId("6b78ea06-ee0e-4689-998c-fc9c46e781f6")
.build());
var exampleMongoUser = new MongoUser("exampleMongoUser", MongoUserArgs.builder()
.clusterId(exampleMongoCluster.id())
.username("myUser")
.password("strongPassword")
.roles(
MongoUserRoleArgs.builder()
.role("read")
.database("db1")
.build(),
MongoUserRoleArgs.builder()
.role("readWrite")
.database("db2")
.build())
.build());
}
}
resources:
# Basic example
datacenterExample:
type: ionoscloud:compute:Datacenter
name: datacenter_example
properties:
name: example
location: de/txl
description: Datacenter for testing dbaas cluster
lanExample:
type: ionoscloud:compute:Lan
name: lan_example
properties:
datacenterId: ${datacenterExample.id}
public: false
name: example
exampleMongoCluster:
type: ionoscloud:dbaas:MongoCluster
name: example_mongo_cluster
properties:
maintenanceWindow:
dayOfTheWeek: Sunday
time: 09:00:00
mongodbVersion: '5.0'
instances: 1
displayName: example_mongo_cluster
location: ${datacenterExample.location}
connections:
datacenterId: ${datacenterExample.id}
lanId: ${lanExample.id}
cidrLists:
- 192.168.1.108/24
templateId: 6b78ea06-ee0e-4689-998c-fc9c46e781f6
exampleMongoUser:
type: ionoscloud:dbaas:MongoUser
name: example_mongo_user
properties:
clusterId: ${exampleMongoCluster.id}
username: myUser
password: strongPassword
roles:
- role: read
database: db1
- role: readWrite
database: db2
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
import * as random from "@pulumi/random";
// Complete example
const datacenterExample = new ionoscloud.compute.Datacenter("datacenter_example", {
name: "example",
location: "de/txl",
description: "Datacenter for testing dbaas cluster",
});
const lanExample = new ionoscloud.compute.Lan("lan_example", {
datacenterId: datacenterExample.id,
"public": false,
name: "example",
});
const exampleMongoCluster = new ionoscloud.dbaas.MongoCluster("example_mongo_cluster", {
maintenanceWindow: {
dayOfTheWeek: "Sunday",
time: "09:00:00",
},
mongodbVersion: "5.0",
instances: 1,
displayName: "example_mongo_cluster",
location: datacenterExample.location,
connections: {
datacenterId: datacenterExample.id,
lanId: lanExample.id,
cidrLists: ["192.168.1.108/24"],
},
templateId: "6b78ea06-ee0e-4689-998c-fc9c46e781f6",
});
const clusterPassword = new random.index.Password("cluster_password", {
length: 16,
special: true,
overrideSpecial: "!#$%&*()-_=+[]{}<>:?",
});
const userPassword = new random.index.Password("user_password", {
length: 16,
special: true,
overrideSpecial: "!#$%&*()-_=+[]{}<>:?",
});
const exampleMongoUser = new ionoscloud.dbaas.MongoUser("example_mongo_user", {
clusterId: exampleMongoCluster.id,
username: "myUser",
password: userPassword.result,
roles: [
{
role: "read",
database: "db1",
},
{
role: "readWrite",
database: "db2",
},
],
});
import pulumi
import pulumi_ionoscloud as ionoscloud
import pulumi_random as random
# Complete example
datacenter_example = ionoscloud.compute.Datacenter("datacenter_example",
name="example",
location="de/txl",
description="Datacenter for testing dbaas cluster")
lan_example = ionoscloud.compute.Lan("lan_example",
datacenter_id=datacenter_example.id,
public=False,
name="example")
example_mongo_cluster = ionoscloud.dbaas.MongoCluster("example_mongo_cluster",
maintenance_window={
"day_of_the_week": "Sunday",
"time": "09:00:00",
},
mongodb_version="5.0",
instances=1,
display_name="example_mongo_cluster",
location=datacenter_example.location,
connections={
"datacenter_id": datacenter_example.id,
"lan_id": lan_example.id,
"cidr_lists": ["192.168.1.108/24"],
},
template_id="6b78ea06-ee0e-4689-998c-fc9c46e781f6")
cluster_password = random.index.Password("cluster_password",
length=16,
special=True,
override_special=!#$%&*()-_=+[]{}<>:?)
user_password = random.index.Password("user_password",
length=16,
special=True,
override_special=!#$%&*()-_=+[]{}<>:?)
example_mongo_user = ionoscloud.dbaas.MongoUser("example_mongo_user",
cluster_id=example_mongo_cluster.id,
username="myUser",
password=user_password["result"],
roles=[
{
"role": "read",
"database": "db1",
},
{
"role": "readWrite",
"database": "db2",
},
])
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/compute"
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dbaas"
"github.com/pulumi/pulumi-random/sdk/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Complete example
datacenterExample, err := compute.NewDatacenter(ctx, "datacenter_example", &compute.DatacenterArgs{
Name: pulumi.String("example"),
Location: pulumi.String("de/txl"),
Description: pulumi.String("Datacenter for testing dbaas cluster"),
})
if err != nil {
return err
}
lanExample, err := compute.NewLan(ctx, "lan_example", &compute.LanArgs{
DatacenterId: datacenterExample.ID(),
Public: pulumi.Bool(false),
Name: pulumi.String("example"),
})
if err != nil {
return err
}
exampleMongoCluster, err := dbaas.NewMongoCluster(ctx, "example_mongo_cluster", &dbaas.MongoClusterArgs{
MaintenanceWindow: &dbaas.MongoClusterMaintenanceWindowArgs{
DayOfTheWeek: pulumi.String("Sunday"),
Time: pulumi.String("09:00:00"),
},
MongodbVersion: pulumi.String("5.0"),
Instances: pulumi.Int(1),
DisplayName: pulumi.String("example_mongo_cluster"),
Location: datacenterExample.Location,
Connections: &dbaas.MongoClusterConnectionsArgs{
DatacenterId: datacenterExample.ID(),
LanId: lanExample.ID(),
CidrLists: pulumi.StringArray{
pulumi.String("192.168.1.108/24"),
},
},
TemplateId: pulumi.String("6b78ea06-ee0e-4689-998c-fc9c46e781f6"),
})
if err != nil {
return err
}
_, err = random.NewPassword(ctx, "cluster_password", &random.PasswordArgs{
Length: 16,
Special: true,
OverrideSpecial: "!#$%&*()-_=+[]{}<>:?",
})
if err != nil {
return err
}
userPassword, err := random.NewPassword(ctx, "user_password", &random.PasswordArgs{
Length: 16,
Special: true,
OverrideSpecial: "!#$%&*()-_=+[]{}<>:?",
})
if err != nil {
return err
}
_, err = dbaas.NewMongoUser(ctx, "example_mongo_user", &dbaas.MongoUserArgs{
ClusterId: exampleMongoCluster.ID(),
Username: pulumi.String("myUser"),
Password: userPassword.Result,
Roles: dbaas.MongoUserRoleArray{
&dbaas.MongoUserRoleArgs{
Role: pulumi.String("read"),
Database: pulumi.String("db1"),
},
&dbaas.MongoUserRoleArgs{
Role: pulumi.String("readWrite"),
Database: pulumi.String("db2"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
// Complete example
var datacenterExample = new Ionoscloud.Compute.Datacenter("datacenter_example", new()
{
Name = "example",
Location = "de/txl",
Description = "Datacenter for testing dbaas cluster",
});
var lanExample = new Ionoscloud.Compute.Lan("lan_example", new()
{
DatacenterId = datacenterExample.Id,
Public = false,
Name = "example",
});
var exampleMongoCluster = new Ionoscloud.Dbaas.MongoCluster("example_mongo_cluster", new()
{
MaintenanceWindow = new Ionoscloud.Dbaas.Inputs.MongoClusterMaintenanceWindowArgs
{
DayOfTheWeek = "Sunday",
Time = "09:00:00",
},
MongodbVersion = "5.0",
Instances = 1,
DisplayName = "example_mongo_cluster",
Location = datacenterExample.Location,
Connections = new Ionoscloud.Dbaas.Inputs.MongoClusterConnectionsArgs
{
DatacenterId = datacenterExample.Id,
LanId = lanExample.Id,
CidrLists = new[]
{
"192.168.1.108/24",
},
},
TemplateId = "6b78ea06-ee0e-4689-998c-fc9c46e781f6",
});
var clusterPassword = new Random.Index.Password("cluster_password", new()
{
Length = 16,
Special = true,
OverrideSpecial = "!#$%&*()-_=+[]{}<>:?",
});
var userPassword = new Random.Index.Password("user_password", new()
{
Length = 16,
Special = true,
OverrideSpecial = "!#$%&*()-_=+[]{}<>:?",
});
var exampleMongoUser = new Ionoscloud.Dbaas.MongoUser("example_mongo_user", new()
{
ClusterId = exampleMongoCluster.Id,
Username = "myUser",
Password = userPassword.Result,
Roles = new[]
{
new Ionoscloud.Dbaas.Inputs.MongoUserRoleArgs
{
Role = "read",
Database = "db1",
},
new Ionoscloud.Dbaas.Inputs.MongoUserRoleArgs
{
Role = "readWrite",
Database = "db2",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.compute.Datacenter;
import com.pulumi.ionoscloud.compute.DatacenterArgs;
import com.pulumi.ionoscloud.compute.Lan;
import com.pulumi.ionoscloud.compute.LanArgs;
import com.pulumi.ionoscloud.dbaas.MongoCluster;
import com.pulumi.ionoscloud.dbaas.MongoClusterArgs;
import com.pulumi.ionoscloud.dbaas.inputs.MongoClusterMaintenanceWindowArgs;
import com.pulumi.ionoscloud.dbaas.inputs.MongoClusterConnectionsArgs;
import com.pulumi.random.password;
import com.pulumi.random.PasswordArgs;
import com.pulumi.ionoscloud.dbaas.MongoUser;
import com.pulumi.ionoscloud.dbaas.MongoUserArgs;
import com.pulumi.ionoscloud.dbaas.inputs.MongoUserRoleArgs;
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) {
// Complete example
var datacenterExample = new Datacenter("datacenterExample", DatacenterArgs.builder()
.name("example")
.location("de/txl")
.description("Datacenter for testing dbaas cluster")
.build());
var lanExample = new Lan("lanExample", LanArgs.builder()
.datacenterId(datacenterExample.id())
.public_(false)
.name("example")
.build());
var exampleMongoCluster = new MongoCluster("exampleMongoCluster", MongoClusterArgs.builder()
.maintenanceWindow(MongoClusterMaintenanceWindowArgs.builder()
.dayOfTheWeek("Sunday")
.time("09:00:00")
.build())
.mongodbVersion("5.0")
.instances(1)
.displayName("example_mongo_cluster")
.location(datacenterExample.location())
.connections(MongoClusterConnectionsArgs.builder()
.datacenterId(datacenterExample.id())
.lanId(lanExample.id())
.cidrLists("192.168.1.108/24")
.build())
.templateId("6b78ea06-ee0e-4689-998c-fc9c46e781f6")
.build());
var clusterPassword = new Password("clusterPassword", PasswordArgs.builder()
.length(16)
.special(true)
.overrideSpecial("!#$%&*()-_=+[]{}<>:?")
.build());
var userPassword = new Password("userPassword", PasswordArgs.builder()
.length(16)
.special(true)
.overrideSpecial("!#$%&*()-_=+[]{}<>:?")
.build());
var exampleMongoUser = new MongoUser("exampleMongoUser", MongoUserArgs.builder()
.clusterId(exampleMongoCluster.id())
.username("myUser")
.password(userPassword.result())
.roles(
MongoUserRoleArgs.builder()
.role("read")
.database("db1")
.build(),
MongoUserRoleArgs.builder()
.role("readWrite")
.database("db2")
.build())
.build());
}
}
resources:
# Complete example
datacenterExample:
type: ionoscloud:compute:Datacenter
name: datacenter_example
properties:
name: example
location: de/txl
description: Datacenter for testing dbaas cluster
lanExample:
type: ionoscloud:compute:Lan
name: lan_example
properties:
datacenterId: ${datacenterExample.id}
public: false
name: example
exampleMongoCluster:
type: ionoscloud:dbaas:MongoCluster
name: example_mongo_cluster
properties:
maintenanceWindow:
dayOfTheWeek: Sunday
time: 09:00:00
mongodbVersion: '5.0'
instances: 1
displayName: example_mongo_cluster
location: ${datacenterExample.location}
connections:
datacenterId: ${datacenterExample.id}
lanId: ${lanExample.id}
cidrLists:
- 192.168.1.108/24
templateId: 6b78ea06-ee0e-4689-998c-fc9c46e781f6
clusterPassword:
type: random:password
name: cluster_password
properties:
length: 16
special: true
overrideSpecial: '!#$%&*()-_=+[]{}<>:?'
userPassword:
type: random:password
name: user_password
properties:
length: 16
special: true
overrideSpecial: '!#$%&*()-_=+[]{}<>:?'
exampleMongoUser:
type: ionoscloud:dbaas:MongoUser
name: example_mongo_user
properties:
clusterId: ${exampleMongoCluster.id}
username: myUser
password: ${userPassword.result}
roles:
- role: read
database: db1
- role: readWrite
database: db2
Create MongoUser Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MongoUser(name: string, args: MongoUserArgs, opts?: CustomResourceOptions);
@overload
def MongoUser(resource_name: str,
args: MongoUserArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MongoUser(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
password: Optional[str] = None,
username: Optional[str] = None,
roles: Optional[Sequence[MongoUserRoleArgs]] = None)
func NewMongoUser(ctx *Context, name string, args MongoUserArgs, opts ...ResourceOption) (*MongoUser, error)
public MongoUser(string name, MongoUserArgs args, CustomResourceOptions? opts = null)
public MongoUser(String name, MongoUserArgs args)
public MongoUser(String name, MongoUserArgs args, CustomResourceOptions options)
type: ionoscloud:dbaas:MongoUser
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 MongoUserArgs
- 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 MongoUserArgs
- 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 MongoUserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MongoUserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MongoUserArgs
- 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 mongoUserResource = new Ionoscloud.Dbaas.MongoUser("mongoUserResource", new()
{
ClusterId = "string",
Password = "string",
Username = "string",
Roles = new[]
{
new Ionoscloud.Dbaas.Inputs.MongoUserRoleArgs
{
Database = "string",
Role = "string",
},
},
});
example, err := dbaas.NewMongoUser(ctx, "mongoUserResource", &dbaas.MongoUserArgs{
ClusterId: pulumi.String("string"),
Password: pulumi.String("string"),
Username: pulumi.String("string"),
Roles: dbaas.MongoUserRoleArray{
&dbaas.MongoUserRoleArgs{
Database: pulumi.String("string"),
Role: pulumi.String("string"),
},
},
})
var mongoUserResource = new MongoUser("mongoUserResource", MongoUserArgs.builder()
.clusterId("string")
.password("string")
.username("string")
.roles(MongoUserRoleArgs.builder()
.database("string")
.role("string")
.build())
.build());
mongo_user_resource = ionoscloud.dbaas.MongoUser("mongoUserResource",
cluster_id="string",
password="string",
username="string",
roles=[{
"database": "string",
"role": "string",
}])
const mongoUserResource = new ionoscloud.dbaas.MongoUser("mongoUserResource", {
clusterId: "string",
password: "string",
username: "string",
roles: [{
database: "string",
role: "string",
}],
});
type: ionoscloud:dbaas:MongoUser
properties:
clusterId: string
password: string
roles:
- database: string
role: string
username: string
MongoUser Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MongoUser resource accepts the following input properties:
- Cluster
Id string - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- Password string
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- Username string
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- Roles
List<Ionoscloud.
Mongo User Role> - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- Cluster
Id string - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- Password string
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- Username string
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- Roles
[]Mongo
User Role Args - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- cluster
Id String - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- password String
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- username String
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- roles
List<Mongo
User Role> - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- cluster
Id string - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- password string
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- username string
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- roles
Mongo
User Role[] - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- cluster_
id str - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- password str
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- username str
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- roles
Sequence[Mongo
User Role Args] - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- cluster
Id String - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- password String
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- username String
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- roles List<Property Map>
- [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
Outputs
All input properties are implicitly available as output properties. Additionally, the MongoUser resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing MongoUser Resource
Get an existing MongoUser 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?: MongoUserState, opts?: CustomResourceOptions): MongoUser
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
password: Optional[str] = None,
roles: Optional[Sequence[MongoUserRoleArgs]] = None,
username: Optional[str] = None) -> MongoUser
func GetMongoUser(ctx *Context, name string, id IDInput, state *MongoUserState, opts ...ResourceOption) (*MongoUser, error)
public static MongoUser Get(string name, Input<string> id, MongoUserState? state, CustomResourceOptions? opts = null)
public static MongoUser get(String name, Output<String> id, MongoUserState state, CustomResourceOptions options)
resources: _: type: ionoscloud:dbaas:MongoUser get: id: ${id}
- 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.
- Cluster
Id string - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- Password string
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- Roles
List<Ionoscloud.
Mongo User Role> - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- Username string
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- Cluster
Id string - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- Password string
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- Roles
[]Mongo
User Role Args - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- Username string
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- cluster
Id String - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- password String
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- roles
List<Mongo
User Role> - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- username String
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- cluster
Id string - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- password string
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- roles
Mongo
User Role[] - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- username string
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- cluster_
id str - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- password str
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- roles
Sequence[Mongo
User Role Args] - [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- username str
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
- cluster
Id String - [string] The unique ID of the cluster. Updates to the value of the field force the cluster to be re-created.
- password String
- [string] User password. Updates to the value of the field force the cluster to be re-created.
- roles List<Property Map>
- [string] a list of mongodb user roles. Updates to the value of the field force the cluster to be re-created.
- username String
- [string] Used for authentication. Updates to the value of the field force the cluster to be re-created.
Supporting Types
MongoUserRole, MongoUserRoleArgs
- Database string
[true] Database on which to apply the role.
NOTE: MongoDb users do not support update at the moment. Changing any attribute will result in the user being re-created.
- Role string
- [true] Mongodb user role. Examples: read, readWrite, readAnyDatabase, readWriteAnyDatabase, dbAdmin, dbAdminAnyDatabase, clusterMonitor.
- Database string
[true] Database on which to apply the role.
NOTE: MongoDb users do not support update at the moment. Changing any attribute will result in the user being re-created.
- Role string
- [true] Mongodb user role. Examples: read, readWrite, readAnyDatabase, readWriteAnyDatabase, dbAdmin, dbAdminAnyDatabase, clusterMonitor.
- database String
[true] Database on which to apply the role.
NOTE: MongoDb users do not support update at the moment. Changing any attribute will result in the user being re-created.
- role String
- [true] Mongodb user role. Examples: read, readWrite, readAnyDatabase, readWriteAnyDatabase, dbAdmin, dbAdminAnyDatabase, clusterMonitor.
- database string
[true] Database on which to apply the role.
NOTE: MongoDb users do not support update at the moment. Changing any attribute will result in the user being re-created.
- role string
- [true] Mongodb user role. Examples: read, readWrite, readAnyDatabase, readWriteAnyDatabase, dbAdmin, dbAdminAnyDatabase, clusterMonitor.
- database str
[true] Database on which to apply the role.
NOTE: MongoDb users do not support update at the moment. Changing any attribute will result in the user being re-created.
- role str
- [true] Mongodb user role. Examples: read, readWrite, readAnyDatabase, readWriteAnyDatabase, dbAdmin, dbAdminAnyDatabase, clusterMonitor.
- database String
[true] Database on which to apply the role.
NOTE: MongoDb users do not support update at the moment. Changing any attribute will result in the user being re-created.
- role String
- [true] Mongodb user role. Examples: read, readWrite, readAnyDatabase, readWriteAnyDatabase, dbAdmin, dbAdminAnyDatabase, clusterMonitor.
Import
Resource DBaaS MongoDB User can be imported using the clusterID
and the username
.
First, define an empty resource in the plan:
hcl
resource “ionoscloud_mongo_user” “importeduser” {
}
Then you can import the user using the following command:
$ pulumi import ionoscloud:dbaas/mongoUser:MongoUser mycluser clusterid/username
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ionoscloud ionos-cloud/pulumi-ionoscloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.