// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Test Lambda with role and scheduler 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": { "FeedProducerConstructLambdaDDBDynamoTableAA674720": { "DeletionPolicy": "Retain", "Properties": { "AttributeDefinitions": [ { "AttributeName": "ACCOUNT_IDENTIFIER", "AttributeType": "S", }, { "AttributeName": "CREATED_TIMESTAMP", "AttributeType": "S", }, ], "BillingMode": "PAY_PER_REQUEST", "KeySchema": [ { "AttributeName": "ACCOUNT_IDENTIFIER", "KeyType": "HASH", }, { "AttributeName": "CREATED_TIMESTAMP", "KeyType": "RANGE", }, ], "PointInTimeRecoverySpecification": { "PointInTimeRecoveryEnabled": true, }, "SSESpecification": { "SSEEnabled": true, }, "TimeToLiveSpecification": { "AttributeName": "EXP_DATE", "Enabled": true, }, }, "Type": "AWS::DynamoDB::Table", "UpdateReplacePolicy": "Retain", }, "FeedProducerConstructLambdaDDBLambdaFunctionFFB177EE": { "DependsOn": [ "FeedProducerConstructLambdaDDBLambdaFunctionServiceRoleDefaultPolicy6725EDBF", "FeedProducerConstructLambdaDDBLambdaFunctionServiceRole65571D6E", ], "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", "DDB_TABLE_NAME": { "Ref": "FeedProducerConstructLambdaDDBDynamoTableAA674720", }, "QUERY_PARAM": "Health", "RESULT_TYPE": "mixed", "SUPPORTED_LANG": "de,en,es,it,pt,fr,ja,ko,hi,ar,zh-cn,zh-tw", }, }, "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "FeedProducerConstructLambdaDDBLambdaFunctionServiceRole65571D6E", "Arn", ], }, "Runtime": "nodejs14.x", "Timeout": 300, "TracingConfig": { "Mode": "Active", }, }, "Type": "AWS::Lambda::Function", }, "FeedProducerConstructLambdaDDBLambdaFunctionServiceRole65571D6E": { "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", }, "FeedProducerConstructLambdaDDBLambdaFunctionServiceRoleDefaultPolicy6725EDBF": { "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": [ "dynamodb:BatchGetItem", "dynamodb:GetRecords", "dynamodb:GetShardIterator", "dynamodb:Query", "dynamodb:GetItem", "dynamodb:Scan", "dynamodb:ConditionCheckItem", "dynamodb:BatchWriteItem", "dynamodb:PutItem", "dynamodb:UpdateItem", "dynamodb:DeleteItem", "dynamodb:DescribeTable", ], "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ "FeedProducerConstructLambdaDDBDynamoTableAA674720", "Arn", ], }, { "Ref": "AWS::NoValue", }, ], }, { "Action": [ "kinesis:ListShards", "kinesis:PutRecord", "kinesis:PutRecords", ], "Effect": "Allow", "Resource": { "Fn::GetAtt": [ "TestStreamE6F40222", "Arn", ], }, }, { "Action": [ "ssm:GetParameter", "ssm:PutParameter", ], "Effect": "Allow", "Resource": { "Fn::Join": [ "", [ "arn:", { "Ref": "AWS::Partition", }, ":ssm:", { "Ref": "AWS::Region", }, ":", { "Ref": "AWS::AccountId", }, ":parameter/some/dummy/path/test", ], ], }, }, ], "Version": "2012-10-17", }, "PolicyName": "FeedProducerConstructLambdaDDBLambdaFunctionServiceRoleDefaultPolicy6725EDBF", "Roles": [ { "Ref": "FeedProducerConstructLambdaDDBLambdaFunctionServiceRole65571D6E", }, ], }, "Type": "AWS::IAM::Policy", }, "FeedProducerConstructPollFrequencyA3F49326": { "Properties": { "ScheduleExpression": "(0/2 * * * ? *)", "State": "ENABLED", "Targets": [ { "Arn": { "Fn::GetAtt": [ "FeedProducerConstructLambdaDDBLambdaFunctionFFB177EE", "Arn", ], }, "Id": "Target0", }, ], }, "Type": "AWS::Events::Rule", }, "FeedProducerConstructPollFrequencyAllowEventRuleFeedProducerConstructLambdaDDBLambdaFunction8E42B6E36960A3DF": { "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { "Fn::GetAtt": [ "FeedProducerConstructLambdaDDBLambdaFunctionFFB177EE", "Arn", ], }, "Principal": "events.amazonaws.com", "SourceArn": { "Fn::GetAtt": [ "FeedProducerConstructPollFrequencyA3F49326", "Arn", ], }, }, "Type": "AWS::Lambda::Permission", }, "TestStreamE6F40222": { "Properties": { "RetentionPeriodHours": 24, "ShardCount": 1, "StreamEncryption": { "EncryptionType": "KMS", "KeyId": "alias/aws/kinesis", }, "StreamModeDetails": { "StreamMode": "PROVISIONED", }, }, "Type": "AWS::Kinesis::Stream", }, }, } `;