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
new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);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:
- Db
Instance stringIdentifier The DB Instance Identifier from which to take the snapshot.
- Db
Snapshot stringIdentifier The Identifier for the snapshot.
- Dictionary<string, string>
Key-value map of resource tags
- Db
Instance stringIdentifier The DB Instance Identifier from which to take the snapshot.
- Db
Snapshot stringIdentifier The Identifier for the snapshot.
- map[string]string
Key-value map of resource tags
- db
Instance stringIdentifier The DB Instance Identifier from which to take the snapshot.
- db
Snapshot stringIdentifier The Identifier for the snapshot.
- {[key: string]: string}
Key-value map of resource tags
- db_
instance_ stridentifier The DB Instance Identifier from which to take the snapshot.
- db_
snapshot_ stridentifier The Identifier for the snapshot.
- 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:
- Allocated
Storage int Specifies the allocated storage size in gigabytes (GB).
- Availability
Zone string Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
- Db
Snapshot stringArn 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.
- Engine
Version 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.
- Kms
Key stringId The ARN for the KMS encryption key.
- License
Model string License model information for the restored DB instance.
- Option
Group stringName Provides the option group name for the DB snapshot.
- Port int
- Snapshot
Type string - Source
Db stringSnapshot Identifier 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 string The region that the DB snapshot was created in or copied from.
- Status string
Specifies the status of this DB snapshot.
- Storage
Type string Specifies the storage type associated with DB snapshot.
- Vpc
Id string Specifies the storage type associated with DB snapshot.
- Allocated
Storage int Specifies the allocated storage size in gigabytes (GB).
- Availability
Zone string Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
- Db
Snapshot stringArn 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.
- Engine
Version 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.
- Kms
Key stringId The ARN for the KMS encryption key.
- License
Model string License model information for the restored DB instance.
- Option
Group stringName Provides the option group name for the DB snapshot.
- Port int
- Snapshot
Type string - Source
Db stringSnapshot Identifier 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 string The region that the DB snapshot was created in or copied from.
- Status string
Specifies the status of this DB snapshot.
- Storage
Type string Specifies the storage type associated with DB snapshot.
- Vpc
Id string Specifies the storage type associated with DB snapshot.
- allocated
Storage number Specifies the allocated storage size in gigabytes (GB).
- availability
Zone string Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
- db
Snapshot stringArn 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.
- engine
Version 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.
- kms
Key stringId The ARN for the KMS encryption key.
- license
Model string License model information for the restored DB instance.
- option
Group stringName Provides the option group name for the DB snapshot.
- port number
- snapshot
Type string - source
Db stringSnapshot Identifier 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 string The region that the DB snapshot was created in or copied from.
- status string
Specifies the status of this DB snapshot.
- storage
Type string Specifies the storage type associated with DB snapshot.
- vpc
Id 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_ strarn 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_ strid The ARN for the KMS encryption key.
- license_
model str License model information for the restored DB instance.
- option_
group_ strname Provides the option group name for the DB snapshot.
- port float
- snapshot_
type str - source_
db_ strsnapshot_ identifier 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): Snapshotstatic 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:
- Allocated
Storage int Specifies the allocated storage size in gigabytes (GB).
- Availability
Zone string Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
- Db
Instance stringIdentifier The DB Instance Identifier from which to take the snapshot.
- Db
Snapshot stringArn The Amazon Resource Name (ARN) for the DB snapshot.
- Db
Snapshot stringIdentifier The Identifier for the snapshot.
- Encrypted bool
Specifies whether the DB snapshot is encrypted.
- Engine string
Specifies the name of the database engine.
- Engine
Version 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.
- Kms
Key stringId The ARN for the KMS encryption key.
- License
Model string License model information for the restored DB instance.
- Option
Group stringName Provides the option group name for the DB snapshot.
- Port int
- Snapshot
Type string - Source
Db stringSnapshot Identifier 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 string The region that the DB snapshot was created in or copied from.
- Status string
Specifies the status of this DB snapshot.
- Storage
Type string Specifies the storage type associated with DB snapshot.
- Dictionary<string, string>
Key-value map of resource tags
- Vpc
Id string Specifies the storage type associated with DB snapshot.
- Allocated
Storage int Specifies the allocated storage size in gigabytes (GB).
- Availability
Zone string Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
- Db
Instance stringIdentifier The DB Instance Identifier from which to take the snapshot.
- Db
Snapshot stringArn The Amazon Resource Name (ARN) for the DB snapshot.
- Db
Snapshot stringIdentifier The Identifier for the snapshot.
- Encrypted bool
Specifies whether the DB snapshot is encrypted.
- Engine string
Specifies the name of the database engine.
- Engine
Version 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.
- Kms
Key stringId The ARN for the KMS encryption key.
- License
Model string License model information for the restored DB instance.
- Option
Group stringName Provides the option group name for the DB snapshot.
- Port int
- Snapshot
Type string - Source
Db stringSnapshot Identifier 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 string The region that the DB snapshot was created in or copied from.
- Status string
Specifies the status of this DB snapshot.
- Storage
Type string Specifies the storage type associated with DB snapshot.
- map[string]string
Key-value map of resource tags
- Vpc
Id string Specifies the storage type associated with DB snapshot.
- allocated
Storage number Specifies the allocated storage size in gigabytes (GB).
- availability
Zone string Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.
- db
Instance stringIdentifier The DB Instance Identifier from which to take the snapshot.
- db
Snapshot stringArn The Amazon Resource Name (ARN) for the DB snapshot.
- db
Snapshot stringIdentifier The Identifier for the snapshot.
- encrypted boolean
Specifies whether the DB snapshot is encrypted.
- engine string
Specifies the name of the database engine.
- engine
Version 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.
- kms
Key stringId The ARN for the KMS encryption key.
- license
Model string License model information for the restored DB instance.
- option
Group stringName Provides the option group name for the DB snapshot.
- port number
- snapshot
Type string - source
Db stringSnapshot Identifier 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 string The region that the DB snapshot was created in or copied from.
- status string
Specifies the status of this DB snapshot.
- storage
Type string Specifies the storage type associated with DB snapshot.
- {[key: string]: string}
Key-value map of resource tags
- vpc
Id 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_ stridentifier The DB Instance Identifier from which to take the snapshot.
- db_
snapshot_ strarn The Amazon Resource Name (ARN) for the DB snapshot.
- db_
snapshot_ stridentifier 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_ strid The ARN for the KMS encryption key.
- license_
model str License model information for the restored DB instance.
- option_
group_ strname Provides the option group name for the DB snapshot.
- port float
- snapshot_
type str - source_
db_ strsnapshot_ identifier 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.
- 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
awsTerraform Provider.