File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,28 @@ resource "aws_iam_role_policy_attachment" "lambda_kinesis_execution" {
3131 policy_arn = " arn:aws:iam::aws:policy/AmazonKinesisFullAccess"
3232}
3333
34+ resource "aws_iam_policy" "lambda_cloudwatch_logs" {
35+ name = " LambdaCloudWatchLogsCustomPolicy"
36+ policy = jsonencode ({
37+ " Version" : " 2012-10-17" ,
38+ " Statement" : [
39+ {
40+ " Effect" : " Allow" ,
41+ " Action" : [
42+ " logs:CreateLogStream" ,
43+ " logs:PutLogEvents"
44+ ],
45+ " Resource" : " *"
46+ }
47+ ]
48+ })
49+ }
50+
51+ resource "aws_iam_role_policy_attachment" "lambda_cloudwatch_logs_attachment" {
52+ role = aws_iam_role. lambda_kinesis . name
53+ policy_arn = aws_iam_policy. lambda_cloudwatch_logs . arn
54+ }
55+
3456# Create S3 Bucket, Ownership, ACL
3557resource "aws_s3_bucket" "lambda_bucket" {
3658 bucket = " ${ var . prefix } -lambda-code"
Original file line number Diff line number Diff line change @@ -31,6 +31,28 @@ resource "aws_iam_role_policy_attachment" "lambda_kinesis_execution" {
3131 policy_arn = " arn:aws:iam::aws:policy/AmazonKinesisFullAccess"
3232}
3333
34+ resource "aws_iam_policy" "lambda_cloudwatch_logs" {
35+ name = " LambdaCloudWatchLogsCustomPolicy"
36+ policy = jsonencode ({
37+ " Version" : " 2012-10-17" ,
38+ " Statement" : [
39+ {
40+ " Effect" : " Allow" ,
41+ " Action" : [
42+ " logs:CreateLogStream" ,
43+ " logs:PutLogEvents"
44+ ],
45+ " Resource" : " *"
46+ }
47+ ]
48+ })
49+ }
50+
51+ resource "aws_iam_role_policy_attachment" "lambda_cloudwatch_logs_attachment" {
52+ role = aws_iam_role. lambda_kinesis . name
53+ policy_arn = aws_iam_policy. lambda_cloudwatch_logs . arn
54+ }
55+
3456# Create S3 Bucket, Ownership, ACL
3557resource "aws_s3_bucket" "lambda_bucket" {
3658 bucket = " ${ var . prefix } -lambda-code"
You can’t perform that action at this time.
0 commit comments