question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

core: add a lazy getter for `TagManager`

See original GitHub issue

Description

We would like to be able to add tags to a core.CustomResource, and have these tags be passed as one of the properties to the backing provider.

Use Case

In our particular case, we have a core.CustomResource that is inserting records into a DynamoDB table. For auditing/debugging purposes, it would be extremely helpful to be able to record the stack tags into this record.

Currently we are working around this by sub-classing core.Construct, having it implement core.ITaggable by adding a core.TagManager property named tags, and then assigning the output of tags.render_tags() to a property value via a custom core.IResolvable implementation. However, this is pretty awkward.

Proposed Solution

  1. Update the core.CustomResource constructor to take core.TagType as a parameter, defaulting to core.TagType.NOT_TAGGABLE.
  2. Create a mechanism for referencing the rendered tags within the properties, similar to custom_resources.PhysicalResourceIdReference. Alternatively, have the tags passed automatically.

Other information

No response

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rittnejecommented, Oct 30, 2021

@rix0rrr We tried with Lazy but it led to an inscrutable stack trace from jsii, so we could not use it at all.

@jamesorlakin Thanks for pointing that out. Curiously, that specific change is not mentioned in the release notes, but from the source code I can see it was added in 1.130.0 as part of #17029. @rix0rrr Can you amend the release notes?

0reactions
github-actions[bot]commented, Nov 23, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@Getter(lazy=true) - Project Lombok
Overview. You can let lombok generate a getter which will calculate a value once, the first time this getter is called, and cache...
Read more >
Keeping Websites Fast when Loading Google Tag Manager
Load GTM Fast by Lazy Loading Scripts. Regardless if you can move external scripts into the application code, you should look into claiming...
Read more >
Page view triggers - Tag Manager Help - Google Support
Use Google Tag Manager's page view triggers to fire tags when pages are loaded in web browsers. There are five trigger types that...
Read more >
Google Tag Manager vs Page Speed: Impact & How to Improve
A comprehensive reports with tests on how does Google Tag Manager impact page speed + a bunch of tips on how to improve...
Read more >
Lazy loading Tag implemented via Google Tag Manager
Because this tag is quite big I have been already delay it by adding custom event that fires 1.5 seconds after Window Loaded...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found