Skip to content

Commit b7009fb

Browse files
committed
fixing IAM Role for lambda
1 parent 566e0be commit b7009fb

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

main.tf

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,22 @@ resource "aws_iam_role" "this" {
3737
data "aws_iam_policy_document" "lambda_policy_doc" {
3838
statement {
3939
actions = [
40-
"autoscaling:SetInstanceHealth",
41-
"autoscaling:DescribeAutoScalingGroups"
40+
"autoscaling:SetInstanceHealth"
4241
]
4342

4443
resources = [
4544
"arn:aws:autoscaling:${local.region}:${local.account_id}:*:autoScalingGroupName/${var.asg_name}"
4645
]
4746
}
47+
statement {
48+
actions = [
49+
"autoscaling:DescribeAutoScalingGroups"
50+
]
51+
52+
resources = [
53+
"*"
54+
]
55+
}
4856
}
4957

5058
resource "aws_iam_role_policy" "this" {
@@ -72,8 +80,8 @@ resource "aws_lambda_function" "this" {
7280
tags = module.tags.tags
7381
environment {
7482
variables = {
75-
ASG_NAME = var.asg_name
76-
LOGLEVEL = var.loglevel
83+
ASG_NAME = var.asg_name
84+
LOGLEVEL = var.loglevel
7785
}
7886
}
7987
lifecycle {

0 commit comments

Comments
 (0)