Skip to content

Commit

Permalink
Merge pull request #54 from silinternational/develop
Browse files Browse the repository at this point in the history
Release -- shorter retention in AWS Backup
  • Loading branch information
briskt authored Nov 12, 2024
2 parents 0505550 + 5219cc2 commit 79df357
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 36 deletions.
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

0 comments on commit 79df357

Please sign in to comment.