Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release -- shorter retention in AWS Backup #54

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 7 additions & 33 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,12 @@
# This workflow installs the latest version of Terraform CLI. On pull request events, this workflow will run
# `terraform init`, `terraform fmt`, and `terraform plan`.
#
# Documentation for `hashicorp/setup-terraform` is located here: https://github.com/hashicorp/setup-terraform

name: 'Terraform'
name: Terraform

on:
push:
branches: ["**"]
branches: [ '**' ]

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest

steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v4

# Install the latest version of Terraform CLI
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "<1.6.0" # only use open source version of Terraform

# Checks that all Terraform configuration files adhere to a canonical format
- name: Terraform Format
run: terraform fmt -check -diff -recursive

# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init -backend=false

# Validate the files, referring only to the configuration and not accessing any remote services
- name: Terraform Validate
run: terraform validate
build:
uses: silinternational/workflows/.github/workflows/terraform.yml@main
with:
# validate with the earliest version allowed by required_version in versions.tf
terraform-version: '~> 1.1'
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ locals {
create_cd_user = !local.is_multiregion || local.is_multiregion_primary
mysql_database = "session"
mysql_user = "root"
name_tag_suffix = "${var.app_name}-${var.customer}-${local.app_environment}"
tags = {
managed_by = "terraform"
workspace = terraform.workspace
Expand Down Expand Up @@ -203,7 +202,7 @@ module "aws_backup" {
count = var.enable_aws_backup ? 1 : 0

source = "silinternational/backup/aws"
version = "0.2.0"
version = "0.2.2"

app_name = "${var.app_name}-${var.aws_region}"
app_env = var.app_env
Expand All @@ -215,4 +214,6 @@ module "aws_backup" {
notification_events = var.aws_backup_notification_events
sns_topic_name = "${local.app_name_and_env}-backup-vault-events"
sns_email_subscription = var.backup_sns_email
cold_storage_after = 0
delete_after = var.delete_recovery_point_after_days
}
6 changes: 6 additions & 0 deletions vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,9 @@ variable "backup_sns_email" {
type = string
default = ""
}

variable "delete_recovery_point_after_days" {
description = "Number of days after which AWS Backup recovery points are deleted"
type = number
default = 30
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

terraform {
required_version = ">= 0.14"
required_version = ">= 1.1"
required_providers {
aws = {
version = ">= 4.0.0, < 6.0.0"
Expand Down