Skip to content

Commit

Permalink
Merge pull request #14 from ace-teknologi/feature/own-logging-policy
Browse files Browse the repository at this point in the history
create own logging policy
  • Loading branch information
sjauld committed Apr 29, 2020
2 parents aa24ab6 + 72db1bc commit ec8fb33
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,23 @@ data "aws_iam_policy_document" "lambda_assume" {

resource "aws_iam_policy_attachment" "eastgardens" {
name = "${var.namespace}Logging"
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
policy_arn = aws_iam_policy.logging.arn
roles = [aws_iam_role.eastgardens.name]
}

resource "aws_iam_policy" "logging" {
name = "${var.namespace}Logging"
policy = data.aws_iam_policy_document.logging.json
}

data "aws_iam_policy_document" "logging" {
statement {
sid = "Log"
actions = [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
]
resources = ["*"]
}
}

0 comments on commit ec8fb33

Please sign in to comment.