Skip to content

Commit 2b4f89c

Browse files
authored
Fix issue when polling for CloudFormation events showing events before deploy-serverless command was invoked (#432)
1 parent 9571620 commit 2b4f89c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Projects": [
3+
{
4+
"Name": "Amazon.Lambda.Tools",
5+
"Type": "Patch",
6+
"ChangelogMessages": [
7+
"Fix issue when polling for CloudFormation events showing events before deploy-serverless command was invoked"
8+
]
9+
}
10+
]
11+
}

src/Amazon.Lambda.Tools/Commands/DeployServerlessCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ protected override async Task<bool> PerformActionAsync()
348348
};
349349

350350
// Execute the change set.
351-
DateTime timeChangeSetExecuted = DateTime.Now;
351+
DateTime timeChangeSetExecuted = DateTime.UtcNow;
352352
try
353353
{
354354
await this.CloudFormationClient.ExecuteChangeSetAsync(executeChangeSetRequest);
@@ -436,7 +436,7 @@ private async Task<Stack> WaitStackToCompleteAsync(string stackName, DateTime mi
436436
for (int i = events.Count - 1; i >= 0; i--)
437437
{
438438
string line =
439-
events[i].Timestamp.GetValueOrDefault().ToString("g").PadRight(TIMESTAMP_WIDTH) + " " +
439+
events[i].Timestamp.GetValueOrDefault().ToLocalTime().ToString("g").PadRight(TIMESTAMP_WIDTH) + " " +
440440
events[i].LogicalResourceId.PadRight(LOGICAL_RESOURCE_WIDTH) + " " +
441441
events[i].ResourceStatus.ToString().PadRight(RESOURCE_STATUS);
442442

0 commit comments

Comments
 (0)