diff options
author | Christopher Baines <mail@cbaines.net> | 2019-01-07 19:56:33 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-01-07 19:56:33 +0000 |
commit | de44db00ab49e8adf4145cdc58e5416905609c23 (patch) | |
tree | c1013c3698761077f07e1c9e0e45708e5df43f99 | |
parent | c916b08ca13fb91267d29eaf1a5fc62958def82d (diff) | |
download | govuk-mini-environment-admin-de44db00ab49e8adf4145cdc58e5416905609c23.tar govuk-mini-environment-admin-de44db00ab49e8adf4145cdc58e5416905609c23.tar.gz |
Set environment variables when creating data snapshots
This means that govuk data can access the data from S3.
-rw-r--r-- | app/jobs/govuk_guix/create_data_snapshot_job.rb | 7 | ||||
-rw-r--r-- | 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 <<EOF echo 'GUIX_PROFILE=/home/ubuntu/.guix-profile; source /home/ubuntu/.guix-profile/etc/profile -export GOVUK_AWS_DONT_ASSUME_ROLE=true ' | cat - .bashrc > temp && mv temp .bashrc EOF ] |