mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
fix: aws managed services couldn't be deleted
Note: this makes tests way longer, but this is the only way to test it properly. If it was the case before, this bug would never happen
This commit is contained in:
committed by
Pierre Mavro
parent
6441e7633a
commit
8c0b769531
@@ -118,4 +118,7 @@ resource "aws_docdb_cluster" "documentdb_cluster" {
|
||||
backup_retention_period = var.backup_retention_period
|
||||
preferred_backup_window = var.preferred_backup_window
|
||||
skip_final_snapshot = var.skip_final_snapshot
|
||||
{%- if not skip_final_snapshot %}
|
||||
final_snapshot_identifier = var.final_snapshot_name
|
||||
{%- endif %}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,12 @@ variable "skip_final_snapshot" {
|
||||
type = bool
|
||||
}
|
||||
|
||||
variable "final_snapshot_name" {
|
||||
description = "Name of the final snapshot before the database goes deleted"
|
||||
default = "{{ final_snapshot_name }}"
|
||||
type = string
|
||||
}
|
||||
|
||||
{%- if snapshot is defined %}
|
||||
# Snapshots
|
||||
variable "snapshot_identifier" {
|
||||
|
||||
@@ -132,6 +132,10 @@ resource "aws_db_instance" "mysql_instance" {
|
||||
backup_retention_period = var.backup_retention_period
|
||||
backup_window = var.backup_window
|
||||
skip_final_snapshot = var.skip_final_snapshot
|
||||
{%- if not skip_final_snapshot %}
|
||||
final_snapshot_identifier = var.final_snapshot_name
|
||||
{%- endif %}
|
||||
copy_tags_to_snapshot = true
|
||||
delete_automated_backups = var.delete_automated_backups
|
||||
|
||||
}
|
||||
|
||||
@@ -164,6 +164,12 @@ variable "skip_final_snapshot" {
|
||||
type = bool
|
||||
}
|
||||
|
||||
variable "final_snapshot_name" {
|
||||
description = "Name of the final snapshot before the database goes deleted"
|
||||
default = "{{ final_snapshot_name }}"
|
||||
type = string
|
||||
}
|
||||
|
||||
{%- if snapshot is defined %}
|
||||
# Snapshots
|
||||
variable "snapshot_identifier" {
|
||||
|
||||
@@ -116,6 +116,10 @@ resource "aws_db_instance" "postgresql_instance" {
|
||||
backup_retention_period = var.backup_retention_period
|
||||
backup_window = var.backup_window
|
||||
skip_final_snapshot = var.skip_final_snapshot
|
||||
{%- if not skip_final_snapshot %}
|
||||
final_snapshot_identifier = var.final_snapshot_name
|
||||
{%- endif %}
|
||||
copy_tags_to_snapshot = true
|
||||
delete_automated_backups = var.delete_automated_backups
|
||||
|
||||
}
|
||||
|
||||
@@ -172,6 +172,12 @@ variable "skip_final_snapshot" {
|
||||
type = bool
|
||||
}
|
||||
|
||||
variable "final_snapshot_name" {
|
||||
description = "Name of the final snapshot before the database goes deleted"
|
||||
default = "{{ final_snapshot_name }}"
|
||||
type = string
|
||||
}
|
||||
|
||||
# Snapshots
|
||||
#variable "snapshot_identifier" {
|
||||
# description = "Snapshot ID to restore"
|
||||
|
||||
@@ -106,8 +106,8 @@ resource "aws_elasticache_cluster" "elasticache_cluster" {
|
||||
# Backups
|
||||
snapshot_window = var.preferred_backup_window
|
||||
snapshot_retention_limit = var.backup_retention_period
|
||||
{%- if skip_final_snapshot %}
|
||||
final_snapshot_identifier = "${var.elasticache_identifier}-final"
|
||||
{%- if not skip_final_snapshot %}
|
||||
final_snapshot_identifier = var.final_snapshot_name
|
||||
{%- endif %}
|
||||
|
||||
}
|
||||
|
||||
@@ -114,6 +114,12 @@ variable "preferred_backup_window" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "final_snapshot_name" {
|
||||
description = "Name of the final snapshot before the database goes deleted"
|
||||
default = "{{ final_snapshot_name }}"
|
||||
type = string
|
||||
}
|
||||
|
||||
{%- if snapshot is defined %}
|
||||
# Snapshots
|
||||
variable "snapshot_identifier" {
|
||||
|
||||
Reference in New Issue
Block a user