Instance class
Provides an RDS instance resource. A DB instance is an isolated database environment in the cloud. A DB instance can contain multiple user-created databases.
Changes to a DB instance can occur when you manually change a parameter, such as
allocatedStorage, and are reflected in the next maintenance window. Because
of this, this provider may report a difference in its planning phase because a
modification has not yet taken place. You can use the applyImmediately flag
to instruct the service to apply the change immediately (see documentation
below).
When upgrading the major version of an engine, allowMajorVersionUpgrade must be set to true.
> Note: using applyImmediately can result in a brief downtime as the server reboots.
See the AWS Docs on instance-maintenance for more information.
> Note: All arguments including the username and password will be stored in the raw state as plain-text. Read more about sensitive data instate.
Amazon RDS supports instance classes for General-purpose, Memory-optimized, Burstable Performance, and Optimized-reads use cases. For more information see DB Instance Class Types.
By default, RDS applies updates to DB Instances in-place, which can lead to service interruptions. Low-downtime updates minimize service interruptions by performing the updates with an blue-green and switching over the instances when complete. Low-downtime updates are only available for MySQL, MariaDB, and PostgreSQL — other engines are not supported by RDS Blue/Green deployments — and cannot be used with DB Instances with replicas. Backups must be enabled. Enable low-downtime updates by setting blue_green_update.enabled to true.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const _default = new aws.rds.Instance("default", {
allocatedStorage: 10,
dbName: "mydb",
engine: "mysql",
engineVersion: "8.0",
instanceClass: aws.rds.InstanceType.T3_Micro,
username: "foo",
password: "foobarbaz",
parameterGroupName: "default.mysql8.0",
skipFinalSnapshot: true,
});
import pulumi
import pulumi_aws as aws
default = aws.rds.Instance("default",
allocated_storage=10,
db_name="mydb",
engine="mysql",
engine_version="8.0",
instance_class=aws.rds.InstanceType.T3_MICRO,
username="foo",
password="foobarbaz",
parameter_group_name="default.mysql8.0",
skip_final_snapshot=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var @default = new Aws.Rds.Instance("default", new()
{
AllocatedStorage = 10,
DbName = "mydb",
Engine = "mysql",
EngineVersion = "8.0",
InstanceClass = Aws.Rds.InstanceType.T3_Micro,
Username = "foo",
Password = "foobarbaz",
ParameterGroupName = "default.mysql8.0",
SkipFinalSnapshot = true,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := rds.NewInstance(ctx, "default", &rds.InstanceArgs{
AllocatedStorage: pulumi.Int(10),
DbName: pulumi.String("mydb"),
Engine: pulumi.String("mysql"),
EngineVersion: pulumi.String("8.0"),
InstanceClass: pulumi.String(rds.InstanceType_T3_Micro),
Username: pulumi.String("foo"),
Password: pulumi.String("foobarbaz"),
ParameterGroupName: pulumi.String("default.mysql8.0"),
SkipFinalSnapshot: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_rds_instance" "default" {
allocated_storage = 10
db_name = "mydb"
engine = "mysql"
engine_version = "8.0"
instance_class = "db.t3.micro"
username = "foo"
password = "foobarbaz"
parameter_group_name = "default.mysql8.0"
skip_final_snapshot = true
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 default_ = new Instance("default", InstanceArgs.builder()
.allocatedStorage(10)
.dbName("mydb")
.engine("mysql")
.engineVersion("8.0")
.instanceClass("db.t3.micro")
.username("foo")
.password("foobarbaz")
.parameterGroupName("default.mysql8.0")
.skipFinalSnapshot(true)
.build());
}
}
resources:
default:
type: aws:rds:Instance
properties:
allocatedStorage: 10
dbName: mydb
engine: mysql
engineVersion: '8.0'
instanceClass: db.t3.micro
username: foo
password: foobarbaz
parameterGroupName: default.mysql8.0
skipFinalSnapshot: true
RDS Custom for Oracle Usage with Replica
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// Lookup the available instance classes for the custom engine for the region being operated in
const custom_oracle = aws.rds.getOrderableDbInstance({
engine: "custom-oracle-ee",
engineVersion: "19.c.ee.002",
licenseModel: "bring-your-own-license",
storageType: "gp3",
preferredInstanceClasses: [
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge",
],
});
// The RDS instance resource requires an ARN. Look up the ARN of the KMS key associated with the CEV.
const byId = aws.kms.getKey({
keyId: "example-ef278353ceba4a5a97de6784565b9f78",
});
const _default = new aws.rds.Instance("default", {
allocatedStorage: 50,
autoMinorVersionUpgrade: false,
customIamInstanceProfile: "AWSRDSCustomInstanceProfile",
backupRetentionPeriod: 7,
dbSubnetGroupName: dbSubnetGroupName,
engine: custom_oracle.then(custom_oracle => custom_oracle.engine),
engineVersion: custom_oracle.then(custom_oracle => custom_oracle.engineVersion),
identifier: "ee-instance-demo",
instanceClass: aws.rds.InstanceType[custom_oracle.then(custom_oracle => custom_oracle.instanceClass)],
kmsKeyId: byId.then(byId => byId.arn),
licenseModel: custom_oracle.then(custom_oracle => custom_oracle.licenseModel),
multiAz: false,
password: "avoid-plaintext-passwords",
username: "test",
storageEncrypted: true,
}, {
customTimeouts: {
create: "3h",
"delete": "3h",
update: "3h",
},
});
const test_replica = new aws.rds.Instance("test-replica", {
replicateSourceDb: _default.identifier,
replicaMode: "mounted",
autoMinorVersionUpgrade: false,
customIamInstanceProfile: "AWSRDSCustomInstanceProfile",
backupRetentionPeriod: 7,
identifier: "ee-instance-replica",
instanceClass: aws.rds.InstanceType[custom_oracle.then(custom_oracle => custom_oracle.instanceClass)],
kmsKeyId: byId.then(byId => byId.arn),
multiAz: false,
skipFinalSnapshot: true,
storageEncrypted: true,
}, {
customTimeouts: {
create: "3h",
"delete": "3h",
update: "3h",
},
});
import pulumi
import pulumi_aws as aws
# Lookup the available instance classes for the custom engine for the region being operated in
custom_oracle = aws.rds.get_orderable_db_instance(engine="custom-oracle-ee",
engine_version="19.c.ee.002",
license_model="bring-your-own-license",
storage_type="gp3",
preferred_instance_classes=[
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge",
])
# The RDS instance resource requires an ARN. Look up the ARN of the KMS key associated with the CEV.
by_id = aws.kms.get_key(key_id="example-ef278353ceba4a5a97de6784565b9f78")
default = aws.rds.Instance("default",
allocated_storage=50,
auto_minor_version_upgrade=False,
custom_iam_instance_profile="AWSRDSCustomInstanceProfile",
backup_retention_period=7,
db_subnet_group_name=db_subnet_group_name,
engine=custom_oracle.engine,
engine_version=custom_oracle.engine_version,
identifier="ee-instance-demo",
instance_class=aws.rds.InstanceType(custom_oracle.instance_class),
kms_key_id=by_id.arn,
license_model=custom_oracle.license_model,
multi_az=False,
password="avoid-plaintext-passwords",
username="test",
storage_encrypted=True,
opts = pulumi.ResourceOptions(custom_timeouts=pulumi.CustomTimeouts(create="3h", delete="3h", update="3h")))
test_replica = aws.rds.Instance("test-replica",
replicate_source_db=default.identifier,
replica_mode="mounted",
auto_minor_version_upgrade=False,
custom_iam_instance_profile="AWSRDSCustomInstanceProfile",
backup_retention_period=7,
identifier="ee-instance-replica",
instance_class=aws.rds.InstanceType(custom_oracle.instance_class),
kms_key_id=by_id.arn,
multi_az=False,
skip_final_snapshot=True,
storage_encrypted=True,
opts = pulumi.ResourceOptions(custom_timeouts=pulumi.CustomTimeouts(create="3h", delete="3h", update="3h")))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
// Lookup the available instance classes for the custom engine for the region being operated in
var custom_oracle = Aws.Rds.GetOrderableDbInstance.Invoke(new()
{
Engine = "custom-oracle-ee",
EngineVersion = "19.c.ee.002",
LicenseModel = "bring-your-own-license",
StorageType = "gp3",
PreferredInstanceClasses = new[]
{
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge",
},
});
// The RDS instance resource requires an ARN. Look up the ARN of the KMS key associated with the CEV.
var byId = Aws.Kms.GetKey.Invoke(new()
{
KeyId = "example-ef278353ceba4a5a97de6784565b9f78",
});
var @default = new Aws.Rds.Instance("default", new()
{
AllocatedStorage = 50,
AutoMinorVersionUpgrade = false,
CustomIamInstanceProfile = "AWSRDSCustomInstanceProfile",
BackupRetentionPeriod = 7,
DbSubnetGroupName = dbSubnetGroupName,
Engine = custom_oracle.Apply(custom_oracle => custom_oracle.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.Engine)),
EngineVersion = custom_oracle.Apply(custom_oracle => custom_oracle.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.EngineVersion)),
Identifier = "ee-instance-demo",
InstanceClass = custom_oracle.Apply(custom_oracle => custom_oracle.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.InstanceClass)).Apply(System.Enum.Parse<Aws.Rds.InstanceType>),
KmsKeyId = byId.Apply(getKeyResult => getKeyResult.Arn),
LicenseModel = custom_oracle.Apply(custom_oracle => custom_oracle.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.LicenseModel)),
MultiAz = false,
Password = "avoid-plaintext-passwords",
Username = "test",
StorageEncrypted = true,
});
var test_replica = new Aws.Rds.Instance("test-replica", new()
{
ReplicateSourceDb = @default.Identifier,
ReplicaMode = "mounted",
AutoMinorVersionUpgrade = false,
CustomIamInstanceProfile = "AWSRDSCustomInstanceProfile",
BackupRetentionPeriod = 7,
Identifier = "ee-instance-replica",
InstanceClass = custom_oracle.Apply(custom_oracle => custom_oracle.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.InstanceClass)).Apply(System.Enum.Parse<Aws.Rds.InstanceType>),
KmsKeyId = byId.Apply(getKeyResult => getKeyResult.Arn),
MultiAz = false,
SkipFinalSnapshot = true,
StorageEncrypted = true,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kms"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Lookup the available instance classes for the custom engine for the region being operated in
custom_oracle, err := rds.GetOrderableDbInstance(ctx, &rds.GetOrderableDbInstanceArgs{
Engine: "custom-oracle-ee",
EngineVersion: pulumi.StringRef("19.c.ee.002"),
LicenseModel: pulumi.StringRef("bring-your-own-license"),
StorageType: pulumi.StringRef("gp3"),
PreferredInstanceClasses: []string{
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge",
},
}, nil)
if err != nil {
return err
}
// The RDS instance resource requires an ARN. Look up the ARN of the KMS key associated with the CEV.
byId, err := kms.LookupKey(ctx, &kms.LookupKeyArgs{
KeyId: "example-ef278353ceba4a5a97de6784565b9f78",
}, nil)
if err != nil {
return err
}
_default, err := rds.NewInstance(ctx, "default", &rds.InstanceArgs{
AllocatedStorage: pulumi.Int(50),
AutoMinorVersionUpgrade: pulumi.Bool(false),
CustomIamInstanceProfile: pulumi.String("AWSRDSCustomInstanceProfile"),
BackupRetentionPeriod: pulumi.Int(7),
DbSubnetGroupName: pulumi.Any(dbSubnetGroupName),
Engine: pulumi.String(custom_oracle.Engine),
EngineVersion: pulumi.String(custom_oracle.EngineVersion),
Identifier: pulumi.String("ee-instance-demo"),
InstanceClass: custom_oracle.InstanceClass.ApplyT(func(x *string) rds.InstanceType { return rds.InstanceType(*x) }).(rds.InstanceTypeOutput),
KmsKeyId: pulumi.String(byId.Arn),
LicenseModel: pulumi.String(custom_oracle.LicenseModel),
MultiAz: pulumi.Bool(false),
Password: pulumi.String("avoid-plaintext-passwords"),
Username: pulumi.String("test"),
StorageEncrypted: pulumi.Bool(true),
}, pulumi.Timeouts(&pulumi.CustomTimeouts{Create: "3h", Delete: "3h", Update: "3h"}))
if err != nil {
return err
}
_, err = rds.NewInstance(ctx, "test-replica", &rds.InstanceArgs{
ReplicateSourceDb: _default.Identifier,
ReplicaMode: pulumi.String("mounted"),
AutoMinorVersionUpgrade: pulumi.Bool(false),
CustomIamInstanceProfile: pulumi.String("AWSRDSCustomInstanceProfile"),
BackupRetentionPeriod: pulumi.Int(7),
Identifier: pulumi.String("ee-instance-replica"),
InstanceClass: custom_oracle.InstanceClass.ApplyT(func(x *string) rds.InstanceType { return rds.InstanceType(*x) }).(rds.InstanceTypeOutput),
KmsKeyId: pulumi.String(byId.Arn),
MultiAz: pulumi.Bool(false),
SkipFinalSnapshot: pulumi.Bool(true),
StorageEncrypted: pulumi.Bool(true),
}, pulumi.Timeouts(&pulumi.CustomTimeouts{Create: "3h", Delete: "3h", Update: "3h"}))
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_rds_getorderabledbinstance" "custom-oracle" {
engine = "custom-oracle-ee"
engine_version = "19.c.ee.002"
license_model = "bring-your-own-license"
storage_type = "gp3"
preferred_instance_classes = ["db.r5.xlarge", "db.r5.2xlarge", "db.r5.4xlarge"]
}
data "aws_kms_getkey" "byId" {
key_id = "example-ef278353ceba4a5a97de6784565b9f78"
}
resource "aws_rds_instance" "default" {
timeouts {
create = "3h"
delete = "3h"
update = "3h"
}
allocated_storage = 50
auto_minor_version_upgrade = false # Custom for Oracle does not support minor version upgrades
custom_iam_instance_profile = "AWSRDSCustomInstanceProfile"
backup_retention_period = 7
db_subnet_group_name = dbSubnetGroupName
engine = data.aws_rds_getorderabledbinstance.custom-oracle.engine
engine_version = data.aws_rds_getorderabledbinstance.custom-oracle.engine_version
identifier = "ee-instance-demo"
instance_class = data.aws_rds_getorderabledbinstance.custom-oracle.instance_class
kms_key_id = data.aws_kms_getkey.byId.arn
license_model = data.aws_rds_getorderabledbinstance.custom-oracle.license_model
multi_az = false # Custom for Oracle does not support multi-az
password = "avoid-plaintext-passwords"
username = "test"
storage_encrypted = true
}
resource "aws_rds_instance" "test-replica" {
timeouts {
create = "3h"
delete = "3h"
update = "3h"
}
replicate_source_db = aws_rds_instance.default.identifier
replica_mode = "mounted"
auto_minor_version_upgrade = false
custom_iam_instance_profile = "AWSRDSCustomInstanceProfile"
backup_retention_period = 7
identifier = "ee-instance-replica"
instance_class = data.aws_rds_getorderabledbinstance.custom-oracle.instance_class
kms_key_id = data.aws_kms_getkey.byId.arn
multi_az = false # Custom for Oracle does not support multi-az
skip_final_snapshot = true
storage_encrypted = true
}
# Lookup the available instance classes for the custom engine for the region being operated in
# CEV engine to be used
# CEV engine version to be used
# The RDS instance resource requires an ARN. Look up the ARN of the KMS key associated with the CEV.
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.RdsFunctions;
import com.pulumi.aws.rds.inputs.GetOrderableDbInstanceArgs;
import com.pulumi.aws.kms.KmsFunctions;
import com.pulumi.aws.kms.inputs.GetKeyArgs;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import com.pulumi.resources.CustomResourceOptions;
import com.pulumi.resources.CustomTimeouts;
import java.util.ArrayList;
import java.util.Arrays;
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) {
// Lookup the available instance classes for the custom engine for the region being operated in
final var custom-oracle = RdsFunctions.getOrderableDbInstance(GetOrderableDbInstanceArgs.builder()
.engine("custom-oracle-ee")
.engineVersion("19.c.ee.002")
.licenseModel("bring-your-own-license")
.storageType("gp3")
.preferredInstanceClasses(
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge")
.build());
// The RDS instance resource requires an ARN. Look up the ARN of the KMS key associated with the CEV.
final var byId = KmsFunctions.getKey(GetKeyArgs.builder()
.keyId("example-ef278353ceba4a5a97de6784565b9f78")
.build());
var default_ = new Instance("default", InstanceArgs.builder()
.allocatedStorage(50)
.autoMinorVersionUpgrade(false)
.customIamInstanceProfile("AWSRDSCustomInstanceProfile")
.backupRetentionPeriod(7)
.dbSubnetGroupName(dbSubnetGroupName)
.engine(custom_oracle.engine())
.engineVersion(custom_oracle.engineVersion())
.identifier("ee-instance-demo")
.instanceClass(custom_oracle.instanceClass())
.kmsKeyId(byId.arn())
.licenseModel(custom_oracle.licenseModel())
.multiAz(false)
.password("avoid-plaintext-passwords")
.username("test")
.storageEncrypted(true)
.build(), CustomResourceOptions.builder()
.customTimeouts(CustomTimeouts.builder()
.create(CustomTimeouts.parseTimeoutString("3h"))
.delete(CustomTimeouts.parseTimeoutString("3h"))
.update(CustomTimeouts.parseTimeoutString("3h"))
.build())
.build());
var test_replica = new Instance("test-replica", InstanceArgs.builder()
.replicateSourceDb(default_.identifier())
.replicaMode("mounted")
.autoMinorVersionUpgrade(false)
.customIamInstanceProfile("AWSRDSCustomInstanceProfile")
.backupRetentionPeriod(7)
.identifier("ee-instance-replica")
.instanceClass(custom_oracle.instanceClass())
.kmsKeyId(byId.arn())
.multiAz(false)
.skipFinalSnapshot(true)
.storageEncrypted(true)
.build(), CustomResourceOptions.builder()
.customTimeouts(CustomTimeouts.builder()
.create(CustomTimeouts.parseTimeoutString("3h"))
.delete(CustomTimeouts.parseTimeoutString("3h"))
.update(CustomTimeouts.parseTimeoutString("3h"))
.build())
.build());
}
}
resources:
default:
type: aws:rds:Instance
properties:
allocatedStorage: 50
autoMinorVersionUpgrade: false # Custom for Oracle does not support minor version upgrades
customIamInstanceProfile: AWSRDSCustomInstanceProfile
backupRetentionPeriod: 7
dbSubnetGroupName: ${dbSubnetGroupName}
engine: ${["custom-oracle"].engine}
engineVersion: ${["custom-oracle"].engineVersion}
identifier: ee-instance-demo
instanceClass: ${["custom-oracle"].instanceClass}
kmsKeyId: ${byId.arn}
licenseModel: ${["custom-oracle"].licenseModel}
multiAz: false # Custom for Oracle does not support multi-az
password: avoid-plaintext-passwords
username: test
storageEncrypted: true
options:
customTimeouts:
create: 3h
delete: 3h
update: 3h
test-replica:
type: aws:rds:Instance
properties:
replicateSourceDb: ${default.identifier}
replicaMode: mounted
autoMinorVersionUpgrade: false
customIamInstanceProfile: AWSRDSCustomInstanceProfile
backupRetentionPeriod: 7
identifier: ee-instance-replica
instanceClass: ${["custom-oracle"].instanceClass}
kmsKeyId: ${byId.arn}
multiAz: false # Custom for Oracle does not support multi-az
skipFinalSnapshot: true
storageEncrypted: true
options:
customTimeouts:
create: 3h
delete: 3h
update: 3h
variables:
# Lookup the available instance classes for the custom engine for the region being operated in
custom-oracle:
fn::invoke:
function: aws:rds:getOrderableDbInstance
arguments:
engine: custom-oracle-ee
engineVersion: 19.c.ee.002
licenseModel: bring-your-own-license
storageType: gp3
preferredInstanceClasses:
- db.r5.xlarge
- db.r5.2xlarge
- db.r5.4xlarge
# The RDS instance resource requires an ARN. Look up the ARN of the KMS key associated with the CEV.
byId:
fn::invoke:
function: aws:kms:getKey
arguments:
keyId: example-ef278353ceba4a5a97de6784565b9f78
RDS Custom for SQL Server
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// Lookup the available instance classes for the custom engine for the region being operated in
const custom_sqlserver = aws.rds.getOrderableDbInstance({
engine: "custom-sqlserver-se",
engineVersion: "15.00.4249.2.v1",
storageType: "gp3",
preferredInstanceClasses: [
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge",
],
});
// The RDS instance resource requires an ARN. Look up the ARN of the KMS key.
const byId = aws.kms.getKey({
keyId: "example-ef278353ceba4a5a97de6784565b9f78",
});
const example = new aws.rds.Instance("example", {
allocatedStorage: 500,
autoMinorVersionUpgrade: false,
customIamInstanceProfile: "AWSRDSCustomSQLServerInstanceProfile",
backupRetentionPeriod: 7,
dbSubnetGroupName: dbSubnetGroupName,
engine: custom_sqlserver.then(custom_sqlserver => custom_sqlserver.engine),
engineVersion: custom_sqlserver.then(custom_sqlserver => custom_sqlserver.engineVersion),
identifier: "sql-instance-demo",
instanceClass: aws.rds.InstanceType[custom_sqlserver.then(custom_sqlserver => custom_sqlserver.instanceClass)],
kmsKeyId: byId.then(byId => byId.arn),
multiAz: false,
password: "avoid-plaintext-passwords",
storageEncrypted: true,
username: "test",
}, {
customTimeouts: {
create: "3h",
"delete": "3h",
update: "3h",
},
});
import pulumi
import pulumi_aws as aws
# Lookup the available instance classes for the custom engine for the region being operated in
custom_sqlserver = aws.rds.get_orderable_db_instance(engine="custom-sqlserver-se",
engine_version="15.00.4249.2.v1",
storage_type="gp3",
preferred_instance_classes=[
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge",
])
# The RDS instance resource requires an ARN. Look up the ARN of the KMS key.
by_id = aws.kms.get_key(key_id="example-ef278353ceba4a5a97de6784565b9f78")
example = aws.rds.Instance("example",
allocated_storage=500,
auto_minor_version_upgrade=False,
custom_iam_instance_profile="AWSRDSCustomSQLServerInstanceProfile",
backup_retention_period=7,
db_subnet_group_name=db_subnet_group_name,
engine=custom_sqlserver.engine,
engine_version=custom_sqlserver.engine_version,
identifier="sql-instance-demo",
instance_class=aws.rds.InstanceType(custom_sqlserver.instance_class),
kms_key_id=by_id.arn,
multi_az=False,
password="avoid-plaintext-passwords",
storage_encrypted=True,
username="test",
opts = pulumi.ResourceOptions(custom_timeouts=pulumi.CustomTimeouts(create="3h", delete="3h", update="3h")))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
// Lookup the available instance classes for the custom engine for the region being operated in
var custom_sqlserver = Aws.Rds.GetOrderableDbInstance.Invoke(new()
{
Engine = "custom-sqlserver-se",
EngineVersion = "15.00.4249.2.v1",
StorageType = "gp3",
PreferredInstanceClasses = new[]
{
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge",
},
});
// The RDS instance resource requires an ARN. Look up the ARN of the KMS key.
var byId = Aws.Kms.GetKey.Invoke(new()
{
KeyId = "example-ef278353ceba4a5a97de6784565b9f78",
});
var example = new Aws.Rds.Instance("example", new()
{
AllocatedStorage = 500,
AutoMinorVersionUpgrade = false,
CustomIamInstanceProfile = "AWSRDSCustomSQLServerInstanceProfile",
BackupRetentionPeriod = 7,
DbSubnetGroupName = dbSubnetGroupName,
Engine = custom_sqlserver.Apply(custom_sqlserver => custom_sqlserver.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.Engine)),
EngineVersion = custom_sqlserver.Apply(custom_sqlserver => custom_sqlserver.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.EngineVersion)),
Identifier = "sql-instance-demo",
InstanceClass = custom_sqlserver.Apply(custom_sqlserver => custom_sqlserver.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.InstanceClass)).Apply(System.Enum.Parse<Aws.Rds.InstanceType>),
KmsKeyId = byId.Apply(getKeyResult => getKeyResult.Arn),
MultiAz = false,
Password = "avoid-plaintext-passwords",
StorageEncrypted = true,
Username = "test",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kms"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Lookup the available instance classes for the custom engine for the region being operated in
custom_sqlserver, err := rds.GetOrderableDbInstance(ctx, &rds.GetOrderableDbInstanceArgs{
Engine: "custom-sqlserver-se",
EngineVersion: pulumi.StringRef("15.00.4249.2.v1"),
StorageType: pulumi.StringRef("gp3"),
PreferredInstanceClasses: []string{
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge",
},
}, nil)
if err != nil {
return err
}
// The RDS instance resource requires an ARN. Look up the ARN of the KMS key.
byId, err := kms.LookupKey(ctx, &kms.LookupKeyArgs{
KeyId: "example-ef278353ceba4a5a97de6784565b9f78",
}, nil)
if err != nil {
return err
}
_, err = rds.NewInstance(ctx, "example", &rds.InstanceArgs{
AllocatedStorage: pulumi.Int(500),
AutoMinorVersionUpgrade: pulumi.Bool(false),
CustomIamInstanceProfile: pulumi.String("AWSRDSCustomSQLServerInstanceProfile"),
BackupRetentionPeriod: pulumi.Int(7),
DbSubnetGroupName: pulumi.Any(dbSubnetGroupName),
Engine: pulumi.String(custom_sqlserver.Engine),
EngineVersion: pulumi.String(custom_sqlserver.EngineVersion),
Identifier: pulumi.String("sql-instance-demo"),
InstanceClass: custom_sqlserver.InstanceClass.ApplyT(func(x *string) rds.InstanceType { return rds.InstanceType(*x) }).(rds.InstanceTypeOutput),
KmsKeyId: pulumi.String(byId.Arn),
MultiAz: pulumi.Bool(false),
Password: pulumi.String("avoid-plaintext-passwords"),
StorageEncrypted: pulumi.Bool(true),
Username: pulumi.String("test"),
}, pulumi.Timeouts(&pulumi.CustomTimeouts{Create: "3h", Delete: "3h", Update: "3h"}))
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_rds_getorderabledbinstance" "custom-sqlserver" {
engine = "custom-sqlserver-se"
engine_version = "15.00.4249.2.v1"
storage_type = "gp3"
preferred_instance_classes = ["db.r5.xlarge", "db.r5.2xlarge", "db.r5.4xlarge"]
}
data "aws_kms_getkey" "byId" {
key_id = "example-ef278353ceba4a5a97de6784565b9f78"
}
resource "aws_rds_instance" "example" {
timeouts {
create = "3h"
delete = "3h"
update = "3h"
}
allocated_storage = 500
auto_minor_version_upgrade = false # Custom for SQL Server does not support minor version upgrades
custom_iam_instance_profile = "AWSRDSCustomSQLServerInstanceProfile"
backup_retention_period = 7
db_subnet_group_name = dbSubnetGroupName
engine = data.aws_rds_getorderabledbinstance.custom-sqlserver.engine
engine_version = data.aws_rds_getorderabledbinstance.custom-sqlserver.engine_version
identifier = "sql-instance-demo"
instance_class = data.aws_rds_getorderabledbinstance.custom-sqlserver.instance_class
kms_key_id = data.aws_kms_getkey.byId.arn
multi_az = false # Custom for SQL Server does support multi-az
password = "avoid-plaintext-passwords"
storage_encrypted = true
username = "test"
}
# Lookup the available instance classes for the custom engine for the region being operated in
# CEV engine to be used
# CEV engine version to be used
# The RDS instance resource requires an ARN. Look up the ARN of the KMS key.
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.RdsFunctions;
import com.pulumi.aws.rds.inputs.GetOrderableDbInstanceArgs;
import com.pulumi.aws.kms.KmsFunctions;
import com.pulumi.aws.kms.inputs.GetKeyArgs;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import com.pulumi.resources.CustomResourceOptions;
import com.pulumi.resources.CustomTimeouts;
import java.util.ArrayList;
import java.util.Arrays;
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) {
// Lookup the available instance classes for the custom engine for the region being operated in
final var custom-sqlserver = RdsFunctions.getOrderableDbInstance(GetOrderableDbInstanceArgs.builder()
.engine("custom-sqlserver-se")
.engineVersion("15.00.4249.2.v1")
.storageType("gp3")
.preferredInstanceClasses(
"db.r5.xlarge",
"db.r5.2xlarge",
"db.r5.4xlarge")
.build());
// The RDS instance resource requires an ARN. Look up the ARN of the KMS key.
final var byId = KmsFunctions.getKey(GetKeyArgs.builder()
.keyId("example-ef278353ceba4a5a97de6784565b9f78")
.build());
var example = new Instance("example", InstanceArgs.builder()
.allocatedStorage(500)
.autoMinorVersionUpgrade(false)
.customIamInstanceProfile("AWSRDSCustomSQLServerInstanceProfile")
.backupRetentionPeriod(7)
.dbSubnetGroupName(dbSubnetGroupName)
.engine(custom_sqlserver.engine())
.engineVersion(custom_sqlserver.engineVersion())
.identifier("sql-instance-demo")
.instanceClass(custom_sqlserver.instanceClass())
.kmsKeyId(byId.arn())
.multiAz(false)
.password("avoid-plaintext-passwords")
.storageEncrypted(true)
.username("test")
.build(), CustomResourceOptions.builder()
.customTimeouts(CustomTimeouts.builder()
.create(CustomTimeouts.parseTimeoutString("3h"))
.delete(CustomTimeouts.parseTimeoutString("3h"))
.update(CustomTimeouts.parseTimeoutString("3h"))
.build())
.build());
}
}
resources:
example:
type: aws:rds:Instance
properties:
allocatedStorage: 500
autoMinorVersionUpgrade: false # Custom for SQL Server does not support minor version upgrades
customIamInstanceProfile: AWSRDSCustomSQLServerInstanceProfile
backupRetentionPeriod: 7
dbSubnetGroupName: ${dbSubnetGroupName}
engine: ${["custom-sqlserver"].engine}
engineVersion: ${["custom-sqlserver"].engineVersion}
identifier: sql-instance-demo
instanceClass: ${["custom-sqlserver"].instanceClass}
kmsKeyId: ${byId.arn}
multiAz: false # Custom for SQL Server does support multi-az
password: avoid-plaintext-passwords
storageEncrypted: true
username: test
options:
customTimeouts:
create: 3h
delete: 3h
update: 3h
variables:
# Lookup the available instance classes for the custom engine for the region being operated in
custom-sqlserver:
fn::invoke:
function: aws:rds:getOrderableDbInstance
arguments:
engine: custom-sqlserver-se
engineVersion: 15.00.4249.2.v1
storageType: gp3
preferredInstanceClasses:
- db.r5.xlarge
- db.r5.2xlarge
- db.r5.4xlarge
# The RDS instance resource requires an ARN. Look up the ARN of the KMS key.
byId:
fn::invoke:
function: aws:kms:getKey
arguments:
keyId: example-ef278353ceba4a5a97de6784565b9f78
RDS Db2 Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// Lookup the default version for the engine. Db2 Standard Edition is `db2-se`, Db2 Advanced Edition is `db2-ae`.
const _default = aws.rds.getEngineVersion({
engine: "db2-se",
});
// Lookup the available instance classes for the engine in the region being operated in
const example = _default.then(_default => aws.rds.getOrderableDbInstance({
engine: _default.engine,
engineVersion: _default.version,
licenseModel: "bring-your-own-license",
storageType: "gp3",
preferredInstanceClasses: [
"db.t3.small",
"db.r6i.large",
"db.m6i.large",
],
}));
// The RDS Db2 instance resource requires licensing information. Create a new parameter group using the default paramater group as a source, and set license information.
const exampleParameterGroup = new aws.rds.ParameterGroup("example", {
parameters: [
{
applyMethod: "immediate",
name: "rds.ibm_customer_id",
value: "0",
},
{
applyMethod: "immediate",
name: "rds.ibm_site_id",
value: "0",
},
],
name: "db-db2-params",
family: _default.then(_default => _default.parameterGroupFamily),
});
// Create the RDS Db2 instance, use the data sources defined to set attributes
const exampleInstance = new aws.rds.Instance("example", {
allocatedStorage: 100,
backupRetentionPeriod: 7,
dbName: "test",
engine: example.then(example => example.engine),
engineVersion: example.then(example => example.engineVersion),
identifier: "db2-instance-demo",
instanceClass: aws.rds.InstanceType[example.then(example => example.instanceClass)],
parameterGroupName: exampleParameterGroup.name,
password: "avoid-plaintext-passwords",
username: "test",
});
import pulumi
import pulumi_aws as aws
# Lookup the default version for the engine. Db2 Standard Edition is `db2-se`, Db2 Advanced Edition is `db2-ae`.
default = aws.rds.get_engine_version(engine="db2-se")
# Lookup the available instance classes for the engine in the region being operated in
example = aws.rds.get_orderable_db_instance(engine=default.engine,
engine_version=default.version,
license_model="bring-your-own-license",
storage_type="gp3",
preferred_instance_classes=[
"db.t3.small",
"db.r6i.large",
"db.m6i.large",
])
# The RDS Db2 instance resource requires licensing information. Create a new parameter group using the default paramater group as a source, and set license information.
example_parameter_group = aws.rds.ParameterGroup("example",
parameters=[
{
"apply_method": "immediate",
"name": "rds.ibm_customer_id",
"value": "0",
},
{
"apply_method": "immediate",
"name": "rds.ibm_site_id",
"value": "0",
},
],
name="db-db2-params",
family=default.parameter_group_family)
# Create the RDS Db2 instance, use the data sources defined to set attributes
example_instance = aws.rds.Instance("example",
allocated_storage=100,
backup_retention_period=7,
db_name="test",
engine=example.engine,
engine_version=example.engine_version,
identifier="db2-instance-demo",
instance_class=aws.rds.InstanceType(example.instance_class),
parameter_group_name=example_parameter_group.name,
password="avoid-plaintext-passwords",
username="test")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
// Lookup the default version for the engine. Db2 Standard Edition is `db2-se`, Db2 Advanced Edition is `db2-ae`.
var @default = Aws.Rds.GetEngineVersion.Invoke(new()
{
Engine = "db2-se",
});
// Lookup the available instance classes for the engine in the region being operated in
var example = Aws.Rds.GetOrderableDbInstance.Invoke(new()
{
Engine = @default.Apply(getEngineVersionResult => getEngineVersionResult.Engine),
EngineVersion = @default.Apply(getEngineVersionResult => getEngineVersionResult.Version),
LicenseModel = "bring-your-own-license",
StorageType = "gp3",
PreferredInstanceClasses = new[]
{
"db.t3.small",
"db.r6i.large",
"db.m6i.large",
},
});
// The RDS Db2 instance resource requires licensing information. Create a new parameter group using the default paramater group as a source, and set license information.
var exampleParameterGroup = new Aws.Rds.ParameterGroup("example", new()
{
Parameters = new[]
{
new Aws.Rds.Inputs.ParameterGroupParameterArgs
{
ApplyMethod = "immediate",
Name = "rds.ibm_customer_id",
Value = "0",
},
new Aws.Rds.Inputs.ParameterGroupParameterArgs
{
ApplyMethod = "immediate",
Name = "rds.ibm_site_id",
Value = "0",
},
},
Name = "db-db2-params",
Family = @default.Apply(@default => @default.Apply(getEngineVersionResult => getEngineVersionResult.ParameterGroupFamily)),
});
// Create the RDS Db2 instance, use the data sources defined to set attributes
var exampleInstance = new Aws.Rds.Instance("example", new()
{
AllocatedStorage = 100,
BackupRetentionPeriod = 7,
DbName = "test",
Engine = example.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.Engine),
EngineVersion = example.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.EngineVersion),
Identifier = "db2-instance-demo",
InstanceClass = example.Apply(getOrderableDbInstanceResult => getOrderableDbInstanceResult.InstanceClass).Apply(System.Enum.Parse<Aws.Rds.InstanceType>),
ParameterGroupName = exampleParameterGroup.Name,
Password = "avoid-plaintext-passwords",
Username = "test",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Lookup the default version for the engine. Db2 Standard Edition is `db2-se`, Db2 Advanced Edition is `db2-ae`.
_default, err := rds.GetEngineVersion(ctx, &rds.GetEngineVersionArgs{
Engine: "db2-se",
}, nil)
if err != nil {
return err
}
// Lookup the available instance classes for the engine in the region being operated in
example, err := rds.GetOrderableDbInstance(ctx, &rds.GetOrderableDbInstanceArgs{
Engine: _default.Engine,
EngineVersion: pulumi.StringRef(_default.Version),
LicenseModel: pulumi.StringRef("bring-your-own-license"),
StorageType: pulumi.StringRef("gp3"),
PreferredInstanceClasses: []string{
"db.t3.small",
"db.r6i.large",
"db.m6i.large",
},
}, nil)
if err != nil {
return err
}
// The RDS Db2 instance resource requires licensing information. Create a new parameter group using the default paramater group as a source, and set license information.
exampleParameterGroup, err := rds.NewParameterGroup(ctx, "example", &rds.ParameterGroupArgs{
Parameters: rds.ParameterGroupParameterArray{
&rds.ParameterGroupParameterArgs{
ApplyMethod: pulumi.String("immediate"),
Name: pulumi.String("rds.ibm_customer_id"),
Value: pulumi.String("0"),
},
&rds.ParameterGroupParameterArgs{
ApplyMethod: pulumi.String("immediate"),
Name: pulumi.String("rds.ibm_site_id"),
Value: pulumi.String("0"),
},
},
Name: pulumi.String("db-db2-params"),
Family: pulumi.String(_default.ParameterGroupFamily),
})
if err != nil {
return err
}
// Create the RDS Db2 instance, use the data sources defined to set attributes
_, err = rds.NewInstance(ctx, "example", &rds.InstanceArgs{
AllocatedStorage: pulumi.Int(100),
BackupRetentionPeriod: pulumi.Int(7),
DbName: pulumi.String("test"),
Engine: pulumi.String(example.Engine),
EngineVersion: pulumi.String(example.EngineVersion),
Identifier: pulumi.String("db2-instance-demo"),
InstanceClass: example.InstanceClass.ApplyT(func(x *string) rds.InstanceType { return rds.InstanceType(*x) }).(rds.InstanceTypeOutput),
ParameterGroupName: exampleParameterGroup.Name,
Password: pulumi.String("avoid-plaintext-passwords"),
Username: pulumi.String("test"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_rds_getengineversion" "default" {
engine = "db2-se"
}
data "aws_rds_getorderabledbinstance" "example" {
engine = data.aws_rds_getengineversion.default.engine
engine_version = data.aws_rds_getengineversion.default.version
license_model = "bring-your-own-license"
storage_type = "gp3"
preferred_instance_classes = ["db.t3.small", "db.r6i.large", "db.m6i.large"]
}
# The RDS Db2 instance resource requires licensing information. Create a new parameter group using the default paramater group as a source, and set license information.
resource "aws_rds_parametergroup" "example" {
parameters {
apply_method = "immediate"
name = "rds.ibm_customer_id"
value = 0
}
parameters {
apply_method = "immediate"
name = "rds.ibm_site_id"
value = 0
}
name = "db-db2-params"
family = data.aws_rds_getengineversion.default.parameter_group_family
}
# Create the RDS Db2 instance, use the data sources defined to set attributes
resource "aws_rds_instance" "example" {
allocated_storage = 100
backup_retention_period = 7
db_name = "test"
engine = data.aws_rds_getorderabledbinstance.example.engine
engine_version = data.aws_rds_getorderabledbinstance.example.engine_version
identifier = "db2-instance-demo"
instance_class = data.aws_rds_getorderabledbinstance.example.instance_class
parameter_group_name = aws_rds_parametergroup.example.name
password = "avoid-plaintext-passwords"
username = "test"
}
# Lookup the default version for the engine. Db2 Standard Edition is `db2-se`, Db2 Advanced Edition is `db2-ae`.
# Lookup the available instance classes for the engine in the region being operated in
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.RdsFunctions;
import com.pulumi.aws.rds.inputs.GetEngineVersionArgs;
import com.pulumi.aws.rds.inputs.GetOrderableDbInstanceArgs;
import com.pulumi.aws.rds.ParameterGroup;
import com.pulumi.aws.rds.ParameterGroupArgs;
import com.pulumi.aws.rds.inputs.ParameterGroupParameterArgs;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
// Lookup the default version for the engine. Db2 Standard Edition is `db2-se`, Db2 Advanced Edition is `db2-ae`.
final var default = RdsFunctions.getEngineVersion(GetEngineVersionArgs.builder()
.engine("db2-se")
.build());
// Lookup the available instance classes for the engine in the region being operated in
final var example = RdsFunctions.getOrderableDbInstance(GetOrderableDbInstanceArgs.builder()
.engine(default_.engine())
.engineVersion(default_.version())
.licenseModel("bring-your-own-license")
.storageType("gp3")
.preferredInstanceClasses(
"db.t3.small",
"db.r6i.large",
"db.m6i.large")
.build());
// The RDS Db2 instance resource requires licensing information. Create a new parameter group using the default paramater group as a source, and set license information.
var exampleParameterGroup = new ParameterGroup("exampleParameterGroup", ParameterGroupArgs.builder()
.parameters(
ParameterGroupParameterArgs.builder()
.applyMethod("immediate")
.name("rds.ibm_customer_id")
.value("0")
.build(),
ParameterGroupParameterArgs.builder()
.applyMethod("immediate")
.name("rds.ibm_site_id")
.value("0")
.build())
.name("db-db2-params")
.family(default_.parameterGroupFamily())
.build());
// Create the RDS Db2 instance, use the data sources defined to set attributes
var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
.allocatedStorage(100)
.backupRetentionPeriod(7)
.dbName("test")
.engine(example.engine())
.engineVersion(example.engineVersion())
.identifier("db2-instance-demo")
.instanceClass(example.instanceClass())
.parameterGroupName(exampleParameterGroup.name())
.password("avoid-plaintext-passwords")
.username("test")
.build());
}
}
resources:
# The RDS Db2 instance resource requires licensing information. Create a new parameter group using the default paramater group as a source, and set license information.
exampleParameterGroup:
type: aws:rds:ParameterGroup
name: example
properties:
parameters:
- applyMethod: immediate
name: rds.ibm_customer_id
value: 0
- applyMethod: immediate
name: rds.ibm_site_id
value: 0
name: db-db2-params
family: ${default.parameterGroupFamily}
# Create the RDS Db2 instance, use the data sources defined to set attributes
exampleInstance:
type: aws:rds:Instance
name: example
properties:
allocatedStorage: 100
backupRetentionPeriod: 7
dbName: test
engine: ${example.engine}
engineVersion: ${example.engineVersion}
identifier: db2-instance-demo
instanceClass: ${example.instanceClass}
parameterGroupName: ${exampleParameterGroup.name}
password: avoid-plaintext-passwords
username: test
variables:
# Lookup the default version for the engine. Db2 Standard Edition is `db2-se`, Db2 Advanced Edition is `db2-ae`.
default:
fn::invoke:
function: aws:rds:getEngineVersion
arguments:
engine: db2-se
# Lookup the available instance classes for the engine in the region being operated in
example:
fn::invoke:
function: aws:rds:getOrderableDbInstance
arguments:
engine: ${default.engine}
engineVersion: ${default.version}
licenseModel: bring-your-own-license
storageType: gp3
preferredInstanceClasses:
- db.t3.small
- db.r6i.large
- db.m6i.large
Storage Autoscaling
To enable Storage Autoscaling with instances that support the feature, define the maxAllocatedStorage argument higher than the allocatedStorage argument. This provider will automatically hide differences with the allocatedStorage argument value if autoscaling occurs.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.rds.Instance("example", {
allocatedStorage: 50,
maxAllocatedStorage: 100,
});
import pulumi
import pulumi_aws as aws
example = aws.rds.Instance("example",
allocated_storage=50,
max_allocated_storage=100)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Rds.Instance("example", new()
{
AllocatedStorage = 50,
MaxAllocatedStorage = 100,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := rds.NewInstance(ctx, "example", &rds.InstanceArgs{
AllocatedStorage: pulumi.Int(50),
MaxAllocatedStorage: pulumi.Int(100),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_rds_instance" "example" {
allocated_storage = 50
max_allocated_storage = 100
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new Instance("example", InstanceArgs.builder()
.allocatedStorage(50)
.maxAllocatedStorage(100)
.build());
}
}
resources:
example:
type: aws:rds:Instance
properties:
allocatedStorage: 50
maxAllocatedStorage: 100
Managed Master Passwords via Secrets Manager, default KMS Key
> More information about RDS/Aurora Aurora integrates with Secrets Manager to manage master user passwords for your DB clusters can be found in the RDS User Guide and Aurora User Guide.
You can specify the manageMasterUserPassword attribute to enable managing the master password with Secrets Manager. You can also update an existing cluster to use Secrets Manager by specify the manageMasterUserPassword attribute and removing the password attribute (removal is required).
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const _default = new aws.rds.Instance("default", {
allocatedStorage: 10,
dbName: "mydb",
engine: "mysql",
engineVersion: "8.0",
instanceClass: aws.rds.InstanceType.T3_Micro,
manageMasterUserPassword: true,
username: "foo",
parameterGroupName: "default.mysql8.0",
});
import pulumi
import pulumi_aws as aws
default = aws.rds.Instance("default",
allocated_storage=10,
db_name="mydb",
engine="mysql",
engine_version="8.0",
instance_class=aws.rds.InstanceType.T3_MICRO,
manage_master_user_password=True,
username="foo",
parameter_group_name="default.mysql8.0")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var @default = new Aws.Rds.Instance("default", new()
{
AllocatedStorage = 10,
DbName = "mydb",
Engine = "mysql",
EngineVersion = "8.0",
InstanceClass = Aws.Rds.InstanceType.T3_Micro,
ManageMasterUserPassword = true,
Username = "foo",
ParameterGroupName = "default.mysql8.0",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := rds.NewInstance(ctx, "default", &rds.InstanceArgs{
AllocatedStorage: pulumi.Int(10),
DbName: pulumi.String("mydb"),
Engine: pulumi.String("mysql"),
EngineVersion: pulumi.String("8.0"),
InstanceClass: pulumi.String(rds.InstanceType_T3_Micro),
ManageMasterUserPassword: pulumi.Bool(true),
Username: pulumi.String("foo"),
ParameterGroupName: pulumi.String("default.mysql8.0"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_rds_instance" "default" {
allocated_storage = 10
db_name = "mydb"
engine = "mysql"
engine_version = "8.0"
instance_class = "db.t3.micro"
manage_master_user_password = true
username = "foo"
parameter_group_name = "default.mysql8.0"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 default_ = new Instance("default", InstanceArgs.builder()
.allocatedStorage(10)
.dbName("mydb")
.engine("mysql")
.engineVersion("8.0")
.instanceClass("db.t3.micro")
.manageMasterUserPassword(true)
.username("foo")
.parameterGroupName("default.mysql8.0")
.build());
}
}
resources:
default:
type: aws:rds:Instance
properties:
allocatedStorage: 10
dbName: mydb
engine: mysql
engineVersion: '8.0'
instanceClass: db.t3.micro
manageMasterUserPassword: true
username: foo
parameterGroupName: default.mysql8.0
Managed Master Passwords via Secrets Manager, specific KMS Key
> More information about RDS/Aurora Aurora integrates with Secrets Manager to manage master user passwords for your DB clusters can be found in the RDS User Guide and Aurora User Guide.
You can specify the masterUserSecretKmsKeyId attribute to specify a specific KMS Key.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kms.Key("example", {description: "Example KMS Key"});
const _default = new aws.rds.Instance("default", {
allocatedStorage: 10,
dbName: "mydb",
engine: "mysql",
engineVersion: "8.0",
instanceClass: aws.rds.InstanceType.T3_Micro,
manageMasterUserPassword: true,
masterUserSecretKmsKeyId: example.keyId,
username: "foo",
parameterGroupName: "default.mysql8.0",
});
import pulumi
import pulumi_aws as aws
example = aws.kms.Key("example", description="Example KMS Key")
default = aws.rds.Instance("default",
allocated_storage=10,
db_name="mydb",
engine="mysql",
engine_version="8.0",
instance_class=aws.rds.InstanceType.T3_MICRO,
manage_master_user_password=True,
master_user_secret_kms_key_id=example.key_id,
username="foo",
parameter_group_name="default.mysql8.0")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Kms.Key("example", new()
{
Description = "Example KMS Key",
});
var @default = new Aws.Rds.Instance("default", new()
{
AllocatedStorage = 10,
DbName = "mydb",
Engine = "mysql",
EngineVersion = "8.0",
InstanceClass = Aws.Rds.InstanceType.T3_Micro,
ManageMasterUserPassword = true,
MasterUserSecretKmsKeyId = example.KeyId,
Username = "foo",
ParameterGroupName = "default.mysql8.0",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kms"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := kms.NewKey(ctx, "example", &kms.KeyArgs{
Description: pulumi.String("Example KMS Key"),
})
if err != nil {
return err
}
_, err = rds.NewInstance(ctx, "default", &rds.InstanceArgs{
AllocatedStorage: pulumi.Int(10),
DbName: pulumi.String("mydb"),
Engine: pulumi.String("mysql"),
EngineVersion: pulumi.String("8.0"),
InstanceClass: pulumi.String(rds.InstanceType_T3_Micro),
ManageMasterUserPassword: pulumi.Bool(true),
MasterUserSecretKmsKeyId: example.KeyId,
Username: pulumi.String("foo"),
ParameterGroupName: pulumi.String("default.mysql8.0"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_kms_key" "example" {
description = "Example KMS Key"
}
resource "aws_rds_instance" "default" {
allocated_storage = 10
db_name = "mydb"
engine = "mysql"
engine_version = "8.0"
instance_class = "db.t3.micro"
manage_master_user_password = true
master_user_secret_kms_key_id = aws_kms_key.example.key_id
username = "foo"
parameter_group_name = "default.mysql8.0"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kms.Key;
import com.pulumi.aws.kms.KeyArgs;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new Key("example", KeyArgs.builder()
.description("Example KMS Key")
.build());
var default_ = new Instance("default", InstanceArgs.builder()
.allocatedStorage(10)
.dbName("mydb")
.engine("mysql")
.engineVersion("8.0")
.instanceClass("db.t3.micro")
.manageMasterUserPassword(true)
.masterUserSecretKmsKeyId(example.keyId())
.username("foo")
.parameterGroupName("default.mysql8.0")
.build());
}
}
resources:
example:
type: aws:kms:Key
properties:
description: Example KMS Key
default:
type: aws:rds:Instance
properties:
allocatedStorage: 10
dbName: mydb
engine: mysql
engineVersion: '8.0'
instanceClass: db.t3.micro
manageMasterUserPassword: true
masterUserSecretKmsKeyId: ${example.keyId}
username: foo
parameterGroupName: default.mysql8.0
Disabling Master Password Rotation
When manageMasterUserPassword is enabled, Secrets Manager rotates the master user password automatically (every 7 days by default). To disable that rotation while keeping the managed secret, manage the secret's rotation with aws.secretsmanager.SecretRotation and set rotationEnabled = false.
Referencing aws_db_instance.default.master_user_secret[0].secret_arn (as in the example below) ensures the rotation change is applied after the instance is available. Avoid hardcoding the secret ARN, which would remove that ordering.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const _default = new aws.rds.Instance("default", {
allocatedStorage: 10,
dbName: "mydb",
engine: "mysql",
engineVersion: "8.0",
instanceClass: aws.rds.InstanceType.T3_Micro,
manageMasterUserPassword: true,
username: "foo",
parameterGroupName: "default.mysql8.0",
});
const defaultSecretRotation = new aws.secretsmanager.SecretRotation("default", {
secretId: _default.masterUserSecrets[0].secretArn,
rotationEnabled: false,
});
import pulumi
import pulumi_aws as aws
default = aws.rds.Instance("default",
allocated_storage=10,
db_name="mydb",
engine="mysql",
engine_version="8.0",
instance_class=aws.rds.InstanceType.T3_MICRO,
manage_master_user_password=True,
username="foo",
parameter_group_name="default.mysql8.0")
default_secret_rotation = aws.secretsmanager.SecretRotation("default",
secret_id=default.master_user_secrets[0].secret_arn,
rotation_enabled=False)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var @default = new Aws.Rds.Instance("default", new()
{
AllocatedStorage = 10,
DbName = "mydb",
Engine = "mysql",
EngineVersion = "8.0",
InstanceClass = Aws.Rds.InstanceType.T3_Micro,
ManageMasterUserPassword = true,
Username = "foo",
ParameterGroupName = "default.mysql8.0",
});
var defaultSecretRotation = new Aws.SecretsManager.SecretRotation("default", new()
{
SecretId = @default.MasterUserSecrets.Apply(masterUserSecrets => masterUserSecrets[0].SecretArn),
RotationEnabled = false,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := rds.NewInstance(ctx, "default", &rds.InstanceArgs{
AllocatedStorage: pulumi.Int(10),
DbName: pulumi.String("mydb"),
Engine: pulumi.String("mysql"),
EngineVersion: pulumi.String("8.0"),
InstanceClass: pulumi.String(rds.InstanceType_T3_Micro),
ManageMasterUserPassword: pulumi.Bool(true),
Username: pulumi.String("foo"),
ParameterGroupName: pulumi.String("default.mysql8.0"),
})
if err != nil {
return err
}
_, err = secretsmanager.NewSecretRotation(ctx, "default", &secretsmanager.SecretRotationArgs{
SecretId: _default.MasterUserSecrets.ApplyT(func(masterUserSecrets []rds.InstanceMasterUserSecret) (*string, error) {
return masterUserSecrets[0].SecretArn, nil
}).(pulumi.StringPtrOutput),
RotationEnabled: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_rds_instance" "default" {
allocated_storage = 10
db_name = "mydb"
engine = "mysql"
engine_version = "8.0"
instance_class = "db.t3.micro"
manage_master_user_password = true
username = "foo"
parameter_group_name = "default.mysql8.0"
}
resource "aws_secretsmanager_secretrotation" "default" {
secret_id = aws_rds_instance.default.master_user_secrets[0].secret_arn
rotation_enabled = false
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.Instance;
import com.pulumi.aws.rds.InstanceArgs;
import com.pulumi.aws.secretsmanager.SecretRotation;
import com.pulumi.aws.secretsmanager.SecretRotationArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 default_ = new Instance("default", InstanceArgs.builder()
.allocatedStorage(10)
.dbName("mydb")
.engine("mysql")
.engineVersion("8.0")
.instanceClass("db.t3.micro")
.manageMasterUserPassword(true)
.username("foo")
.parameterGroupName("default.mysql8.0")
.build());
var defaultSecretRotation = new SecretRotation("defaultSecretRotation", SecretRotationArgs.builder()
.secretId(default_.masterUserSecrets().applyValue(_masterUserSecrets -> _masterUserSecrets[0].secretArn()))
.rotationEnabled(false)
.build());
}
}
resources:
default:
type: aws:rds:Instance
properties:
allocatedStorage: 10
dbName: mydb
engine: mysql
engineVersion: '8.0'
instanceClass: db.t3.micro
manageMasterUserPassword: true
username: foo
parameterGroupName: default.mysql8.0
defaultSecretRotation:
type: aws:secretsmanager:SecretRotation
name: default
properties:
secretId: ${default.masterUserSecrets[0].secretArn}
rotationEnabled: false
Import
Identity Schema
Required
identifier(String) Identifier of the DB Instance.
Optional
accountId(String) AWS Account where this resource is managed.region(String) Region where this resource is managed.
Using pulumi import, import DB Instances using the identifier. For example:
$ pulumi import aws:rds/instance:Instance default mydb-rds-instance
Constructors
- Instance(String name, {InstanceArgs? args, CustomResourceOptions? options})
-
Creates a new Instance.
nameThe Pulumi resource name.argsArguments used to configure this Instance. The set of arguments for Instance.optionsResource options controlling this resource's behavior. - Instance.reference(String urn)
- Creates a typed reference to an existing Instance resource.
Properties
-
address
↔ Output<
String> -
Specifies the DNS address of the DB instance.
latefinal
-
allocatedStorage
↔ Output<
int> -
The allocated storage in gibibytes. If
maxAllocatedStorageis configured, this argument represents the initial storage allocation and differences from the configuration will be ignored automatically when Storage Autoscaling occurs. IfreplicateSourceDbis set, the value is ignored during the creation of the instance.latefinal -
allowMajorVersionUpgrade
↔ Output<
bool?> -
Indicates that major version
upgrades are allowed. Changing this parameter does not result in an outage and
the change is asynchronously applied as soon as possible.
latefinal
-
applyImmediately
↔ Output<
bool?> -
Specifies whether any database modifications
are applied immediately, or during the next maintenance window. Default is
false. See Amazon RDS Documentation for more information.latefinal -
arn
↔ Output<
String> -
The ARN of the RDS instance.
latefinal
-
autoMinorVersionUpgrade
↔ Output<
bool?> -
Indicates that minor engine upgrades
will be applied automatically to the DB instance during the maintenance window.
Defaults to true.
latefinal
-
availabilityZone
↔ Output<
String> -
The AZ for the RDS instance.
latefinal
-
backupRetentionPeriod
↔ Output<
int> -
The days to retain backups for.
Must be between
0and35. Default is0. Must be greater than0if the database is used as a source for ainstance-replication, uses low-downtime updates, or will useblue-green.latefinal -
backupTarget
↔ Output<
String> -
Specifies where automated backups and manual snapshots are stored. Possible values are
region(default) andoutposts. See Working with Amazon RDS on AWS Outposts for more information.latefinal -
backupWindow
↔ Output<
String> -
The daily time range (in UTC) during which automated backups are created if they are enabled.
Example: "09:46-10:16". Must not overlap with
maintenanceWindow.latefinal -
blueGreenUpdate
↔ Output<
InstanceBlueGreenUpdate?> -
Enables low-downtime updates using
blue-green. SeeblueGreenUpdatebelow.latefinal -
caCertIdentifier
↔ Output<
String> -
The identifier of the CA certificate for the DB instance.
latefinal
-
characterSetName
↔ Output<
String> -
The character set name to use for DB encoding in Oracle and Microsoft SQL instances (collation).
This can't be changed.
See Oracle Character Sets Supported in Amazon RDS or
Server-Level Collation for Microsoft SQL Server for more information.
Cannot be set with
replicateSourceDb,restoreToPointInTime,s3Import, orsnapshotIdentifier.latefinal -
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
copyTagsToSnapshot
↔ Output<
bool?> -
Copy all Instance
tagsto snapshots. Default isfalse.latefinal -
customerOwnedIpEnabled
↔ Output<
bool?> -
Indicates whether to enable a customer-owned IP address (CoIP) for an RDS on Outposts DB instance. See CoIP for RDS on Outposts for more information.
latefinal
-
customIamInstanceProfile
↔ Output<
String?> -
The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance.
latefinal
-
databaseInsightsMode
↔ Output<
String> -
The mode of Database Insights that is enabled for the instance. Valid values:
standard,advanced.latefinal -
dbName
↔ Output<
String> -
The name of the database to create when the DB instance is created. If this parameter is not specified, no database is created in the DB instance. Note that this does not apply for Oracle or SQL Server engines. See the AWS documentation for more details on what applies for those engines. If you are providing an Oracle db name, it needs to be in all upper case. Cannot be specified for a replica.
latefinal
-
dbSubnetGroupName
↔ Output<
String> -
Name of DB subnet group.
DB instance will be created in the VPC associated with the DB subnet group.
If unspecified, will be created in the
defaultSubnet Group. When working with read replicas created in the same region, defaults to the Subnet Group Name of the source DB. When working with read replicas created in a different region, defaults to thedefaultSubnet Group. See DBSubnetGroupName in API action CreateDBInstanceReadReplica for additional read replica constraints.latefinal -
dedicatedLogVolume
↔ Output<
bool?> -
Use a dedicated log volume (DLV) for the DB instance. Requires Provisioned IOPS. See the AWS documentation for more details.
latefinal
-
deleteAutomatedBackups
↔ Output<
bool?> -
Specifies whether to remove automated backups immediately after the DB instance is deleted. Default is
true.latefinal -
deletionProtection
↔ Output<
bool?> -
If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to
true. The default isfalse.latefinal -
domain
↔ Output<
String?> -
The ID of the Directory Service Active Directory domain to create the instance in. Conflicts with
domainFqdn,domainOu,domainAuthSecretArnand adomainDnsIps.latefinal -
domainAuthSecretArn
↔ Output<
String?> -
The ARN for the Secrets Manager secret with the self managed Active Directory credentials for the user joining the domain. Conflicts with
domainanddomainIamRoleName.latefinal -
domainDnsIps
↔ Output<
List< String> ?> -
The IPv4 DNS IP addresses of your primary and secondary self managed Active Directory domain controllers. Two IP addresses must be provided. If there isn't a secondary domain controller, use the IP address of the primary domain controller for both entries in the list. Conflicts with
domainanddomainIamRoleName.latefinal -
domainFqdn
↔ Output<
String> -
The fully qualified domain name (FQDN) of the self managed Active Directory domain. Conflicts with
domainanddomainIamRoleName.latefinal -
domainIamRoleName
↔ Output<
String?> -
The name of the IAM role to be used when making API calls to the Directory Service. Conflicts with
domainFqdn,domainOu,domainAuthSecretArnand adomainDnsIps.latefinal -
domainOu
↔ Output<
String?> -
The self managed Active Directory organizational unit for your DB instance to join. Conflicts with
domainanddomainIamRoleName.latefinal -
enabledCloudwatchLogsExports
↔ Output<
List< String> ?> -
Set of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be exported. For supported values, see the EnableCloudwatchLogsExports.member.N parameter in API action CreateDBInstance.
latefinal
-
endpoint
↔ Output<
String> -
The connection endpoint in
address:portformat.latefinal -
engine
↔ Output<
String> -
The database engine to use. For supported values, see the Engine parameter in API action CreateDBInstance. Note that for Amazon Aurora instances the engine must match the DB cluster's engine'. For information on the difference between the available Aurora MySQL engines see Comparison between Aurora MySQL 1 and Aurora MySQL 2 in the Amazon RDS User Guide.
latefinal
-
engineLifecycleSupport
↔ Output<
String> -
The life cycle type for this DB instance. This setting applies only to RDS for MySQL and RDS for PostgreSQL. Valid values are
open-source-rds-extended-support,open-source-rds-extended-support-disabled. Default value isopen-source-rds-extended-support.Using Amazon RDS Extended Support: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.htmllatefinal -
engineVersion
↔ Output<
String> -
The engine version to use. If
autoMinorVersionUpgradeis enabled, you can provide a prefix of the version such as8.0(for8.0.36). The actual engine version used is returned in the attributeengineVersionActual, see Attribute Reference below. For supported values, see the EngineVersion parameter in API action CreateDBInstance. Note that for Amazon Aurora instances the engine version must match the DB cluster's engine version'.latefinal -
engineVersionActual
↔ Output<
String> -
The running version of the database.
latefinal
-
finalSnapshotIdentifier
↔ Output<
String?> -
The name of your final DB snapshot
when this DB instance is deleted. Must be provided if
skipFinalSnapshotis set tofalse. The value must begin with a letter, only contain alphanumeric characters and hyphens, and not end with a hyphen or contain two consecutive hyphens. Must not be provided when deleting a read replica.latefinal - hashCode → int
-
The hash code for this object.
no setterinherited
-
hostedZoneId
↔ Output<
String> -
Specifies the ID that Amazon Route 53 assigns when you create a hosted zone.
latefinal
-
iamDatabaseAuthenticationEnabled
↔ Output<
bool?> -
Specifies whether mappings of AWS Identity and Access Management (IAM) accounts to database
accounts is enabled.
latefinal
-
id
↔ Output<
String> -
getter/setter pairinherited
-
identifier
↔ Output<
String> -
The name of the RDS instance, if omitted, this provider will assign a random, unique identifier. Required if
restoreToPointInTimeis specified.latefinal -
identifierPrefix
↔ Output<
String> -
Creates a unique identifier beginning with the specified prefix. Conflicts with
identifier.latefinal -
instanceClass
↔ Output<
String> -
The instance type of the RDS instance.
latefinal
-
iops
↔ Output<
int> -
The amount of provisioned IOPS. Setting this implies a
storageType of "io1" or "io2". Can only be set when
storageTypeis"io1","io2or"gp3". Cannot be specified for gp3 storage if theallocatedStoragevalue is below a per-enginethreshold. See the RDS User Guide for details.latefinal - isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
kmsKeyId
↔ Output<
String> -
The ARN for the KMS encryption key. If creating an
encrypted replica, set this to the destination KMS ARN.
latefinal
-
latestRestorableTime
↔ Output<
String> -
The latest time, in UTC RFC3339 format, to which a database can be restored with point-in-time restore.
latefinal
-
licenseModel
↔ Output<
String> -
License model information for this DB instance. Valid values for this field are as follows:
latefinal
-
listenerEndpoints
↔ Output<
List< InstanceListenerEndpoint> > -
Specifies the listener connection endpoint for SQL Server Always On. See endpoint below.
latefinal
-
maintenanceWindow
↔ Output<
String> -
The window to perform maintenance in.
Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00". See RDS
Maintenance Window
docs
for more information.
latefinal
-
manageMasterUserPassword
↔ Output<
bool?> -
Set to true to allow RDS to manage the master user password in Secrets Manager. Cannot be set if
passwordorpasswordWois provided.latefinal -
masterUserSecretKmsKeyId
↔ Output<
String> -
The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. To use a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN. If not specified, the default KMS key for your Amazon Web Services account is used.
latefinal
-
masterUserSecrets
↔ Output<
List< InstanceMasterUserSecret> > -
A block that specifies the master user secret. Only available when
manageMasterUserPasswordis set to true. Documented below.latefinal -
maxAllocatedStorage
↔ Output<
int?> -
Specifies the maximum storage (in GiB) that Amazon RDS can automatically scale to for this DB instance. By default, Storage Autoscaling is disabled. To enable Storage Autoscaling, set
maxAllocatedStorageto greater than or equal toallocatedStorage. SettingmaxAllocatedStorageto 0 explicitly disables Storage Autoscaling. When configured, changes toallocatedStoragewill be automatically ignored as the storage can dynamically scale.latefinal -
monitoringInterval
↔ Output<
int?> -
The interval, in seconds, between points
when Enhanced Monitoring metrics are collected for the DB instance. To disable
collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid
Values: 0, 1, 5, 10, 15, 30, 60.
latefinal
-
monitoringRoleArn
↔ Output<
String> -
The ARN for the IAM role that permits RDS
to send enhanced monitoring metrics to CloudWatch Logs. You can find more
information on the AWS
Documentation
what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances.
latefinal
-
multiAz
↔ Output<
bool> -
Specifies if the RDS instance is multi-AZ
latefinal
-
ncharCharacterSetName
↔ Output<
String> -
The national character set is used in the NCHAR, NVARCHAR2, and NCLOB data types for Oracle instances. This can't be changed. See Oracle Character Sets
Supported in Amazon RDS.
latefinal
-
networkType
↔ Output<
String> -
The network type of the DB instance. Valid values:
IPV4,DUAL.latefinal -
optionGroupName
↔ Output<
String> -
Name of the DB option group to associate.
latefinal
-
parameterGroupName
↔ Output<
String> -
Name of the DB parameter group to associate.
latefinal
-
password
↔ Output<
String?> -
Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file. Cannot be set if
manageMasterUserPasswordis set totrue.latefinal -
passwordWo
↔ Output<
String?> -
NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file. Cannot be set if
manageMasterUserPasswordis set totrue.latefinal -
passwordWoVersion
↔ Output<
int?> -
Used together with
passwordWoto trigger an update. Increment this value when an update topasswordWois required.latefinal -
performanceInsightsEnabled
↔ Output<
bool?> -
Specifies whether Performance Insights are enabled. Defaults to false.
latefinal
-
performanceInsightsKmsKeyId
↔ Output<
String> -
The ARN for the KMS key to encrypt Performance Insights data. When specifying
performanceInsightsKmsKeyId,performanceInsightsEnabledneeds to be set to true. Once KMS key is set, it can never be changed.latefinal -
performanceInsightsRetentionPeriod
↔ Output<
int> -
Amount of time in days to retain Performance Insights data. Valid values are
7,731(2 years) or a multiple of31. When specifyingperformanceInsightsRetentionPeriod,performanceInsightsEnabledneeds to be set to true. Defaults to '7'.latefinal -
port
↔ Output<
int> -
The port on which the DB accepts connections.
latefinal
-
publiclyAccessible
↔ Output<
bool?> -
Bool to control if instance is publicly
accessible. Default is
false.latefinal -
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
replicaMode
↔ Output<
String> -
Specifies whether the replica is in either
mountedoropen-read-onlymode. This attribute is only supported by Oracle instances. Oracle replicas operate inopen-read-onlymode unless otherwise specified. See Working with Oracle Read Replicas for more information.latefinal -
replicas
↔ Output<
List< String> > -
latefinal
-
replicateSourceDb
↔ Output<
String?> -
Specifies that this resource is a Replica database, and to use this value as the source database.
If replicating an Amazon RDS Database Instance in the same region, use the
identifierof the source DB, unless also specifying thedbSubnetGroupName. If specifying thedbSubnetGroupNamein the same region, use thearnof the source DB. If replicating an Instance in a different region, use thearnof the source DB. Note that if you are creating a cross-region replica of an encrypted database you will also need to specify akmsKeyId. Seeinstance-replicationand Working with PostgreSQL and MySQL Read Replicas for more information on using Replication.latefinal -
resourceId
↔ Output<
String> -
The RDS Resource ID of this instance.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
restoreToPointInTime
↔ Output<
InstanceRestoreToPointInTime?> -
A configuration block for restoring a DB instance to an arbitrary point in time.
Requires the
identifierargument to be set with the name of the new DB instance to be created. See Restore To Point In Time below for details.latefinal - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
s3Import
↔ Output<
InstanceS3Import?> -
Restore from a Percona Xtrabackup in S3. See Importing Data into an Amazon RDS MySQL DB Instance
latefinal
-
skipFinalSnapshot
↔ Output<
bool?> -
Determines whether a final DB snapshot is
created before the DB instance is deleted. If true is specified, no DBSnapshot
is created. If false is specified, a DB snapshot is created before the DB
instance is deleted, using the value from
finalSnapshotIdentifier. Default isfalse.latefinal -
snapshotIdentifier
↔ Output<
String> -
Specifies whether or not to create this database from a snapshot.
This corresponds to the snapshot ID you'd find in the RDS console, e.g: rds:production-2015-06-26-06-05.
latefinal
-
status
↔ Output<
String> -
The RDS instance status.
latefinal
-
storageEncrypted
↔ Output<
bool?> -
Specifies whether the DB instance is
encrypted. Note that if you are creating a cross-region read replica this field
is ignored and you should instead declare
kmsKeyIdwith a valid ARN. The default isfalseif not specified.latefinal -
storageThroughput
↔ Output<
int> -
The storage throughput value for the DB instance. Can only be set when
storageTypeis"gp3". Cannot be specified if theallocatedStoragevalue is below a per-enginethreshold. See the RDS User Guide for details.latefinal -
storageType
↔ Output<
String> -
One of "standard" (magnetic), "gp2" (general
purpose SSD), "gp3" (general purpose SSD that needs
iopsindependently) "io1" (provisioned IOPS SSD) or "io2" (block express storage provisioned IOPS SSD). The default is "io1" ifiopsis specified, "gp2" if not.latefinal -
A map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
A map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
timezone
↔ Output<
String> -
Time zone of the DB instance.
timezoneis currently only supported by Microsoft SQL Server. Thetimezonecan only be set on creation. See MSSQL User Guide for more information.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
upgradeRolloutOrder
↔ Output<
String> -
Order in which the instances are upgraded (
first,second,last). See the AWS documentation for details.latefinal -
upgradeStorageConfig
↔ Output<
bool?> -
Whether to upgrade the storage file system configuration on the read replica.
Can only be set with
replicateSourceDb.latefinal -
urn
↔ Output<
String> -
latefinalinherited
-
username
↔ Output<
String> -
(Required unless a
snapshotIdentifierorreplicateSourceDbis provided) Username for the master DB user. Cannot be specified for a replica.latefinal -
vpcSecurityGroupIds
↔ Output<
List< String> > -
List of VPC security groups to
associate.
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited