Skip to content

Commit

Permalink
add snapshot service replica (#416)
Browse files Browse the repository at this point in the history
LesnyRumcajs authored Feb 26, 2024
1 parent b2f4bc3 commit 0e53bba
Showing 2 changed files with 29 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/deploy-daily-snapshot.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ on:
paths:
- 'tf-managed/modules/daily-snapshot/**'
- 'tf-managed/scripts/**'
- 'tf-managed/live/environments/prod/applications/snapshot-service/**'
- 'tf-managed/live/environments/prod/applications/snapshot-service**'
# This needs to be declared explicitly so that the job is actually
# run when moved out of draft.
types: [opened, synchronize, reopened, ready_for_review]
@@ -18,11 +18,14 @@ on:
paths:
- 'tf-managed/modules/daily-snapshot/**'
- 'tf-managed/scripts/**'
- 'tf-managed/live/environments/prod/applications/snapshot-service'
- 'tf-managed/live/environments/prod/applications/snapshot-service**'
workflow_dispatch:

jobs:
deploy-daily-snapshot:
strategy:
matrix:
replica: ["snapshot-service", "snapshot-service-2"]
env:
TF_VAR_monitoring: "{ \"enable\": true,\"slack_enable\":true,\"slack_destination_id\":\"${{ secrets.SLACK_DESTINATION_ID }}\",\"slack_channel_id\":\"${{ secrets.SLACK_CHANNEL_ID }}\"}"
runs-on: ubuntu-latest
@@ -41,8 +44,8 @@ jobs:
r2_access_key: ${{ secrets.R2_ACCESS_KEY }}
r2_secret_key: ${{ secrets.R2_SECRET_KEY }}
slack_token: ${{ secrets.SLACK_TOKEN }}
working_directory: tf-managed/live/environments/prod/applications/snapshot-service
service_name: Snapshot Service
working_directory: tf-managed/live/environments/prod/applications/${{ matrix.replica }}
service_name: ${{ matrix.replica }}
new_relic_account_id: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
new_relic_api_key: ${{ secrets.NEW_RELIC_API_KEY }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Automatically find the root terragrunt.hcl and inherit its
# configuration
include "root" {
path = find_in_parent_folders()
}

# Load the actual Terraform module
terraform {
source = format("%s/../modules/daily-snapshot", get_parent_terragrunt_dir())
}

inputs = {
name = "forest-snapshot-2"
size = "s-4vcpu-16gb-amd"
r2_endpoint = "https://2238a825c5aca59233eab1f221f7aefb.r2.cloudflarestorage.com/"
forest_tag = "v0.16.6-fat"
snapshot_bucket = "forest-archive"

monitoring = {
enable = true,
}
}

0 comments on commit 0e53bba

Please sign in to comment.