-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
DataDog/serverless-sample-app
#499Closed
Copy link
Labels
@aws-cdk/aws-logsRelated to Amazon CloudWatch LogsRelated to Amazon CloudWatch LogsbugThis issue is a bug.This issue is a bug.closed-for-stalenessThis issue was automatically closed because it hadn't received any attention in a while.This issue was automatically closed because it hadn't received any attention in a while.p1potential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team memberresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Description
Describe the bug
Since upgrading to CDK v2.215.0 encrypting of log.LogGroup stopped working when using kms.Alias as encyption_key. When I use kms.Key instead, it works as intended.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
2.214.0
Expected Behavior
Since no change is mentioned in the change logs, I would expected that log.LogGroup can be encrypted using kms.Alias as in v2.214.0.
Current Behavior
Running cdk synth results in the following error:
RuntimeError: Cannot access aliasTargetKey on an Alias imported by Alias.fromAliasName().
Reproduction Steps
Here is a minimal working example:
from aws_cdk import Stack
from aws_cdk import aws_kms as kms
from aws_cdk import aws_logs as logs
from constructs import Construct
class CdkTestStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
alias = kms.Alias.from_alias_name(
self,
"KmsAlias",
alias_name="alias/some-alias",
)
logs.LogGroup(
self,
"LogGroup",
encryption_key=alias,
)and then run cdk synth.
Possible Solution
No response
Additional Information/Context
No response
AWS CDK Library version (aws-cdk-lib)
2.215.0
AWS CDK CLI version
2.1029.2
Node.js Version
v22.14.0
OS
macOS 26
Language
Python
Language Version
3.13
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-logsRelated to Amazon CloudWatch LogsRelated to Amazon CloudWatch LogsbugThis issue is a bug.This issue is a bug.closed-for-stalenessThis issue was automatically closed because it hadn't received any attention in a while.This issue was automatically closed because it hadn't received any attention in a while.p1potential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team memberresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.