Skip to content

(core): add suppresable info-level annotation message #34871

@hassaku63

Description

@hassaku63

Describe the feature

This feature request isolates the addInfoV2 proposal from issue #34773 and focuses solely on extending the core annotations API.

“When configuring replicationRules for an S3 bucket with a cross-account destination, the following info log is always emitted during synthesis:

For Cross-account S3 replication, ensure to set up permissions on destination bucket using method addReplicationPolicy()

That guidance is valuable the first time a user sets up cross-account replication, but it keeps appearing even after the required permissions are already in place.
To let builders acknowledge the message once and silence it thereafter, I propose introducing addInfoV2(), the Info-level counterpart to addWarningV2().

This feature request proposes add Annotations.addInfoV2() method to provide CDK developers the way to suppressable info message. This allows the CDK users to suppress the unnecessary info annotation message.

I propose adding addInfoV2() -- the Info-level counterpart to addWarningV2() -- which would let builders acknowledge an Info message once and prevent it from re-appearing in subsequent runs.

Use Case

  • Construct authors sometimes need to surface non-critical recommendations (e.g., “Consider enabling X for better performance”).
  • Today these recommendations either remain forever, or authors omit them to avoid cluttering user logs.
  • With addInfoV2() users could acknowledge a message once and keep future synth/output clean, while still surfacing important Info the first time.

Proposed Solution

add addInfoV2 method like a existing method addWarningV2

Other Information

No response

Acknowledgements

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

AWS CDK Library version (aws-cdk-lib)

2.200.1

AWS CDK CLI version

2.1017.1

Environment details (OS name and version, etc.)

MacOS 14.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/coreRelated to core CDK functionalityeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions