Problem/Motivation

  • When editing the AWS Launch Template, it uses the `created` date of the original entity. This causes the revision page to show one `created` date for all version of the launch template.

Issue fork cloud-3312708

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

baldwinlouie created an issue. See original summary.

baldwinlouie’s picture

Status: Active » Needs review

@yas and @kumiko-ono

Here is the patch that fixes the revision timestamp for AWS cloud launch templates. During editing, it was not using an updated timestamp to set the `created` date.

Do keep in mind that there could be a slight difference between the `created` date on Drupal vs AWS. That is because the launch template is saved to AWS first, and then saved locally. However, all that doesn't really matter because once Cron runs and the launch templates are updated, the `created` date for the template and the revisions will reflect what is stored in AWS.

yas’s picture

@baldwinlouie

Thank you for fixing the issue. The patch looks good.; and your explanation makes sense to me.

@kumikoono

What do you think?

Thanks

kumikoono’s picture

Why don't you update the timestamp immediately after creating the launch template at C.O.?
How about the other resources?

baldwinlouie’s picture

@kumikoono Thanks for the suggestion. I updated the patch so it takes the `created` timestamp and updates the local Drupal Launch Template entity.

For the other resources, the timestamp is not shown or used (For example, Snapshots do not have a created timestamp). The local entity is saved with the Drupal timestamp, and then the AWS resource is saved.

In the case of AWS Launch Templates, we use revisions, so the create date is surfaced and shown.

baldwinlouie’s picture

@yas fixing unit tests.

kumikoono’s picture

@baldwin Thanks for your update and explanation.
Regarding AWS resources, key pairs and volumes have the created timestamps. They looks correctly set.

baldwinlouie’s picture

@yas and @kumikoono, please review the patch again. I've updated it to use the timestamp coming from the API results.

kumikoono’s picture

Status: Needs review » Reviewed & tested by the community

@baldwin Thanks for providing this patch. This looks good to me.

yas’s picture

Issue summary: View changes

@kumikoono

Thank you for your review.

@baldwinlouie

Thank you for the update. I'll merge the patch to 4.x and 5.x, and close this issue as Fixed.

  • yas committed 2b936c4 on 5.x authored by baldwinlouie
    Issue #3312708 by baldwinlouie, yas, kumikoono: Update created date when...

  • yas committed cc70e0c on 4.x
    Issue #3312708 by baldwinlouie, yas, kumikoono: Update created date when...
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.