Open
Description
Describe the feature
The L2 construct equivalent of CfnAccountPolicy
, aimed at reducing boilerplate code and simplifying configuration; it should help to prevent common pitfalls (see #31266).
Use Case
See above.
Proposed Solution
The AccountPolicy
construct should accept an input of type AccountPolicyType
, an enum with the following possible values:
LAMBDA
KINESIS_DATA_STREAM
DATA_FIREHOSE
Depending on the selected AccountPolicyType
, you’ll need to provide a different kind of target
. For example, if LAMBDA
is specified, you must provide an IFunction
. The required permissions for the target resource will be automatically attached when the AccountPolicy
is created.
Other Information
Creating an account-level subscription filter involves 4 steps:
- Create the target resource for the subscription filter (Lambda, Kinesis Data Stream, or Data Firehose).
- Grant CloudWatch Logs permission to use the target resource.
- Add a dependency in the CDK resource graph to ensure the subscription filter is not created before the permission is granted.
- Create the account-level subscription filter.
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
CDK version used
2.189.0
Environment details (OS name and version, etc.)
Ubuntu 24.04