Skip to content

Commit

Permalink
feat(lambda): support filter criteria encryption
Browse files Browse the repository at this point in the history
  • Loading branch information
xazhao committed Aug 14, 2024
1 parent 043f6d2 commit 6aa72a2
Show file tree
Hide file tree
Showing 35 changed files with 2,467 additions and 32 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,166 @@
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"fctestkeyname524AF060": {
"Type": "AWS::KMS::Key",
"Properties": {
"Description": "KMS key for test fc encryption",
"KeyPolicy": {
"Statement": [
{
"Action": "kms:*",
"Effect": "Allow",
"Principal": {
"AWS": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::",
{
"Ref": "AWS::AccountId"
},
":root"
]
]
}
},
"Resource": "*"
},
{
"Action": "kms:Decrypt",
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Resource": "*"
}
],
"Version": "2012-10-17"
},
"PendingWindowInDays": 7
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"F5ServiceRole2E897519": {
"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"
]
]
}
]
}
},
"F5ServiceRoleDefaultPolicyF3745DE6": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "dynamodb:ListStreams",
"Effect": "Allow",
"Resource": "*"
},
{
"Action": [
"dynamodb:DescribeStream",
"dynamodb:GetRecords",
"dynamodb:GetShardIterator"
],
"Effect": "Allow",
"Resource": {
"Fn::GetAtt": [
"TD925BC7E",
"StreamArn"
]
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "F5ServiceRoleDefaultPolicyF3745DE6",
"Roles": [
{
"Ref": "F5ServiceRole2E897519"
}
]
}
},
"F5B560B5F9": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"ZipFile": "exports.handler = async function handler(event) {\n console.log('event:', JSON.stringify(event, undefined, 2));\n return { event };\n}"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"F5ServiceRole2E897519",
"Arn"
]
},
"Runtime": "nodejs18.x"
},
"DependsOn": [
"F5ServiceRoleDefaultPolicyF3745DE6",
"F5ServiceRole2E897519"
]
},
"F5DynamoDBEventSourcelambdaeventsourcefiltercriteriadynamodbT9CFE7D0688700B50": {
"Type": "AWS::Lambda::EventSourceMapping",
"Properties": {
"BatchSize": 5,
"EventSourceArn": {
"Fn::GetAtt": [
"TD925BC7E",
"StreamArn"
]
},
"FilterCriteria": {
"Filters": [
{
"Pattern": "{\"eventName\":[\"INSERT\"],\"dynamodb\":{\"Keys\":{\"id\":{\"S\":[{\"exists\":true}]}}}}"
}
]
},
"FunctionName": {
"Ref": "F5B560B5F9"
},
"KmsKeyArn": {
"Fn::GetAtt": [
"fctestkeyname524AF060",
"Arn"
]
},
"StartingPosition": "LATEST"
}
}
},
"Parameters": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6aa72a2

Please sign in to comment.