Snapshot

Manages an RDS database instance snapshot. For managing RDS database cluster snapshots, see the aws.rds.ClusterSnapshot resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var bar = new Aws.Rds.Instance("bar", new Aws.Rds.InstanceArgs
        {
            AllocatedStorage = 10,
            BackupRetentionPeriod = 0,
            Engine = "MySQL",
            EngineVersion = "5.6.21",
            InstanceClass = "db.t2.micro",
            MaintenanceWindow = "Fri:09:00-Fri:09:30",
            Name = "baz",
            ParameterGroupName = "default.mysql5.6",
            Password = "barbarbarbar",
            Username = "foo",
        });
        var test = new Aws.Rds.Snapshot("test", new Aws.Rds.SnapshotArgs
        {
            DbInstanceIdentifier = bar.Id,
            DbSnapshotIdentifier = "testsnapshot1234",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/rds"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        bar, err := rds.NewInstance(ctx, "bar", &rds.InstanceArgs{
            AllocatedStorage:      pulumi.Int(10),
            BackupRetentionPeriod: pulumi.Int(0),
            Engine:                pulumi.String("MySQL"),
            EngineVersion:         pulumi.String("5.6.21"),
            InstanceClass:         pulumi.String("db.t2.micro"),
            MaintenanceWindow:     pulumi.String("Fri:09:00-Fri:09:30"),
            Name:                  pulumi.String("baz"),
            ParameterGroupName:    pulumi.String("default.mysql5.6"),
            Password:              pulumi.String("barbarbarbar"),
            Username:              pulumi.String("foo"),
        })
        if err != nil {
            return err
        }
        _, err = rds.NewSnapshot(ctx, "test", &rds.SnapshotArgs{
            DbInstanceIdentifier: bar.ID(),
            DbSnapshotIdentifier: pulumi.String("testsnapshot1234"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

bar = aws.rds.Instance("bar",
    allocated_storage=10,
    backup_retention_period=0,
    engine="MySQL",
    engine_version="5.6.21",
    instance_class="db.t2.micro",
    maintenance_window="Fri:09:00-Fri:09:30",
    name="baz",
    parameter_group_name="default.mysql5.6",
    password="barbarbarbar",
    username="foo")
test = aws.rds.Snapshot("test",
    db_instance_identifier=bar.id,
    db_snapshot_identifier="testsnapshot1234")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const bar = new aws.rds.Instance("bar", {
    allocatedStorage: 10,
    backupRetentionPeriod: 0,
    engine: "MySQL",
    engineVersion: "5.6.21",
    instanceClass: "db.t2.micro",
    maintenanceWindow: "Fri:09:00-Fri:09:30",
    name: "baz",
    parameterGroupName: "default.mysql5.6",
    password: "barbarbarbar",
    username: "foo",
});
const test = new aws.rds.Snapshot("test", {
    dbInstanceIdentifier: bar.id,
    dbSnapshotIdentifier: "testsnapshot1234",
});

Create a Snapshot Resource

def Snapshot(resource_name, opts=None, db_instance_identifier=None, db_snapshot_identifier=None, tags=None, __props__=None);
func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)
public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args SnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SnapshotArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Snapshot Resource Properties

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

Inputs

The Snapshot resource accepts the following input properties:

DbInstanceIdentifier string

The DB Instance Identifier from which to take the snapshot.

DbSnapshotIdentifier string

The Identifier for the snapshot.

Tags Dictionary<string, string>

Key-value map of resource tags

DbInstanceIdentifier string

The DB Instance Identifier from which to take the snapshot.

DbSnapshotIdentifier string

The Identifier for the snapshot.

Tags map[string]string

Key-value map of resource tags

dbInstanceIdentifier string

The DB Instance Identifier from which to take the snapshot.

dbSnapshotIdentifier string

The Identifier for the snapshot.

tags {[key: string]: string}

Key-value map of resource tags

db_instance_identifier str

The DB Instance Identifier from which to take the snapshot.

db_snapshot_identifier str

The Identifier for the snapshot.

tags Dict[str, str]

Key-value map of resource tags

Outputs

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

AllocatedStorage int

Specifies the allocated storage size in gigabytes (GB).

AvailabilityZone string

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

DbSnapshotArn string

The Amazon Resource Name (ARN) for the DB snapshot.

Encrypted bool

Specifies whether the DB snapshot is encrypted.

Engine string

Specifies the name of the database engine.

EngineVersion string

Specifies the version of the database engine.

Id string
The provider-assigned unique ID for this managed resource.
Iops int

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

KmsKeyId string

The ARN for the KMS encryption key.

LicenseModel string

License model information for the restored DB instance.

OptionGroupName string

Provides the option group name for the DB snapshot.

Port int
SnapshotType string
SourceDbSnapshotIdentifier string

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

SourceRegion string

The region that the DB snapshot was created in or copied from.

Status string

Specifies the status of this DB snapshot.

StorageType string

Specifies the storage type associated with DB snapshot.

VpcId string

Specifies the storage type associated with DB snapshot.

AllocatedStorage int

Specifies the allocated storage size in gigabytes (GB).

AvailabilityZone string

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

DbSnapshotArn string

The Amazon Resource Name (ARN) for the DB snapshot.

Encrypted bool

Specifies whether the DB snapshot is encrypted.

Engine string

Specifies the name of the database engine.

EngineVersion string

Specifies the version of the database engine.

Id string
The provider-assigned unique ID for this managed resource.
Iops int

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

KmsKeyId string

The ARN for the KMS encryption key.

LicenseModel string

License model information for the restored DB instance.

OptionGroupName string

Provides the option group name for the DB snapshot.

Port int
SnapshotType string
SourceDbSnapshotIdentifier string

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

SourceRegion string

The region that the DB snapshot was created in or copied from.

Status string

Specifies the status of this DB snapshot.

StorageType string

Specifies the storage type associated with DB snapshot.

VpcId string

Specifies the storage type associated with DB snapshot.

allocatedStorage number

Specifies the allocated storage size in gigabytes (GB).

availabilityZone string

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

dbSnapshotArn string

The Amazon Resource Name (ARN) for the DB snapshot.

encrypted boolean

Specifies whether the DB snapshot is encrypted.

engine string

Specifies the name of the database engine.

engineVersion string

Specifies the version of the database engine.

id string
The provider-assigned unique ID for this managed resource.
iops number

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

kmsKeyId string

The ARN for the KMS encryption key.

licenseModel string

License model information for the restored DB instance.

optionGroupName string

Provides the option group name for the DB snapshot.

port number
snapshotType string
sourceDbSnapshotIdentifier string

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

sourceRegion string

The region that the DB snapshot was created in or copied from.

status string

Specifies the status of this DB snapshot.

storageType string

Specifies the storage type associated with DB snapshot.

vpcId string

Specifies the storage type associated with DB snapshot.

allocated_storage float

Specifies the allocated storage size in gigabytes (GB).

availability_zone str

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

db_snapshot_arn str

The Amazon Resource Name (ARN) for the DB snapshot.

encrypted bool

Specifies whether the DB snapshot is encrypted.

engine str

Specifies the name of the database engine.

engine_version str

Specifies the version of the database engine.

id str
The provider-assigned unique ID for this managed resource.
iops float

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

kms_key_id str

The ARN for the KMS encryption key.

license_model str

License model information for the restored DB instance.

option_group_name str

Provides the option group name for the DB snapshot.

port float
snapshot_type str
source_db_snapshot_identifier str

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

source_region str

The region that the DB snapshot was created in or copied from.

status str

Specifies the status of this DB snapshot.

storage_type str

Specifies the storage type associated with DB snapshot.

vpc_id str

Specifies the storage type associated with DB snapshot.

Look up an Existing Snapshot Resource

Get an existing Snapshot 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?: SnapshotState, opts?: CustomResourceOptions): Snapshot
static get(resource_name, id, opts=None, allocated_storage=None, availability_zone=None, db_instance_identifier=None, db_snapshot_arn=None, db_snapshot_identifier=None, encrypted=None, engine=None, engine_version=None, iops=None, kms_key_id=None, license_model=None, option_group_name=None, port=None, snapshot_type=None, source_db_snapshot_identifier=None, source_region=None, status=None, storage_type=None, tags=None, vpc_id=None, __props__=None);
func GetSnapshot(ctx *Context, name string, id IDInput, state *SnapshotState, opts ...ResourceOption) (*Snapshot, error)
public static Snapshot Get(string name, Input<string> id, SnapshotState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

AllocatedStorage int

Specifies the allocated storage size in gigabytes (GB).

AvailabilityZone string

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

DbInstanceIdentifier string

The DB Instance Identifier from which to take the snapshot.

DbSnapshotArn string

The Amazon Resource Name (ARN) for the DB snapshot.

DbSnapshotIdentifier string

The Identifier for the snapshot.

Encrypted bool

Specifies whether the DB snapshot is encrypted.

Engine string

Specifies the name of the database engine.

EngineVersion string

Specifies the version of the database engine.

Iops int

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

KmsKeyId string

The ARN for the KMS encryption key.

LicenseModel string

License model information for the restored DB instance.

OptionGroupName string

Provides the option group name for the DB snapshot.

Port int
SnapshotType string
SourceDbSnapshotIdentifier string

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

SourceRegion string

The region that the DB snapshot was created in or copied from.

Status string

Specifies the status of this DB snapshot.

StorageType string

Specifies the storage type associated with DB snapshot.

Tags Dictionary<string, string>

Key-value map of resource tags

VpcId string

Specifies the storage type associated with DB snapshot.

AllocatedStorage int

Specifies the allocated storage size in gigabytes (GB).

AvailabilityZone string

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

DbInstanceIdentifier string

The DB Instance Identifier from which to take the snapshot.

DbSnapshotArn string

The Amazon Resource Name (ARN) for the DB snapshot.

DbSnapshotIdentifier string

The Identifier for the snapshot.

Encrypted bool

Specifies whether the DB snapshot is encrypted.

Engine string

Specifies the name of the database engine.

EngineVersion string

Specifies the version of the database engine.

Iops int

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

KmsKeyId string

The ARN for the KMS encryption key.

LicenseModel string

License model information for the restored DB instance.

OptionGroupName string

Provides the option group name for the DB snapshot.

Port int
SnapshotType string
SourceDbSnapshotIdentifier string

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

SourceRegion string

The region that the DB snapshot was created in or copied from.

Status string

Specifies the status of this DB snapshot.

StorageType string

Specifies the storage type associated with DB snapshot.

Tags map[string]string

Key-value map of resource tags

VpcId string

Specifies the storage type associated with DB snapshot.

allocatedStorage number

Specifies the allocated storage size in gigabytes (GB).

availabilityZone string

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

dbInstanceIdentifier string

The DB Instance Identifier from which to take the snapshot.

dbSnapshotArn string

The Amazon Resource Name (ARN) for the DB snapshot.

dbSnapshotIdentifier string

The Identifier for the snapshot.

encrypted boolean

Specifies whether the DB snapshot is encrypted.

engine string

Specifies the name of the database engine.

engineVersion string

Specifies the version of the database engine.

iops number

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

kmsKeyId string

The ARN for the KMS encryption key.

licenseModel string

License model information for the restored DB instance.

optionGroupName string

Provides the option group name for the DB snapshot.

port number
snapshotType string
sourceDbSnapshotIdentifier string

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

sourceRegion string

The region that the DB snapshot was created in or copied from.

status string

Specifies the status of this DB snapshot.

storageType string

Specifies the storage type associated with DB snapshot.

tags {[key: string]: string}

Key-value map of resource tags

vpcId string

Specifies the storage type associated with DB snapshot.

allocated_storage float

Specifies the allocated storage size in gigabytes (GB).

availability_zone str

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

db_instance_identifier str

The DB Instance Identifier from which to take the snapshot.

db_snapshot_arn str

The Amazon Resource Name (ARN) for the DB snapshot.

db_snapshot_identifier str

The Identifier for the snapshot.

encrypted bool

Specifies whether the DB snapshot is encrypted.

engine str

Specifies the name of the database engine.

engine_version str

Specifies the version of the database engine.

iops float

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.

kms_key_id str

The ARN for the KMS encryption key.

license_model str

License model information for the restored DB instance.

option_group_name str

Provides the option group name for the DB snapshot.

port float
snapshot_type str
source_db_snapshot_identifier str

The DB snapshot Arn that the DB snapshot was copied from. It only has value in case of cross customer or cross region copy.

source_region str

The region that the DB snapshot was created in or copied from.

status str

Specifies the status of this DB snapshot.

storage_type str

Specifies the storage type associated with DB snapshot.

tags Dict[str, str]

Key-value map of resource tags

vpc_id str

Specifies the storage type associated with DB snapshot.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.