// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Snapshot 1`] = ` { "Parameters": { "BootstrapVersion": { "Default": "/cdk-bootstrap/hnb659fds/version", "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]", "Type": "AWS::SSM::Parameter::Value", }, }, "Resources": { "BucketNotificationsHandler050a0587b7544547bf325f094a3db8347ECC3691": { "DependsOn": [ "BucketNotificationsHandler050a0587b7544547bf325f094a3db834RoleDefaultPolicy2CF63D36", "BucketNotificationsHandler050a0587b7544547bf325f094a3db834RoleB6FB88EC", ], "Properties": { "Code": { "ZipFile": "import boto3 # type: ignore import json import logging import urllib.request s3 = boto3.client("s3") EVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration' CONFIGURATION_TYPES = ["TopicConfigurations", "QueueConfigurations", "LambdaFunctionConfigurations"] def handler(event: dict, context): response_status = "SUCCESS" error_message = "" try: props = event["ResourceProperties"] bucket = props["BucketName"] notification_configuration = props["NotificationConfiguration"] request_type = event["RequestType"] managed = props.get('Managed', 'true').lower() == 'true' stack_id = event['StackId'] if managed: config = handle_managed(request_type, notification_configuration) else: config = handle_unmanaged(bucket, stack_id, request_type, notification_configuration) put_bucket_notification_configuration(bucket, config) except Exception as e: logging.exception("Failed to put bucket notification configuration") response_status = "FAILED" error_message = f"Error: {str(e)}. " finally: submit_response(event, context, response_status, error_message) def handle_managed(request_type, notification_configuration): if request_type == 'Delete': return {} return notification_configuration def handle_unmanaged(bucket, stack_id, request_type, notification_configuration): external_notifications = find_external_notifications(bucket, stack_id) if request_type == 'Delete': return external_notifications def with_id(notification): notification['Id'] = f"{stack_id}-{hash(json.dumps(notification, sort_keys=True))}" return notification notifications = {} for t in CONFIGURATION_TYPES: external = external_notifications.get(t, []) incoming = [with_id(n) for n in notification_configuration.get(t, [])] notifications[t] = external + incoming if EVENTBRIDGE_CONFIGURATION in notification_configuration: notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION] elif EVENTBRIDGE_CONFIGURATION in external_notifications: notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION] return notifications def find_external_notifications(bucket, stack_id): existing_notifications = get_bucket_notification_configuration(bucket) external_notifications = {} for t in CONFIGURATION_TYPES: external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f"{stack_id}-")] if EVENTBRIDGE_CONFIGURATION in existing_notifications: external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION] return external_notifications def get_bucket_notification_configuration(bucket): return s3.get_bucket_notification_configuration(Bucket=bucket) def put_bucket_notification_configuration(bucket, notification_configuration): s3.put_bucket_notification_configuration(Bucket=bucket, NotificationConfiguration=notification_configuration) def submit_response(event: dict, context, response_status: str, error_message: str): response_body = json.dumps( { "Status": response_status, "Reason": f"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}", "PhysicalResourceId": event.get("PhysicalResourceId") or event["LogicalResourceId"], "StackId": event["StackId"], "RequestId": event["RequestId"], "LogicalResourceId": event["LogicalResourceId"], "NoEcho": False, } ).encode("utf-8") headers = {"content-type": "", "content-length": str(len(response_body))} try: req = urllib.request.Request(url=event["ResponseURL"], headers=headers, data=response_body, method="PUT") with urllib.request.urlopen(req) as response: print(response.read().decode("utf-8")) print("Status code: " + response.reason) except Exception as e: print("send(..) failed executing request.urlopen(..): " + str(e)) ", }, "Description": "AWS CloudFormation handler for "Custom::S3BucketNotifications" resources (@aws-cdk/aws-s3)", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "BucketNotificationsHandler050a0587b7544547bf325f094a3db834RoleB6FB88EC", "Arn", ], }, "Runtime": "python3.9", "Timeout": 300, }, "Type": "AWS::Lambda::Function", }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834RoleB6FB88EC": { "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", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834RoleDefaultPolicy2CF63D36": { "Properties": { "PolicyDocument": { "Statement": [ { "Action": "s3:PutBucketNotification", "Effect": "Allow", "Resource": "*", }, ], "Version": "2012-10-17", }, "PolicyName": "BucketNotificationsHandler050a0587b7544547bf325f094a3db834RoleDefaultPolicy2CF63D36", "Roles": [ { "Ref": "BucketNotificationsHandler050a0587b7544547bf325f094a3db834RoleB6FB88EC", }, ], }, "Type": "AWS::IAM::Policy", }, "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": { "DependsOn": [ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", ], "Properties": { "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-us-east-1", }, "S3Key": "350185a1069fa20a23a583e20c77f6844218bd73097902362dc94f1a108f5d89.zip", }, "Description": { "Fn::Join": [ "", [ "Lambda function for auto-deleting objects in ", { "Ref": "S3ResourcesRawrawCdrsA3674958", }, " S3 bucket.", ], ], }, "Handler": "__entrypoint__.handler", "MemorySize": 128, "Role": { "Fn::GetAtt": [ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", "Arn", ], }, "Runtime": "nodejs16.x", "Timeout": 900, }, "Type": "AWS::Lambda::Function", }, "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "ManagedPolicyArns": [ { "Fn::Sub": "arn:\${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", }, ], }, "Type": "AWS::IAM::Role", }, "GlueResourcesAmazonChimeSdkVoiceConnectorCdrsDB7BCD97": { "Properties": { "CatalogId": { "Ref": "AWS::AccountId", }, "DatabaseInput": { "Name": "amazon_chime_sdk_voice_connector_cdrs", }, }, "Type": "AWS::Glue::Database", }, "GlueResourcesprocessedCdrsTable9AACF8FC": { "Properties": { "CatalogId": { "Ref": "AWS::AccountId", }, "DatabaseName": { "Ref": "GlueResourcesAmazonChimeSdkVoiceConnectorCdrsDB7BCD97", }, "TableInput": { "Name": "processed_cdrs", "Owner": "hadoop", "Parameters": { "EXTERNAL": "TRUE", "has_encrypted_data": "false", "parquet.compression": "SNAPPY", "projection.day.digits": "2", "projection.day.range": "1,31", "projection.day.type": "integer", "projection.enabled": "true", "projection.month.digits": "2", "projection.month.range": "1,12", "projection.month.type": "integer", "projection.year.range": "2023,2026", "projection.year.type": "integer", "transient_lastDdlTime": "1685844097", }, "PartitionKeys": [ { "Name": "year", "Type": "int", }, { "Name": "month", "Type": "int", }, { "Name": "day", "Type": "int", }, ], "StorageDescriptor": { "Columns": [ { "Name": "AwsAccountId", "Type": "string", }, { "Name": "TransactionId", "Type": "string", }, { "Name": "CallId", "Type": "string", }, { "Name": "VoiceConnectorId", "Type": "string", }, { "Name": "Status", "Type": "string", }, { "Name": "StatusMessage", "Type": "string", }, { "Name": "BillableDurationSeconds", "Type": "int", }, { "Name": "BillableDurationMinutes", "Type": "float", }, { "Name": "SchemaVersion", "Type": "string", }, { "Name": "SourcePhoneNumber", "Type": "string", }, { "Name": "SourceCountry", "Type": "string", }, { "Name": "DestinationPhoneNumber", "Type": "string", }, { "Name": "DestinationCountry", "Type": "string", }, { "Name": "UsageType", "Type": "string", }, { "Name": "ServiceCode", "Type": "string", }, { "Name": "Direction", "Type": "string", }, { "Name": "StartTimeEpochSeconds", "Type": "bigint", }, { "Name": "EndTimeEpochSeconds", "Type": "bigint", }, { "Name": "Region", "Type": "string", }, { "Name": "Streaming", "Type": "boolean", }, { "Name": "IsProxyCall", "Type": "boolean", }, ], "InputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat", "Location": { "Fn::Join": [ "", [ "s3://", { "Ref": "S3ResourcesProcessedprocessedCdrsE11DE56B", }, "/Amazon-Chime-Voice-Connector-CDRs", ], ], }, "OutputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat", "SerdeInfo": { "Parameters": { "serialization.format": "1", }, "SerializationLibrary": "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe", }, }, "TableType": "EXTERNAL_TABLE", }, }, "Type": "AWS::Glue::Table", }, "KinesisResourcesFirehoseLogGroup8027C7C1": { "DeletionPolicy": "Delete", "Properties": { "LogGroupName": "/aws/firehose/processCdrs", "RetentionInDays": 7, }, "Type": "AWS::Logs::LogGroup", "UpdateReplacePolicy": "Delete", }, "KinesisResourcesFirehoseLogStream60C9CED0": { "DeletionPolicy": "Retain", "Properties": { "LogGroupName": { "Ref": "KinesisResourcesFirehoseLogGroup8027C7C1", }, "LogStreamName": "processCdrs", }, "Type": "AWS::Logs::LogStream", "UpdateReplacePolicy": "Retain", }, "KinesisResourcesFirehoseRole86E2111E": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": "firehose.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "Policies": [ { "PolicyDocument": { "Statement": [ { "Action": "glue:GetTableVersions", "Effect": "Allow", "Resource": [ { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":glue:us-east-1:", { "Ref": "AWS::AccountId", }, ":catalog", ], ], }, { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":glue:us-east-1:", { "Ref": "AWS::AccountId", }, ":database/", { "Ref": "GlueResourcesAmazonChimeSdkVoiceConnectorCdrsDB7BCD97", }, ], ], }, { "Fn::Join": [ "", [ "arn:aws:glue:us-east-1:", { "Ref": "AWS::AccountId", }, ":table/", { "Ref": "GlueResourcesAmazonChimeSdkVoiceConnectorCdrsDB7BCD97", }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, "PolicyName": "gluePolicy", }, ], }, "Type": "AWS::IAM::Role", }, "KinesisResourcesFirehoseRoleDefaultPolicy57EEE516": { "Properties": { "PolicyDocument": { "Statement": [ { "Action": [ "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ "S3ResourcesProcessedprocessedCdrsE11DE56B", "Arn", ], }, { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "S3ResourcesProcessedprocessedCdrsE11DE56B", "Arn", ], }, "/*", ], ], }, ], }, { "Action": [ "logs:CreateLogStream", "logs:PutLogEvents", ], "Effect": "Allow", "Resource": { "Fn::GetAtt": [ "KinesisResourcesFirehoseLogGroup8027C7C1", "Arn", ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "KinesisResourcesFirehoseRoleDefaultPolicy57EEE516", "Roles": [ { "Ref": "KinesisResourcesFirehoseRole86E2111E", }, ], }, "Type": "AWS::IAM::Policy", }, "KinesisResourcescdrProcessDeliveryStreamA711DC23": { "Properties": { "DeliveryStreamType": "DirectPut", "ExtendedS3DestinationConfiguration": { "BucketARN": { "Fn::GetAtt": [ "S3ResourcesProcessedprocessedCdrsE11DE56B", "Arn", ], }, "BufferingHints": { "IntervalInSeconds": 60, "SizeInMBs": 128, }, "CloudWatchLoggingOptions": { "Enabled": true, "LogGroupName": { "Ref": "KinesisResourcesFirehoseLogGroup8027C7C1", }, "LogStreamName": "processCdrs", }, "DataFormatConversionConfiguration": { "Enabled": true, "InputFormatConfiguration": { "Deserializer": { "OpenXJsonSerDe": {}, }, }, "OutputFormatConfiguration": { "Serializer": { "ParquetSerDe": {}, }, }, "SchemaConfiguration": { "DatabaseName": { "Ref": "GlueResourcesAmazonChimeSdkVoiceConnectorCdrsDB7BCD97", }, "Region": "us-east-1", "RoleARN": { "Fn::GetAtt": [ "KinesisResourcesFirehoseRole86E2111E", "Arn", ], }, "TableName": { "Ref": "GlueResourcesprocessedCdrsTable9AACF8FC", }, "VersionId": "LATEST", }, }, "DynamicPartitioningConfiguration": { "Enabled": true, }, "ErrorOutputPrefix": "Amazon-Chime-Voice-Connector-CDRs/error/!{firehose:error-output-type}", "Prefix": "Amazon-Chime-Voice-Connector-CDRs/year=!{partitionKeyFromQuery:year}/month=!{partitionKeyFromQuery:month}/day=!{partitionKeyFromQuery:day}/", "ProcessingConfiguration": { "Enabled": true, "Processors": [ { "Parameters": [ { "ParameterName": "MetadataExtractionQuery", "ParameterValue": "{year: .EndTimeEpochSeconds| strftime("%Y"), month: .EndTimeEpochSeconds| strftime("%m"), day: .EndTimeEpochSeconds| strftime("%d")}", }, { "ParameterName": "JsonParsingEngine", "ParameterValue": "JQ-1.6", }, ], "Type": "MetadataExtraction", }, ], }, "RoleARN": { "Fn::GetAtt": [ "KinesisResourcesFirehoseRole86E2111E", "Arn", ], }, "S3BackupMode": "Disabled", }, }, "Type": "AWS::KinesisFirehose::DeliveryStream", }, "LambdaResourcesgenerateCdrsLambda66D97B1E": { "DependsOn": [ "LambdaResourcesgenerateCdrsRoleDefaultPolicy11642A14", "LambdaResourcesgenerateCdrsRoleB0596EAF", ], "Properties": { "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-us-east-1", }, "S3Key": "83a1c00b9d442293e1c597bda0425afb989a90f084ef4bf379d63e7ba3f32986.zip", }, "Environment": { "Variables": { "FILE_COUNT": "10", "LOG_LEVEL": "INFO", "TARGET_BUCKET": { "Ref": "S3ResourcesRawrawCdrsA3674958", }, }, }, "Handler": "index.handler", "MemorySize": 10240, "Role": { "Fn::GetAtt": [ "LambdaResourcesgenerateCdrsRoleB0596EAF", "Arn", ], }, "Runtime": "python3.9", "Timeout": 900, }, "Type": "AWS::Lambda::Function", }, "LambdaResourcesgenerateCdrsRoleB0596EAF": { "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", ], ], }, ], }, "Type": "AWS::IAM::Role", }, "LambdaResourcesgenerateCdrsRoleDefaultPolicy11642A14": { "Properties": { "PolicyDocument": { "Statement": [ { "Action": [ "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ "S3ResourcesRawrawCdrsA3674958", "Arn", ], }, { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "S3ResourcesRawrawCdrsA3674958", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, "PolicyName": "LambdaResourcesgenerateCdrsRoleDefaultPolicy11642A14", "Roles": [ { "Ref": "LambdaResourcesgenerateCdrsRoleB0596EAF", }, ], }, "Type": "AWS::IAM::Policy", }, "LambdaResourcesprocessCdrsLambda93CC7BC4": { "DependsOn": [ "LambdaResourcesprocessCdrsRoleDefaultPolicyDDDF2AB0", "LambdaResourcesprocessCdrsRoleE5184157", ], "Properties": { "Code": { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-us-east-1", }, "S3Key": "43b561555c797503d89939b19a63995e562a4e58c2f239688ce7ef6feeee27b9.zip", }, "Environment": { "Variables": { "KINESIS_STREAM": { "Ref": "KinesisResourcescdrProcessDeliveryStreamA711DC23", }, "LOG_LEVEL": "INFO", }, }, "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "LambdaResourcesprocessCdrsRoleE5184157", "Arn", ], }, "Runtime": "python3.9", "Timeout": 15, }, "Type": "AWS::Lambda::Function", }, "LambdaResourcesprocessCdrsRoleDefaultPolicyDDDF2AB0": { "Properties": { "PolicyDocument": { "Statement": [ { "Action": [ "s3:GetObject*", "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", "s3:PutObject", "s3:PutObjectLegalHold", "s3:PutObjectRetention", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:Abort*", ], "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ "S3ResourcesRawrawCdrsA3674958", "Arn", ], }, { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "S3ResourcesRawrawCdrsA3674958", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, "PolicyName": "LambdaResourcesprocessCdrsRoleDefaultPolicyDDDF2AB0", "Roles": [ { "Ref": "LambdaResourcesprocessCdrsRoleE5184157", }, ], }, "Type": "AWS::IAM::Policy", }, "LambdaResourcesprocessCdrsRoleE5184157": { "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", ], ], }, ], "Policies": [ { "PolicyDocument": { "Statement": [ { "Action": "firehose:PutRecord", "Effect": "Allow", "Resource": { "Fn::GetAtt": [ "KinesisResourcescdrProcessDeliveryStreamA711DC23", "Arn", ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "stateMachinePolicy", }, ], }, "Type": "AWS::IAM::Role", }, "S3ResourcesProcessedprocessedCdrsAutoDeleteObjectsCustomResource942899A9": { "DeletionPolicy": "Delete", "DependsOn": [ "S3ResourcesProcessedprocessedCdrsPolicyA989D9BA", ], "Properties": { "BucketName": { "Ref": "S3ResourcesProcessedprocessedCdrsE11DE56B", }, "ServiceToken": { "Fn::GetAtt": [ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F", "Arn", ], }, }, "Type": "Custom::S3AutoDeleteObjects", "UpdateReplacePolicy": "Delete", }, "S3ResourcesProcessedprocessedCdrsE11DE56B": { "DeletionPolicy": "Delete", "Properties": { "BucketEncryption": { "ServerSideEncryptionConfiguration": [ { "ServerSideEncryptionByDefault": { "SSEAlgorithm": "AES256", }, }, ], }, "Tags": [ { "Key": "aws-cdk:auto-delete-objects", "Value": "true", }, ], }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "S3ResourcesProcessedprocessedCdrsNotificationsF58F1423": { "Properties": { "BucketName": { "Ref": "S3ResourcesProcessedprocessedCdrsE11DE56B", }, "Managed": true, "NotificationConfiguration": { "EventBridgeConfiguration": {}, }, "ServiceToken": { "Fn::GetAtt": [ "BucketNotificationsHandler050a0587b7544547bf325f094a3db8347ECC3691", "Arn", ], }, }, "Type": "Custom::S3BucketNotifications", }, "S3ResourcesProcessedprocessedCdrsPolicyA989D9BA": { "Properties": { "Bucket": { "Ref": "S3ResourcesProcessedprocessedCdrsE11DE56B", }, "PolicyDocument": { "Statement": [ { "Action": [ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", ], "Effect": "Allow", "Principal": { "AWS": { "Fn::GetAtt": [ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", "Arn", ], }, }, "Resource": [ { "Fn::GetAtt": [ "S3ResourcesProcessedprocessedCdrsE11DE56B", "Arn", ], }, { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "S3ResourcesProcessedprocessedCdrsE11DE56B", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, }, "Type": "AWS::S3::BucketPolicy", }, "S3ResourcesRawrawCdrsA3674958": { "DeletionPolicy": "Delete", "Properties": { "BucketEncryption": { "ServerSideEncryptionConfiguration": [ { "ServerSideEncryptionByDefault": { "SSEAlgorithm": "AES256", }, }, ], }, "Tags": [ { "Key": "aws-cdk:auto-delete-objects", "Value": "true", }, ], }, "Type": "AWS::S3::Bucket", "UpdateReplacePolicy": "Delete", }, "S3ResourcesRawrawCdrsAllowBucketNotificationsTotestLambdaResourcesprocessCdrsLambdaC86D24D4FBA32912": { "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { "Fn::GetAtt": [ "LambdaResourcesprocessCdrsLambda93CC7BC4", "Arn", ], }, "Principal": "s3.amazonaws.com", "SourceAccount": { "Ref": "AWS::AccountId", }, "SourceArn": { "Fn::GetAtt": [ "S3ResourcesRawrawCdrsA3674958", "Arn", ], }, }, "Type": "AWS::Lambda::Permission", }, "S3ResourcesRawrawCdrsAutoDeleteObjectsCustomResource44FB9072": { "DeletionPolicy": "Delete", "DependsOn": [ "S3ResourcesRawrawCdrsPolicy85A036FA", ], "Properties": { "BucketName": { "Ref": "S3ResourcesRawrawCdrsA3674958", }, "ServiceToken": { "Fn::GetAtt": [ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F", "Arn", ], }, }, "Type": "Custom::S3AutoDeleteObjects", "UpdateReplacePolicy": "Delete", }, "S3ResourcesRawrawCdrsNotifications647C1778": { "DependsOn": [ "S3ResourcesRawrawCdrsAllowBucketNotificationsTotestLambdaResourcesprocessCdrsLambdaC86D24D4FBA32912", ], "Properties": { "BucketName": { "Ref": "S3ResourcesRawrawCdrsA3674958", }, "Managed": true, "NotificationConfiguration": { "EventBridgeConfiguration": {}, "LambdaFunctionConfigurations": [ { "Events": [ "s3:ObjectCreated:*", ], "Filter": { "Key": { "FilterRules": [ { "Name": "prefix", "Value": "Amazon-Chime-Voice-Connector-CDRs", }, ], }, }, "LambdaFunctionArn": { "Fn::GetAtt": [ "LambdaResourcesprocessCdrsLambda93CC7BC4", "Arn", ], }, }, ], }, "ServiceToken": { "Fn::GetAtt": [ "BucketNotificationsHandler050a0587b7544547bf325f094a3db8347ECC3691", "Arn", ], }, }, "Type": "Custom::S3BucketNotifications", }, "S3ResourcesRawrawCdrsPolicy85A036FA": { "Properties": { "Bucket": { "Ref": "S3ResourcesRawrawCdrsA3674958", }, "PolicyDocument": { "Statement": [ { "Action": [ "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", ], "Effect": "Allow", "Principal": { "AWS": { "Fn::GetAtt": [ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", "Arn", ], }, }, "Resource": [ { "Fn::GetAtt": [ "S3ResourcesRawrawCdrsA3674958", "Arn", ], }, { "Fn::Join": [ "", [ { "Fn::GetAtt": [ "S3ResourcesRawrawCdrsA3674958", "Arn", ], }, "/*", ], ], }, ], }, ], "Version": "2012-10-17", }, }, "Type": "AWS::S3::BucketPolicy", }, }, "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.", }, ], }, }, } `;