diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestStackWithFeatureFlag.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestStackWithFeatureFlag.assets.json new file mode 100644 index 0000000000000..edab5767ec4c1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestStackWithFeatureFlag.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "443cd498fca620868cfc5e66c6d03b3dcd2cc9d88b6eba24927a4e8d06ae7984": { + "source": { + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "443cd498fca620868cfc5e66c6d03b3dcd2cc9d88b6eba24927a4e8d06ae7984.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestStackWithFeatureFlag.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestStackWithFeatureFlag.template.json new file mode 100644 index 0000000000000..c2fe3bad39eb1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestStackWithFeatureFlag.template.json @@ -0,0 +1,355 @@ +{ + "Resources": { + "inAlarmLambdaFeatureServiceRoleA2CD21D1": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "inAlarmLambdaFeature6C78D351": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = function handler(event, _context, callback) {\n console.log(JSON.stringify(event, undefined, 2));\n return callback();\n}" + }, + "FunctionName": "inAlarmLambdaFeature", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "inAlarmLambdaFeatureServiceRoleA2CD21D1", + "Arn" + ] + }, + "Runtime": "nodejs18.x" + }, + "DependsOn": [ + "inAlarmLambdaFeatureServiceRoleA2CD21D1" + ] + }, + "Alarm7103F465": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ActionsEnabled": true, + "AlarmActions": [ + { + "Ref": "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b" + }, + { + "Ref": "alarmLambdaFeatureAliasaliasName16F91D34" + }, + { + "Fn::GetAtt": [ + "alarmLambdaFeatureD560800F", + "Arn" + ] + } + ], + "ComparisonOperator": "GreaterThanThreshold", + "Dimensions": [ + { + "Name": "FunctionName", + "Value": { + "Ref": "inAlarmLambdaFeature6C78D351" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "Errors", + "Namespace": "AWS/Lambda", + "Period": 60, + "Statistic": "Sum", + "Threshold": 1, + "TreatMissingData": "notBreaching" + } + }, + "alarmLambdaFeatureServiceRole853A864D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "alarmLambdaFeatureD560800F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = function handler(event, _context, callback) {\n console.log(JSON.stringify(event, undefined, 2));\n return callback();\n}" + }, + "FunctionName": "alarmLambdaFeature", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "alarmLambdaFeatureServiceRole853A864D", + "Arn" + ] + }, + "Runtime": "nodejs18.x" + }, + "DependsOn": [ + "alarmLambdaFeatureServiceRole853A864D" + ] + }, + "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b": { + "Type": "AWS::Lambda::Version", + "Properties": { + "FunctionName": { + "Ref": "alarmLambdaFeatureD560800F" + } + } + }, + "alarmLambdaFeatureCurrentVersionAlarmAlarmPermissionA0D80E66": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b" + }, + "Principal": "lambda.alarms.cloudwatch.amazonaws.com", + "SourceAccount": { + "Ref": "AWS::AccountId" + }, + "SourceArn": { + "Fn::GetAtt": [ + "Alarm7103F465", + "Arn" + ] + } + } + }, + "alarmLambdaFeatureCurrentVersionAlarmFeatureAlarmPermission192451B4": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b" + }, + "Principal": "lambda.alarms.cloudwatch.amazonaws.com", + "SourceAccount": { + "Ref": "AWS::AccountId" + }, + "SourceArn": { + "Fn::GetAtt": [ + "AlarmFeature9DD74C42", + "Arn" + ] + } + } + }, + "alarmLambdaFeatureAliasaliasName16F91D34": { + "Type": "AWS::Lambda::Alias", + "Properties": { + "FunctionName": { + "Ref": "alarmLambdaFeatureD560800F" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b", + "Version" + ] + }, + "Name": "aliasName" + } + }, + "alarmLambdaFeatureAliasaliasNameAlarmAlarmPermissionE344338D": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "alarmLambdaFeatureAliasaliasName16F91D34" + }, + "Principal": "lambda.alarms.cloudwatch.amazonaws.com", + "SourceAccount": { + "Ref": "AWS::AccountId" + }, + "SourceArn": { + "Fn::GetAtt": [ + "Alarm7103F465", + "Arn" + ] + } + } + }, + "alarmLambdaFeatureAliasaliasNameAlarmFeatureAlarmPermission6A0A5797": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "alarmLambdaFeatureAliasaliasName16F91D34" + }, + "Principal": "lambda.alarms.cloudwatch.amazonaws.com", + "SourceAccount": { + "Ref": "AWS::AccountId" + }, + "SourceArn": { + "Fn::GetAtt": [ + "AlarmFeature9DD74C42", + "Arn" + ] + } + } + }, + "alarmLambdaFeatureAlarmAlarmPermissionCF637A1C": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "alarmLambdaFeatureD560800F", + "Arn" + ] + }, + "Principal": "lambda.alarms.cloudwatch.amazonaws.com", + "SourceAccount": { + "Ref": "AWS::AccountId" + }, + "SourceArn": { + "Fn::GetAtt": [ + "Alarm7103F465", + "Arn" + ] + } + } + }, + "alarmLambdaFeatureAlarmFeatureAlarmPermission7032FB2D": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "alarmLambdaFeatureD560800F", + "Arn" + ] + }, + "Principal": "lambda.alarms.cloudwatch.amazonaws.com", + "SourceAccount": { + "Ref": "AWS::AccountId" + }, + "SourceArn": { + "Fn::GetAtt": [ + "AlarmFeature9DD74C42", + "Arn" + ] + } + } + }, + "AlarmFeature9DD74C42": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ActionsEnabled": true, + "AlarmActions": [ + { + "Ref": "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b" + }, + { + "Ref": "alarmLambdaFeatureAliasaliasName16F91D34" + }, + { + "Fn::GetAtt": [ + "alarmLambdaFeatureD560800F", + "Arn" + ] + } + ], + "ComparisonOperator": "GreaterThanThreshold", + "Dimensions": [ + { + "Name": "FunctionName", + "Value": { + "Ref": "inAlarmLambdaFeature6C78D351" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "Errors", + "Namespace": "AWS/Lambda", + "Period": 60, + "Statistic": "Sum", + "Threshold": 1, + "TreatMissingData": "notBreaching" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.assets.json new file mode 100644 index 0000000000000..3a2a261716167 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/integ.json index 0d675b8e2e251..3541451ac8f37 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/integ.json @@ -1,12 +1,12 @@ { "version": "36.0.0", "testCases": { - "LambdaAlarmActionIntegrationTest/DefaultTest": { + "LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest": { "stacks": [ - "LambdaAlarmActionIntegrationTestStack" + "LambdaAlarmActionIntegrationTestStackWithFeatureFlag" ], - "assertionStack": "LambdaAlarmActionIntegrationTest/DefaultTest/DeployAssert", - "assertionStackName": "LambdaAlarmActionIntegrationTestDefaultTestDeployAssertF9F882E5" + "assertionStack": "LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest/DeployAssert", + "assertionStackName": "LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/manifest.json index f7d89d600b988..ef633b1f8a767 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/manifest.json @@ -1,28 +1,28 @@ { "version": "36.0.0", "artifacts": { - "LambdaAlarmActionIntegrationTestStack.assets": { + "LambdaAlarmActionIntegrationTestStackWithFeatureFlag.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "LambdaAlarmActionIntegrationTestStack.assets.json", + "file": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "LambdaAlarmActionIntegrationTestStack": { + "LambdaAlarmActionIntegrationTestStackWithFeatureFlag": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "LambdaAlarmActionIntegrationTestStack.template.json", + "templateFile": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4e1c8f560b3bd32ad0758c6b7d04153c21111750f33dcfff05c52796bc71f9de.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/443cd498fca620868cfc5e66c6d03b3dcd2cc9d88b6eba24927a4e8d06ae7984.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "LambdaAlarmActionIntegrationTestStack.assets" + "LambdaAlarmActionIntegrationTestStackWithFeatureFlag.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -31,130 +31,127 @@ } }, "dependencies": [ - "LambdaAlarmActionIntegrationTestStack.assets" + "LambdaAlarmActionIntegrationTestStackWithFeatureFlag.assets" ], "metadata": { - "/LambdaAlarmActionIntegrationTestStack/inAlarmLambda/ServiceRole/Resource": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/inAlarmLambdaFeature/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "inAlarmLambdaServiceRole970DE64C" + "data": "inAlarmLambdaFeatureServiceRoleA2CD21D1" } ], - "/LambdaAlarmActionIntegrationTestStack/inAlarmLambda/Resource": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/inAlarmLambdaFeature/Resource": [ { "type": "aws:cdk:logicalId", - "data": "inAlarmLambda0920D101" + "data": "inAlarmLambdaFeature6C78D351" } ], - "/LambdaAlarmActionIntegrationTestStack/Alarm/Resource": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/Alarm/Resource": [ { "type": "aws:cdk:logicalId", "data": "Alarm7103F465" } ], - "/LambdaAlarmActionIntegrationTestStack/alarmLambda": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature": [ { "type": "aws:cdk:warning", "data": "AWS Lambda has changed their authorization strategy, which may cause client invocations using the 'Qualifier' parameter of the lambda function to fail with Access Denied errors.\nIf you are using a lambda Version or Alias, make sure to call 'grantInvoke' or 'addPermission' on the Version or Alias, not the underlying Function\nSee: https://github.com/aws/aws-cdk/issues/19273 [ack: @aws-cdk/aws-lambda:addPermissionsToVersionOrAlias]" } ], - "/LambdaAlarmActionIntegrationTestStack/alarmLambda/ServiceRole/Resource": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", - "data": "alarmLambdaServiceRoleCDAABB9D" + "data": "alarmLambdaFeatureServiceRole853A864D" } ], - "/LambdaAlarmActionIntegrationTestStack/alarmLambda/Resource": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/Resource": [ { "type": "aws:cdk:logicalId", - "data": "alarmLambda131DB691" + "data": "alarmLambdaFeatureD560800F" } ], - "/LambdaAlarmActionIntegrationTestStack/alarmLambda/CurrentVersion/Resource": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/CurrentVersion/Resource": [ { "type": "aws:cdk:logicalId", - "data": "alarmLambdaCurrentVersionBDCE825C61967a018dfe55c69152d31b6e7ab40b" + "data": "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b" } ], - "/LambdaAlarmActionIntegrationTestStack/alarmLambda/CurrentVersion/AlarmPermission": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/CurrentVersion/AlarmAlarmPermission": [ { "type": "aws:cdk:logicalId", - "data": "alarmLambdaCurrentVersionAlarmPermissionFEBD056F" + "data": "alarmLambdaFeatureCurrentVersionAlarmAlarmPermissionA0D80E66" } ], - "/LambdaAlarmActionIntegrationTestStack/alarmLambda/AliasaliasName/Resource": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/CurrentVersion/AlarmFeatureAlarmPermission": [ { "type": "aws:cdk:logicalId", - "data": "alarmLambdaAliasaliasName41B27313" + "data": "alarmLambdaFeatureCurrentVersionAlarmFeatureAlarmPermission192451B4" } ], - "/LambdaAlarmActionIntegrationTestStack/alarmLambda/AliasaliasName/AlarmPermission": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AliasaliasName/Resource": [ { "type": "aws:cdk:logicalId", - "data": "alarmLambdaAliasaliasNameAlarmPermission64A91652" + "data": "alarmLambdaFeatureAliasaliasName16F91D34" } ], - "/LambdaAlarmActionIntegrationTestStack/alarmLambda/AlarmPermission": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AliasaliasName/AlarmAlarmPermission": [ { "type": "aws:cdk:logicalId", - "data": "alarmLambdaAlarmPermission43E41C89" + "data": "alarmLambdaFeatureAliasaliasNameAlarmAlarmPermissionE344338D" } ], - "/LambdaAlarmActionIntegrationTestStack/BootstrapVersion": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AliasaliasName/AlarmFeatureAlarmPermission": [ { "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" + "data": "alarmLambdaFeatureAliasaliasNameAlarmFeatureAlarmPermission6A0A5797" } ], - "/LambdaAlarmActionIntegrationTestStack/CheckBootstrapVersion": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AlarmAlarmPermission": [ { "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" + "data": "alarmLambdaFeatureAlarmAlarmPermissionCF637A1C" + } + ], + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AlarmFeatureAlarmPermission": [ + { + "type": "aws:cdk:logicalId", + "data": "alarmLambdaFeatureAlarmFeatureAlarmPermission7032FB2D" } ], - "AlarmCurrentVersionAlarmPermission22DB4772": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/AlarmFeature/Resource": [ { "type": "aws:cdk:logicalId", - "data": "AlarmCurrentVersionAlarmPermission22DB4772", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "AlarmFeature9DD74C42" } ], - "AlarmAliasaliasNameAlarmPermission3887D390": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/BootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "AlarmAliasaliasNameAlarmPermission3887D390", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "BootstrapVersion" } ], - "AlarmalarmLambdaAlarmPermission5CAF3DE7": [ + "/LambdaAlarmActionIntegrationTestStackWithFeatureFlag/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "AlarmalarmLambdaAlarmPermission5CAF3DE7", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "CheckBootstrapVersion" } ] }, - "displayName": "LambdaAlarmActionIntegrationTestStack" + "displayName": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag" }, - "LambdaAlarmActionIntegrationTestDefaultTestDeployAssertF9F882E5.assets": { + "LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "LambdaAlarmActionIntegrationTestDefaultTestDeployAssertF9F882E5.assets.json", + "file": "LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "LambdaAlarmActionIntegrationTestDefaultTestDeployAssertF9F882E5": { + "LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "LambdaAlarmActionIntegrationTestDefaultTestDeployAssertF9F882E5.template.json", + "templateFile": "LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -163,7 +160,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "LambdaAlarmActionIntegrationTestDefaultTestDeployAssertF9F882E5.assets" + "LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -172,23 +169,23 @@ } }, "dependencies": [ - "LambdaAlarmActionIntegrationTestDefaultTestDeployAssertF9F882E5.assets" + "LambdaAlarmActionIntegrationTestWithFeatureFlagDefaultTestDeployAssertB72D1A4A.assets" ], "metadata": { - "/LambdaAlarmActionIntegrationTest/DefaultTest/DeployAssert/BootstrapVersion": [ + "/LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/LambdaAlarmActionIntegrationTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "LambdaAlarmActionIntegrationTest/DefaultTest/DeployAssert" + "displayName": "LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/tree.json index 622364ad86c22..bdbfec8ea97a8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.js.snapshot/tree.json @@ -4,29 +4,29 @@ "id": "App", "path": "", "children": { - "LambdaAlarmActionIntegrationTestStack": { - "id": "LambdaAlarmActionIntegrationTestStack", - "path": "LambdaAlarmActionIntegrationTestStack", + "LambdaAlarmActionIntegrationTestStackWithFeatureFlag": { + "id": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag", "children": { - "inAlarmLambda": { - "id": "inAlarmLambda", - "path": "LambdaAlarmActionIntegrationTestStack/inAlarmLambda", + "inAlarmLambdaFeature": { + "id": "inAlarmLambdaFeature", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/inAlarmLambdaFeature", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "LambdaAlarmActionIntegrationTestStack/inAlarmLambda/ServiceRole", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/inAlarmLambdaFeature/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "LambdaAlarmActionIntegrationTestStack/inAlarmLambda/ServiceRole/ImportServiceRole", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/inAlarmLambdaFeature/ServiceRole/ImportServiceRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "LambdaAlarmActionIntegrationTestStack/inAlarmLambda/ServiceRole/Resource", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/inAlarmLambdaFeature/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -59,30 +59,30 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "LambdaAlarmActionIntegrationTestStack/inAlarmLambda/Resource", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/inAlarmLambdaFeature/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { "code": { "zipFile": "exports.handler = function handler(event, _context, callback) {\n console.log(JSON.stringify(event, undefined, 2));\n return callback();\n}" }, - "functionName": "inAlarmLambda", + "functionName": "inAlarmLambdaFeature", "handler": "index.handler", "role": { "Fn::GetAtt": [ - "inAlarmLambdaServiceRole970DE64C", + "inAlarmLambdaFeatureServiceRoleA2CD21D1", "Arn" ] }, @@ -90,37 +90,37 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Alarm": { "id": "Alarm", - "path": "LambdaAlarmActionIntegrationTestStack/Alarm", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/Alarm", "children": { "Resource": { "id": "Resource", - "path": "LambdaAlarmActionIntegrationTestStack/Alarm/Resource", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/Alarm/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", "aws:cdk:cloudformation:props": { "actionsEnabled": true, "alarmActions": [ { - "Ref": "alarmLambdaCurrentVersionBDCE825C61967a018dfe55c69152d31b6e7ab40b" + "Ref": "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b" }, { - "Ref": "alarmLambdaAliasaliasName41B27313" + "Ref": "alarmLambdaFeatureAliasaliasName16F91D34" }, { "Fn::GetAtt": [ - "alarmLambda131DB691", + "alarmLambdaFeatureD560800F", "Arn" ] } @@ -130,7 +130,7 @@ { "name": "FunctionName", "value": { - "Ref": "inAlarmLambda0920D101" + "Ref": "inAlarmLambdaFeature6C78D351" } } ], @@ -144,35 +144,35 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "alarmLambda": { - "id": "alarmLambda", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda", + "alarmLambdaFeature": { + "id": "alarmLambdaFeature", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/ServiceRole", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/ServiceRole/ImportServiceRole", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/ServiceRole/ImportServiceRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/ServiceRole/Resource", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -205,30 +205,30 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { "id": "Resource", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/Resource", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { "code": { "zipFile": "exports.handler = function handler(event, _context, callback) {\n console.log(JSON.stringify(event, undefined, 2));\n return callback();\n}" }, - "functionName": "alarmLambda", + "functionName": "alarmLambdaFeature", "handler": "index.handler", "role": { "Fn::GetAtt": [ - "alarmLambdaServiceRoleCDAABB9D", + "alarmLambdaFeatureServiceRole853A864D", "Arn" ] }, @@ -236,39 +236,39 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "CurrentVersion": { "id": "CurrentVersion", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/CurrentVersion", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/CurrentVersion", "children": { "Resource": { "id": "Resource", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/CurrentVersion/Resource", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/CurrentVersion/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Version", "aws:cdk:cloudformation:props": { "functionName": { - "Ref": "alarmLambda131DB691" + "Ref": "alarmLambdaFeatureD560800F" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnVersion", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "AlarmPermission": { - "id": "AlarmPermission", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/CurrentVersion/AlarmPermission", + "AlarmAlarmPermission": { + "id": "AlarmAlarmPermission", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/CurrentVersion/AlarmAlarmPermission", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", "aws:cdk:cloudformation:props": { "action": "lambda:InvokeFunction", "functionName": { - "Ref": "alarmLambdaCurrentVersionBDCE825C61967a018dfe55c69152d31b6e7ab40b" + "Ref": "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b" }, "principal": "lambda.alarms.cloudwatch.amazonaws.com", "sourceAccount": { @@ -283,32 +283,59 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "AlarmFeatureAlarmPermission": { + "id": "AlarmFeatureAlarmPermission", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/CurrentVersion/AlarmFeatureAlarmPermission", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Ref": "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b" + }, + "principal": "lambda.alarms.cloudwatch.amazonaws.com", + "sourceAccount": { + "Ref": "AWS::AccountId" + }, + "sourceArn": { + "Fn::GetAtt": [ + "AlarmFeature9DD74C42", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Version", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "AliasaliasName": { "id": "AliasaliasName", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/AliasaliasName", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AliasaliasName", "children": { "Resource": { "id": "Resource", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/AliasaliasName/Resource", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AliasaliasName/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Alias", "aws:cdk:cloudformation:props": { "functionName": { - "Ref": "alarmLambda131DB691" + "Ref": "alarmLambdaFeatureD560800F" }, "functionVersion": { "Fn::GetAtt": [ - "alarmLambdaCurrentVersionBDCE825C61967a018dfe55c69152d31b6e7ab40b", + "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b", "Version" ] }, @@ -316,27 +343,27 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnAlias", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ScalingRole": { "id": "ScalingRole", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/AliasaliasName/ScalingRole", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AliasaliasName/ScalingRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "AlarmPermission": { - "id": "AlarmPermission", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/AliasaliasName/AlarmPermission", + "AlarmAlarmPermission": { + "id": "AlarmAlarmPermission", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AliasaliasName/AlarmAlarmPermission", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", "aws:cdk:cloudformation:props": { "action": "lambda:InvokeFunction", "functionName": { - "Ref": "alarmLambdaAliasaliasName41B27313" + "Ref": "alarmLambdaFeatureAliasaliasName16F91D34" }, "principal": "lambda.alarms.cloudwatch.amazonaws.com", "sourceAccount": { @@ -351,26 +378,53 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "AlarmFeatureAlarmPermission": { + "id": "AlarmFeatureAlarmPermission", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AliasaliasName/AlarmFeatureAlarmPermission", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Ref": "alarmLambdaFeatureAliasaliasName16F91D34" + }, + "principal": "lambda.alarms.cloudwatch.amazonaws.com", + "sourceAccount": { + "Ref": "AWS::AccountId" + }, + "sourceArn": { + "Fn::GetAtt": [ + "AlarmFeature9DD74C42", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Alias", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "AlarmPermission": { - "id": "AlarmPermission", - "path": "LambdaAlarmActionIntegrationTestStack/alarmLambda/AlarmPermission", + "AlarmAlarmPermission": { + "id": "AlarmAlarmPermission", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AlarmAlarmPermission", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", "aws:cdk:cloudformation:props": { "action": "lambda:InvokeFunction", "functionName": { "Fn::GetAtt": [ - "alarmLambda131DB691", + "alarmLambdaFeatureD560800F", "Arn" ] }, @@ -387,49 +441,133 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "AlarmFeatureAlarmPermission": { + "id": "AlarmFeatureAlarmPermission", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/alarmLambdaFeature/AlarmFeatureAlarmPermission", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "alarmLambdaFeatureD560800F", + "Arn" + ] + }, + "principal": "lambda.alarms.cloudwatch.amazonaws.com", + "sourceAccount": { + "Ref": "AWS::AccountId" + }, + "sourceArn": { + "Fn::GetAtt": [ + "AlarmFeature9DD74C42", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "AlarmFeature": { + "id": "AlarmFeature", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/AlarmFeature", + "children": { + "Resource": { + "id": "Resource", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/AlarmFeature/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "actionsEnabled": true, + "alarmActions": [ + { + "Ref": "alarmLambdaFeatureCurrentVersionCF39751979501d2f67eaf906b2ef0c378303873b" + }, + { + "Ref": "alarmLambdaFeatureAliasaliasName16F91D34" + }, + { + "Fn::GetAtt": [ + "alarmLambdaFeatureD560800F", + "Arn" + ] + } + ], + "comparisonOperator": "GreaterThanThreshold", + "dimensions": [ + { + "name": "FunctionName", + "value": { + "Ref": "inAlarmLambdaFeature6C78D351" + } + } + ], + "evaluationPeriods": 1, + "metricName": "Errors", + "namespace": "AWS/Lambda", + "period": 60, + "statistic": "Sum", + "threshold": 1, + "treatMissingData": "notBreaching" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "LambdaAlarmActionIntegrationTestStack/BootstrapVersion", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "LambdaAlarmActionIntegrationTestStack/CheckBootstrapVersion", + "path": "LambdaAlarmActionIntegrationTestStackWithFeatureFlag/CheckBootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, - "LambdaAlarmActionIntegrationTest": { - "id": "LambdaAlarmActionIntegrationTest", - "path": "LambdaAlarmActionIntegrationTest", + "LambdaAlarmActionIntegrationTestWithFeatureFlag": { + "id": "LambdaAlarmActionIntegrationTestWithFeatureFlag", + "path": "LambdaAlarmActionIntegrationTestWithFeatureFlag", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "LambdaAlarmActionIntegrationTest/DefaultTest", + "path": "LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest", "children": { "Default": { "id": "Default", - "path": "LambdaAlarmActionIntegrationTest/DefaultTest/Default", + "path": "LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", "version": "10.3.0" @@ -437,28 +575,28 @@ }, "DeployAssert": { "id": "DeployAssert", - "path": "LambdaAlarmActionIntegrationTest/DefaultTest/DeployAssert", + "path": "LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "LambdaAlarmActionIntegrationTest/DefaultTest/DeployAssert/BootstrapVersion", + "path": "LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "LambdaAlarmActionIntegrationTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "LambdaAlarmActionIntegrationTestWithFeatureFlag/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, @@ -483,8 +621,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.ts index 25fa92a34464d..48e806f6f191b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.ts @@ -1,16 +1,21 @@ -import { App, Stack, StackProps, Duration } from 'aws-cdk-lib'; +import { App, Stack, StackProps, Duration, FeatureFlags } from 'aws-cdk-lib'; import * as integ from '@aws-cdk/integ-tests-alpha'; import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch'; import * as lambda from 'aws-cdk-lib/aws-lambda'; import { STANDARD_NODEJS_RUNTIME } from '../../config'; import * as cloudwatchActions from 'aws-cdk-lib/aws-cloudwatch-actions'; +import { LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION } from 'aws-cdk-lib/cx-api'; class LambdaAlarmActionIntegrationTestStack extends Stack { constructor(scope: App, id: string, props?: StackProps) { super(scope, id, props); - const inAlarmLambda = new lambda.Function(this, 'inAlarmLambda', { - functionName: 'inAlarmLambda', + + const isFeature = FeatureFlags.of(this).isEnabled(LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION); + const lambdaIdSuffix = isFeature ? 'Feature' : ''; + + const inAlarmLambda = new lambda.Function(this, `inAlarmLambda${lambdaIdSuffix}`, { + functionName: `inAlarmLambda${lambdaIdSuffix}`, runtime: STANDARD_NODEJS_RUNTIME, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), @@ -24,8 +29,8 @@ class LambdaAlarmActionIntegrationTestStack extends Stack { treatMissingData: cloudwatch.TreatMissingData.NOT_BREACHING, }); - const alarmLambda = new lambda.Function(this, 'alarmLambda', { - functionName: 'alarmLambda', + const alarmLambda = new lambda.Function(this, `alarmLambda${lambdaIdSuffix}`, { + functionName: `alarmLambda${lambdaIdSuffix}`, runtime: STANDARD_NODEJS_RUNTIME, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), @@ -35,19 +40,39 @@ class LambdaAlarmActionIntegrationTestStack extends Stack { alarm.addAlarmAction(new cloudwatchActions.LambdaAction(version)); alarm.addAlarmAction(new cloudwatchActions.LambdaAction(aliasName)); alarm.addAlarmAction(new cloudwatchActions.LambdaAction(alarmLambda)); + + if (isFeature) { + const alarm2 = new cloudwatch.Alarm(this, `Alarm${lambdaIdSuffix}`, { + comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, + threshold: 1, + evaluationPeriods: 1, + metric: inAlarmLambda.metricErrors({ period: Duration.minutes(1) }), + actionsEnabled: true, + treatMissingData: cloudwatch.TreatMissingData.NOT_BREACHING, + }); + alarm2.addAlarmAction(new cloudwatchActions.LambdaAction(version)); + alarm2.addAlarmAction(new cloudwatchActions.LambdaAction(aliasName)); + alarm2.addAlarmAction(new cloudwatchActions.LambdaAction(alarmLambda)); + } } } const app = new App(); - const stack = new LambdaAlarmActionIntegrationTestStack(app, 'LambdaAlarmActionIntegrationTestStack'); - new integ.IntegTest(app, 'LambdaAlarmActionIntegrationTest', { testCases: [stack], }); - app.synth(); +const appWithFeatureFlag = new App({ + context: { [LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION]: true }, +}); +const stackWithFeatureFlag = new LambdaAlarmActionIntegrationTestStack(appWithFeatureFlag, 'LambdaAlarmActionIntegrationTestStackWithFeatureFlag'); +new integ.IntegTest(appWithFeatureFlag, 'LambdaAlarmActionIntegrationTestWithFeatureFlag', { + testCases: [stackWithFeatureFlag], +}); +appWithFeatureFlag.synth(); + /* eslint-disable no-console */ function handler(event: any, _context: any, callback: any) { console.log(JSON.stringify(event, undefined, 2)); diff --git a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md index 95817e6176cb4..6ba99522b8f73 100644 --- a/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md +++ b/packages/@aws-cdk/cx-api/FEATURE_FLAGS.md @@ -63,6 +63,7 @@ Flags come in three types: | [@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters](#aws-cdkaws-rdsauroraclusterchangescopeofinstanceparametergroupwitheachparameters) | When enabled, a scope of InstanceParameterGroup for AuroraClusterInstance with each parameters will change. | 2.97.0 | (fix) | | [@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials](#aws-cdkaws-rdspreventrenderingdeprecatedcredentials) | When enabled, creating an RDS database cluster from a snapshot will only render credentials for snapshot credentials. | 2.98.0 | (fix) | | [@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource](#aws-cdkaws-codepipeline-actionsusenewdefaultbranchforcodecommitsource) | When enabled, the CodeCommit source action is using the default branch name 'main'. | 2.103.1 | (fix) | +| [@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction](#aws-cdkaws-cloudwatch-actionschangelambdapermissionlogicalidforlambdaaction) | When enabled, the logical ID of a Lambda permission for a Lambda action includes an alarm ID. | V2NEXT | (fix) | @@ -116,7 +117,8 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true, "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true, "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true, - "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true + "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true, + "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true } } ``` @@ -1193,4 +1195,22 @@ However, with the activation of this feature flag, the default branch is updated | 2.103.1 | `false` | `true` | +### @aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction + +*When enabled, the logical ID of a Lambda permission for a Lambda action includes an alarm ID.* (fix) + +When this feature flag is enabled, a logical ID of `LambdaPermission` for a +`LambdaAction` will include an alarm ID. Therefore multiple alarms for the same Lambda +can be created with `LambdaAction`. + +If the flag is set to false then it can only make one alarm for the Lambda with +`LambdaAction`. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| V2NEXT | `false` | `true` | + + diff --git a/packages/aws-cdk-lib/aws-cloudwatch-actions/lib/lambda.ts b/packages/aws-cdk-lib/aws-cloudwatch-actions/lib/lambda.ts index f754b60b3f1a5..13312dc51caa9 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch-actions/lib/lambda.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch-actions/lib/lambda.ts @@ -2,7 +2,8 @@ import { Construct } from 'constructs'; import * as cloudwatch from '../../aws-cloudwatch'; import * as iam from '../../aws-iam'; import * as lambda from '../../aws-lambda'; -import { Stack } from '../../core'; +import { FeatureFlags, Stack } from '../../core'; +import { LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION } from '../../cx-api'; /** * Use a Lambda action as an Alarm action @@ -20,11 +21,12 @@ export class LambdaAction implements cloudwatch.IAlarmAction { * * @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html */ - bind(_scope: Construct, _alarm: cloudwatch.IAlarm): cloudwatch.AlarmActionConfig { - this.lambdaFunction.addPermission('AlarmPermission', { - sourceAccount: Stack.of(_scope).account, + bind(scope: Construct, alarm: cloudwatch.IAlarm): cloudwatch.AlarmActionConfig { + const idPrefix = FeatureFlags.of(scope).isEnabled(LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION) ? alarm.node.id : ''; + this.lambdaFunction.addPermission(`${idPrefix}AlarmPermission`, { + sourceAccount: Stack.of(scope).account, action: 'lambda:InvokeFunction', - sourceArn: _alarm.alarmArn, + sourceArn: alarm.alarmArn, principal: new iam.ServicePrincipal('lambda.alarms.cloudwatch.amazonaws.com'), }); diff --git a/packages/aws-cdk-lib/aws-cloudwatch-actions/test/lambda.test.ts b/packages/aws-cdk-lib/aws-cloudwatch-actions/test/lambda.test.ts index 03e71b40b0cbb..027dfcd3f17f6 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch-actions/test/lambda.test.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch-actions/test/lambda.test.ts @@ -2,6 +2,7 @@ import { Template } from '../../assertions'; import * as cloudwatch from '../../aws-cloudwatch'; import * as lambda from '../../aws-lambda'; import { Stack } from '../../core'; +import { LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION } from '../../cx-api'; import * as actions from '../lib/index'; test('can use lambda as alarm action', () => { @@ -111,3 +112,70 @@ def handler(event, context): }); }); +test('can create multiple alarms for the same lambda if feature flag is set', () => { + // GIVEN + const stack = new Stack(); + stack.node.setContext(LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION, true); + const alarm1 = new cloudwatch.Alarm(stack, 'Alarm1', { + metric: new cloudwatch.Metric({ namespace: 'AWS', metricName: 'Test' }), + evaluationPeriods: 3, + threshold: 100, + }); + const alarm2 = new cloudwatch.Alarm(stack, 'Alarm2', { + metric: new cloudwatch.Metric({ namespace: 'AWS', metricName: 'Test2' }), + evaluationPeriods: 3, + threshold: 100, + }); + + // WHEN + const alarmLambda = new lambda.Function(stack, 'alarmLambda', { + runtime: lambda.Runtime.PYTHON_3_12, + functionName: 'alarmLambda', + code: lambda.Code.fromInline(` +def handler(event, context): + print('event:', event) + print('.............................................') + print('context:', context)`), + handler: 'index.handler', + }); + alarm1.addAlarmAction(new actions.LambdaAction(alarmLambda)); + alarm2.addAlarmAction(new actions.LambdaAction(alarmLambda)); + + // THEN + Template.fromStack(stack).resourceCountIs('AWS::CloudWatch::Alarm', 2); + Template.fromStack(stack).resourceCountIs('AWS::Lambda::Permission', 2); +}); + +test('throws when multiple alarms are created for the same lambda if feature flag is set to false', () => { + // GIVEN + const stack = new Stack(); + stack.node.setContext(LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION, false); // Default, but explicit just in case. + const alarm1 = new cloudwatch.Alarm(stack, 'Alarm1', { + metric: new cloudwatch.Metric({ namespace: 'AWS', metricName: 'Test' }), + evaluationPeriods: 3, + threshold: 100, + }); + const alarm2 = new cloudwatch.Alarm(stack, 'Alarm2', { + metric: new cloudwatch.Metric({ namespace: 'AWS', metricName: 'Test2' }), + evaluationPeriods: 3, + threshold: 100, + }); + + // WHEN + const alarmLambda = new lambda.Function(stack, 'alarmLambda', { + runtime: lambda.Runtime.PYTHON_3_12, + functionName: 'alarmLambda', + code: lambda.Code.fromInline(` +def handler(event, context): + print('event:', event) + print('.............................................') + print('context:', context)`), + handler: 'index.handler', + }); + alarm1.addAlarmAction(new actions.LambdaAction(alarmLambda)); + + // THEN + expect(() => { + alarm2.addAlarmAction(new actions.LambdaAction(alarmLambda)); + }).toThrow(/There is already a Construct with name 'AlarmPermission' in Function \[alarmLambda\]/); +}); \ No newline at end of file diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index 95817e6176cb4..6ba99522b8f73 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -63,6 +63,7 @@ Flags come in three types: | [@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters](#aws-cdkaws-rdsauroraclusterchangescopeofinstanceparametergroupwitheachparameters) | When enabled, a scope of InstanceParameterGroup for AuroraClusterInstance with each parameters will change. | 2.97.0 | (fix) | | [@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials](#aws-cdkaws-rdspreventrenderingdeprecatedcredentials) | When enabled, creating an RDS database cluster from a snapshot will only render credentials for snapshot credentials. | 2.98.0 | (fix) | | [@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource](#aws-cdkaws-codepipeline-actionsusenewdefaultbranchforcodecommitsource) | When enabled, the CodeCommit source action is using the default branch name 'main'. | 2.103.1 | (fix) | +| [@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction](#aws-cdkaws-cloudwatch-actionschangelambdapermissionlogicalidforlambdaaction) | When enabled, the logical ID of a Lambda permission for a Lambda action includes an alarm ID. | V2NEXT | (fix) | @@ -116,7 +117,8 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true, "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true, "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true, - "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true + "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true, + "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true } } ``` @@ -1193,4 +1195,22 @@ However, with the activation of this feature flag, the default branch is updated | 2.103.1 | `false` | `true` | +### @aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction + +*When enabled, the logical ID of a Lambda permission for a Lambda action includes an alarm ID.* (fix) + +When this feature flag is enabled, a logical ID of `LambdaPermission` for a +`LambdaAction` will include an alarm ID. Therefore multiple alarms for the same Lambda +can be created with `LambdaAction`. + +If the flag is set to false then it can only make one alarm for the Lambda with +`LambdaAction`. + + +| Since | Default | Recommended | +| ----- | ----- | ----- | +| (not in v1) | | | +| V2NEXT | `false` | `true` | + + diff --git a/packages/aws-cdk-lib/cx-api/README.md b/packages/aws-cdk-lib/cx-api/README.md index f25b78a5e6a26..82cf2e1596eeb 100644 --- a/packages/aws-cdk-lib/cx-api/README.md +++ b/packages/aws-cdk-lib/cx-api/README.md @@ -241,3 +241,20 @@ _cdk.json_ } } ``` + +* `@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction` + +Enable this feature flag to change the logical ID of the `LambdaPermission` for the `LambdaAction` to include an alarm ID. + +Previously, only one alarm with the `LambdaAction` could be created per Lambda. +This flag allows multiple alarms with the `LambdaAction` for the same Lambda to be created. + +_cdk.json_ + +```json +{ + "context": { + "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true + } +} +``` diff --git a/packages/aws-cdk-lib/cx-api/lib/features.ts b/packages/aws-cdk-lib/cx-api/lib/features.ts index b164badc1f9ba..e3e5ba30b552a 100644 --- a/packages/aws-cdk-lib/cx-api/lib/features.ts +++ b/packages/aws-cdk-lib/cx-api/lib/features.ts @@ -97,6 +97,7 @@ export const RDS_PREVENT_RENDERING_DEPRECATED_CREDENTIALS = '@aws-cdk/aws-rds:pr export const AURORA_CLUSTER_CHANGE_SCOPE_OF_INSTANCE_PARAMETER_GROUP_WITH_EACH_PARAMETERS = '@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters'; export const APPSYNC_ENABLE_USE_ARN_IDENTIFIER_SOURCE_API_ASSOCIATION = '@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier'; export const CODECOMMIT_SOURCE_ACTION_DEFAULT_BRANCH_NAME = '@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource'; +export const LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION = '@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction'; export const FLAGS: Record = { ////////////////////////////////////////////////////////////////////// @@ -976,6 +977,22 @@ export const FLAGS: Record = { introducedIn: { v2: '2.103.1' }, recommendedValue: true, }, + + ////////////////////////////////////////////////////////////////////// + [LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION]: { + type: FlagType.BugFix, + summary: 'When enabled, the logical ID of a Lambda permission for a Lambda action includes an alarm ID.', + detailsMd: ` + When this feature flag is enabled, a logical ID of \`LambdaPermission\` for a + \`LambdaAction\` will include an alarm ID. Therefore multiple alarms for the same Lambda + can be created with \`LambdaAction\`. + + If the flag is set to false then it can only make one alarm for the Lambda with + \`LambdaAction\`. + `, + introducedIn: { v2: 'V2NEXT' }, + recommendedValue: true, + }, }; const CURRENT_MV = 'v2';