From de44db00ab49e8adf4145cdc58e5416905609c23 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 7 Jan 2019 19:56:33 +0000 Subject: Set environment variables when creating data snapshots This means that govuk data can access the data from S3. --- app/jobs/govuk_guix/create_data_snapshot_job.rb | 7 ++++++- terraform/aws/backend/main.tf | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/jobs/govuk_guix/create_data_snapshot_job.rb b/app/jobs/govuk_guix/create_data_snapshot_job.rb index bcc8aa1..b054b6b 100644 --- a/app/jobs/govuk_guix/create_data_snapshot_job.rb +++ b/app/jobs/govuk_guix/create_data_snapshot_job.rb @@ -75,7 +75,12 @@ class GovukGuix::CreateDataSnapshotJob < Que::Job 'signon' # As the configuration is handled by govuk-guix ] ), - run_remotely_on_host: remote_host + run_remotely_on_host: remote_host, + environment_variables: { + 'GOVUK_AWS_DONT_ASSUME_ROLE' => 'true', + 'AWS_ACCESS_KEY_ID' => backend.aws_access_key_id, + 'AWS_SECRET_ACCESS_KEY' => backend.aws_secret_access_key + } ) build_output = output.last.strip diff --git a/terraform/aws/backend/main.tf b/terraform/aws/backend/main.tf index c375411..f0ecb1a 100644 --- a/terraform/aws/backend/main.tf +++ b/terraform/aws/backend/main.tf @@ -327,7 +327,6 @@ EOF # This is needed for things like guix copy to work < temp && mv temp .bashrc EOF ] -- cgit v1.2.3