Merge pull request #2818 from bblommers/cloudformation_stack_creation_time

Cloudformation - Stack creation time
This commit is contained in:
Steve Pulec 2020-03-19 19:38:46 -05:00 committed by GitHub
commit b0ea0aa162
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View file

@ -2,6 +2,8 @@ from __future__ import unicode_literals
import json
from collections import OrderedDict
from datetime import datetime, timedelta
import pytz
import boto3
from botocore.exceptions import ClientError
@ -911,6 +913,10 @@ def test_describe_stack_by_name():
stack = cf_conn.describe_stacks(StackName="test_stack")["Stacks"][0]
stack["StackName"].should.equal("test_stack")
two_secs_ago = datetime.now(tz=pytz.UTC) - timedelta(seconds=2)
assert (
two_secs_ago < stack["CreationTime"] < datetime.now(tz=pytz.UTC)
), "Stack should have been created recently"
@mock_cloudformation