-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rdb): creating instance from snapshot (#2872)
* feat(rdb): add resource for snapshot * feat: add test * fix lint doc * fix: lint doc * fix: lint doc * fix: lint doc * fix: lint doc * fix: lint doc * chore(deps): bump github.com/aws/smithy-go from 1.22.1 to 1.22.2 (#2892) Bumps [github.com/aws/smithy-go](https://github.com/aws/smithy-go) from 1.22.1 to 1.22.2. - [Release notes](https://github.com/aws/smithy-go/releases) - [Changelog](https://github.com/aws/smithy-go/blob/main/CHANGELOG.md) - [Commits](aws/smithy-go@v1.22.1...v1.22.2) --- updated-dependencies: - dependency-name: github.com/aws/smithy-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rémy Léone <rleone@scaleway.com> * feat: add test * fix: name test * fix: lint * updated cassette * fix error 400 * delete old cassette * delete unused cassette * fix delete log * doc updated * fix: update node_type description * Fix a lint --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rémy Léone <rleone@scaleway.com>
- Loading branch information
1 parent
b213214
commit 006df6b
Showing
46 changed files
with
25,283 additions
and
17,591 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
subcategory: "Databases" | ||
page_title: "Scaleway: scaleway_rdb_snapshot" | ||
--- | ||
|
||
# Resource: scaleway_rdb_snapshot | ||
|
||
Creates and manages Scaleway RDB (Relational Database) Snapshots. | ||
Snapshots are point-in-time backups of a database instance that can be used for recovery or duplication. | ||
For more information, refer to [the API documentation](https://www.scaleway.com/en/developers/api/managed-database-postgre-mysql/). | ||
|
||
## Example Usage | ||
|
||
### Example Basic Snapshot | ||
|
||
```terraform | ||
resource "scaleway_rdb_instance" "main" { | ||
name = "test-rdb-instance" | ||
node_type = "db-dev-s" | ||
engine = "PostgreSQL-15" | ||
is_ha_cluster = false | ||
disable_backup = true | ||
user_name = "my_initial_user" | ||
password = "thiZ_is_v&ry_s3cret" | ||
tags = ["terraform-test", "scaleway_rdb_instance", "minimal"] | ||
volume_type = "bssd" | ||
volume_size_in_gb = 10 | ||
} | ||
resource "scaleway_rdb_snapshot" "test" { | ||
name = "initial-snapshot" | ||
instance_id = scaleway_rdb_instance.main.id | ||
depends_on = [scaleway_rdb_instance.main] | ||
} | ||
``` | ||
|
||
### Example with Expiration | ||
|
||
```terraform | ||
resource "scaleway_rdb_snapshot" "snapshot_with_expiration" { | ||
name = "snapshot-with-expiration" | ||
instance_id = scaleway_rdb_instance.main.id | ||
expires_at = "2025-01-31T00:00:00Z" | ||
} | ||
``` | ||
|
||
### Example with Multiple Snapshots | ||
|
||
```terraform | ||
resource "scaleway_rdb_snapshot" "snapshot_a" { | ||
name = "snapshot_a" | ||
instance_id = scaleway_rdb_instance.main.id | ||
depends_on = [scaleway_rdb_instance.main] | ||
} | ||
resource "scaleway_rdb_snapshot" "snapshot_b" { | ||
name = "snapshot_b" | ||
instance_id = scaleway_rdb_instance.main.id | ||
expires_at = "2025-02-07T00:00:00Z" | ||
depends_on = [scaleway_rdb_instance.main] | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
- `name` - (Required) The name of the snapshot. | ||
- `instance_id` - (Required) The UUID of the database instance for which the snapshot is created. | ||
- `snapshot_id` - (Optional, ForceNew) The ID of an existing snapshot. This allows creating an instance from a specific snapshot ID. Conflicts with `engine`. | ||
- `expires_at` - (Optional) Expiration date of the snapshot in ISO 8601 format (e.g., `2025-01-31T00:00:00Z`). If not set, the snapshot will not expire automatically. | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
- `id` - The unique ID of the snapshot. | ||
- `created_at` - The timestamp when the snapshot was created, in ISO 8601 format. | ||
- `updated_at` - The timestamp when the snapshot was last updated, in ISO 8601 format. | ||
- `status` - The current status of the snapshot (e.g., `ready`, `creating`, `error`). | ||
- `size` - The size of the snapshot in bytes. | ||
- `node_type` - The type of the database instance for which the snapshot was created. | ||
- `volume_type` - The type of volume used by the snapshot. | ||
|
||
## Attributes Reference | ||
|
||
- `region` - The region where the snapshot is stored. Defaults to the region set in the provider configuration. | ||
|
||
## Import | ||
|
||
RDB Snapshots can be imported using the `{region}/{snapshot_id}` format. | ||
|
||
## Limitations | ||
|
||
- Snapshots are tied to the database instance and region where they are created. | ||
- Expired snapshots are automatically deleted and cannot be restored. | ||
|
||
## Notes | ||
|
||
- Ensure the `instance_id` corresponds to an existing database instance. | ||
- Use the `depends_on` argument when creating snapshots right after creating an instance to ensure proper dependency management. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.