// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Test Lambda with Kinesis 1`] = ` { "Parameters": { "AssetParameters9a512a1198e54699fd9d427f29f91021458fda9d23601e31e4b76bf96d5d7caaArtifactHash8E6713FC": { "Description": "Artifact hash for asset "9a512a1198e54699fd9d427f29f91021458fda9d23601e31e4b76bf96d5d7caa"", "Type": "String", }, "AssetParameters9a512a1198e54699fd9d427f29f91021458fda9d23601e31e4b76bf96d5d7caaS3Bucket476799AF": { "Description": "S3 bucket for asset "9a512a1198e54699fd9d427f29f91021458fda9d23601e31e4b76bf96d5d7caa"", "Type": "String", }, "AssetParameters9a512a1198e54699fd9d427f29f91021458fda9d23601e31e4b76bf96d5d7caaS3VersionKey703E74DF": { "Description": "S3 key for asset version "9a512a1198e54699fd9d427f29f91021458fda9d23601e31e4b76bf96d5d7caa"", "Type": "String", }, }, "Resources": { "FeedConsumerConstructIngestionStreamKinesisStreamF21DCD9B": { "Properties": { "RetentionPeriodHours": 24, "ShardCount": 1, "StreamEncryption": { "EncryptionType": "KMS", "KeyId": "alias/aws/kinesis", }, "StreamModeDetails": { "StreamMode": "PROVISIONED", }, }, "Type": "AWS::Kinesis::Stream", }, "FeedConsumerConstructIngestionStreamKinesisStreamGetRecordsIteratorAgeAlarm1507C6F6": { "Properties": { "AlarmDescription": "Consumer Record Processing Falling Behind, there is risk for data loss due to record expiration.", "ComparisonOperator": "GreaterThanOrEqualToThreshold", "EvaluationPeriods": 1, "MetricName": "GetRecords.IteratorAgeMilliseconds", "Namespace": "AWS/Kinesis", "Period": 300, "Statistic": "Maximum", "Threshold": 43200, }, "Type": "AWS::CloudWatch::Alarm", }, "FeedConsumerConstructIngestionStreamKinesisStreamReadProvisionedThroughputExceededAlarm3786A46E": { "Properties": { "AlarmDescription": "Consumer Application is Reading at a Slower Rate Than Expected.", "ComparisonOperator": "GreaterThanThreshold", "EvaluationPeriods": 1, "MetricName": "ReadProvisionedThroughputExceeded", "Namespace": "AWS/Kinesis", "Period": 300, "Statistic": "Average", "Threshold": 0, }, "Type": "AWS::CloudWatch::Alarm", }, "FeedConsumerConstructIngestionStreamLambdaFunction77D1CF81": { "DependsOn": [ "FeedConsumerConstructIngestionStreamLambdaFunctionServiceRoleDefaultPolicy014923F5", "FeedConsumerConstructIngestionStreamLambdaFunctionServiceRole4FAEBA16", ], "Metadata": { "cfn_nag": { "rules_to_suppress": [ { "id": "W58", "reason": "Lambda functions has the required permission to write CloudWatch Logs. It uses custom policy instead of arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole with tighter permissions.", }, { "id": "W89", "reason": "This is not a rule for the general case, just for specific use cases/industries", }, { "id": "W92", "reason": "Impossible for us to define the correct concurrency for clients", }, ], }, }, "Properties": { "Code": { "S3Bucket": { "Ref": "AssetParameters9a512a1198e54699fd9d427f29f91021458fda9d23601e31e4b76bf96d5d7caaS3Bucket476799AF", }, "S3Key": { "Fn::Join": [ "", [ { "Fn::Select": [ 0, { "Fn::Split": [ "||", { "Ref": "AssetParameters9a512a1198e54699fd9d427f29f91021458fda9d23601e31e4b76bf96d5d7caaS3VersionKey703E74DF", }, ], }, ], }, { "Fn::Select": [ 1, { "Fn::Split": [ "||", { "Ref": "AssetParameters9a512a1198e54699fd9d427f29f91021458fda9d23601e31e4b76bf96d5d7caaS3VersionKey703E74DF", }, ], }, ], }, ], ], }, }, "Environment": { "Variables": { "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1", "WORKFLOW_ARN": "arn:aws:states:us-east-1:someaccountid:stateMachine:WorkflowEngine12346891012-ad234ab", }, }, "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "FeedConsumerConstructIngestionStreamLambdaFunctionServiceRole4FAEBA16", "Arn", ], }, "Runtime": "nodejs14.x", "Timeout": 300, "TracingConfig": { "Mode": "Active", }, }, "Type": "AWS::Lambda::Function", }, "FeedConsumerConstructIngestionStreamLambdaFunctionKinesisEventSourceFeedConsumerConstructIngestionStreamKinesisStream6783F5C4F7BA2158": { "Properties": { "BatchSize": 100, "BisectBatchOnFunctionError": true, "DestinationConfig": { "OnFailure": { "Destination": { "Fn::GetAtt": [ "FeedConsumerConstructSqsDlqQueue666B1B7B", "Arn", ], }, }, }, "EventSourceArn": { "Fn::GetAtt": [ "FeedConsumerConstructIngestionStreamKinesisStreamF21DCD9B", "Arn", ], }, "FunctionName": { "Ref": "FeedConsumerConstructIngestionStreamLambdaFunction77D1CF81", }, "MaximumRecordAgeInSeconds": 86400, "StartingPosition": "TRIM_HORIZON", }, "Type": "AWS::Lambda::EventSourceMapping", }, "FeedConsumerConstructIngestionStreamLambdaFunctionServiceRole4FAEBA16": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, "Policies": [ { "PolicyDocument": { "Statement": [ { "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents", ], "Effect": "Allow", "Resource": { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":logs:", { "Ref": "AWS::Region", }, ":", { "Ref": "AWS::AccountId", }, ":log-group:/aws/lambda/*", ], ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "LambdaFunctionServiceRolePolicy", }, ], }, "Type": "AWS::IAM::Role", }, "FeedConsumerConstructIngestionStreamLambdaFunctionServiceRoleDefaultPolicy014923F5": { "DependsOn": [ "FeedConsumerConstructSqsDlqQueuePolicy7AA74739", "FeedConsumerConstructSqsDlqQueue666B1B7B", ], "Metadata": { "cfn_nag": { "rules_to_suppress": [ { "id": "W12", "reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC.", }, ], }, }, "Properties": { "PolicyDocument": { "Statement": [ { "Action": [ "xray:PutTraceSegments", "xray:PutTelemetryRecords", ], "Effect": "Allow", "Resource": "*", }, { "Action": [ "kinesis:DescribeStreamSummary", "kinesis:GetRecords", "kinesis:GetShardIterator", "kinesis:ListShards", "kinesis:SubscribeToShard", "kinesis:DescribeStream", "kinesis:ListStreams", ], "Effect": "Allow", "Resource": { "Fn::GetAtt": [ "FeedConsumerConstructIngestionStreamKinesisStreamF21DCD9B", "Arn", ], }, }, { "Action": [ "sqs:SendMessage", "sqs:GetQueueAttributes", "sqs:GetQueueUrl", ], "Effect": "Allow", "Resource": { "Fn::GetAtt": [ "FeedConsumerConstructSqsDlqQueue666B1B7B", "Arn", ], }, }, { "Action": "kinesis:DescribeStream", "Effect": "Allow", "Resource": { "Fn::GetAtt": [ "FeedConsumerConstructIngestionStreamKinesisStreamF21DCD9B", "Arn", ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "FeedConsumerConstructIngestionStreamLambdaFunctionServiceRoleDefaultPolicy014923F5", "Roles": [ { "Ref": "FeedConsumerConstructIngestionStreamLambdaFunctionServiceRole4FAEBA16", }, ], }, "Type": "AWS::IAM::Policy", }, "FeedConsumerConstructIngestionStreamSqsDlqQueueED0A45D7": { "DeletionPolicy": "Delete", "Properties": { "KmsMasterKeyId": "alias/aws/sqs", }, "Type": "AWS::SQS::Queue", "UpdateReplacePolicy": "Delete", }, "FeedConsumerConstructIngestionStreamSqsDlqQueuePolicy59698F47": { "Properties": { "PolicyDocument": { "Statement": [ { "Action": [ "sqs:DeleteMessage", "sqs:ReceiveMessage", "sqs:SendMessage", "sqs:GetQueueAttributes", "sqs:RemovePermission", "sqs:AddPermission", "sqs:SetQueueAttributes", ], "Effect": "Allow", "Principal": { "AWS": { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":iam::", { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, "Resource": { "Fn::GetAtt": [ "FeedConsumerConstructIngestionStreamSqsDlqQueueED0A45D7", "Arn", ], }, "Sid": "QueueOwnerOnlyAccess", }, { "Action": "SQS:*", "Condition": { "Bool": { "aws:SecureTransport": "false", }, }, "Effect": "Deny", "Principal": { "AWS": "*", }, "Resource": { "Fn::GetAtt": [ "FeedConsumerConstructIngestionStreamSqsDlqQueueED0A45D7", "Arn", ], }, "Sid": "HttpsOnly", }, ], "Version": "2012-10-17", }, "Queues": [ { "Ref": "FeedConsumerConstructIngestionStreamSqsDlqQueueED0A45D7", }, ], }, "Type": "AWS::SQS::QueuePolicy", }, "FeedConsumerConstructSqsDlqQueue666B1B7B": { "DeletionPolicy": "Delete", "Properties": { "KmsMasterKeyId": "alias/aws/sqs", }, "Type": "AWS::SQS::Queue", "UpdateReplacePolicy": "Delete", }, "FeedConsumerConstructSqsDlqQueuePolicy7AA74739": { "Properties": { "PolicyDocument": { "Statement": [ { "Action": [ "sqs:DeleteMessage", "sqs:ReceiveMessage", "sqs:SendMessage", "sqs:GetQueueAttributes", "sqs:RemovePermission", "sqs:AddPermission", "sqs:SetQueueAttributes", ], "Effect": "Allow", "Principal": { "AWS": { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":iam::", { "Ref": "AWS::AccountId", }, ":root", ], ], }, }, "Resource": { "Fn::GetAtt": [ "FeedConsumerConstructSqsDlqQueue666B1B7B", "Arn", ], }, "Sid": "QueueOwnerOnlyAccess", }, { "Action": "SQS:*", "Condition": { "Bool": { "aws:SecureTransport": "false", }, }, "Effect": "Deny", "Principal": { "AWS": "*", }, "Resource": { "Fn::GetAtt": [ "FeedConsumerConstructSqsDlqQueue666B1B7B", "Arn", ], }, "Sid": "HttpsOnly", }, ], "Version": "2012-10-17", }, "Queues": [ { "Ref": "FeedConsumerConstructSqsDlqQueue666B1B7B", }, ], }, "Type": "AWS::SQS::QueuePolicy", }, }, } `;