Update terraform build images
This commit is contained in:
parent
6c633ee581
commit
8683d2c2c6
13 changed files with 55 additions and 45 deletions
|
|
@ -35,8 +35,14 @@ trap 'catch $? $LINENO' ERR
|
|||
|
||||
terraform init
|
||||
|
||||
GET_UNTIL_VALID="
|
||||
from datetime import datetime, timedelta
|
||||
two_hours_from_now = datetime.utcnow() + timedelta(hours=2)
|
||||
print(two_hours_from_now.strftime('%Y-%m-%dT%H:%M:%SZ'))
|
||||
"
|
||||
|
||||
# destroy spot instance after two hours
|
||||
EC2_VALID_UNTIL=$(date -d "+2 hours" +%Y-%m-%dT%H:%M:%SZ)
|
||||
EC2_VALID_UNTIL=$(python3 -c "$GET_UNTIL_VALID")
|
||||
|
||||
terraform plan \
|
||||
-var-file /root/aws.tfvars \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue