From 32d42b3e6d1837ff82737a4796ea74fdc1e1c776 Mon Sep 17 00:00:00 2001 From: Rosie Storey Date: Thu, 17 Jan 2019 13:36:57 -0500 Subject: [PATCH] Shutdown data load host when restore process is done, and terminate the instance --- cloudformation/infrastructure/data-load.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloudformation/infrastructure/data-load.yaml b/cloudformation/infrastructure/data-load.yaml index c7a13a84a..b889d5107 100644 --- a/cloudformation/infrastructure/data-load.yaml +++ b/cloudformation/infrastructure/data-load.yaml @@ -64,6 +64,7 @@ Resources: - EnvironmentMapping - IamInstanceProfileName - Ref: EnvironmentName + InstanceInitiatedShutdownBehavior: terminate NetworkInterfaces: - AssociatePublicIpAddress: true DeviceIndex: "0" @@ -88,6 +89,7 @@ Resources: echo "${PostgresqlHost}:5432:*:concordia:${PostgresqlPassword}" >> /root/.pgpass chmod 0600 /root/.pgpass pg_restore --create --clean -Fc -U concordia -h ${PostgresqlHost} --dbname=postgres --no-password --no-owner --no-acl concordia.dmp + shutdown -h now Tags: - Key: Name Value: !Sub ${EnvironmentName}-DataLoadHost