diff --git a/aws/ec2-auto-stop-daily/iam_policy.json b/aws/ec2-auto-stop-daily/iam_policy.json new file mode 100644 index 0000000..89a6edb --- /dev/null +++ b/aws/ec2-auto-stop-daily/iam_policy.json @@ -0,0 +1,14 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "ec2:DescribeInstances", + "ec2:DescribeRegions", + "ec2:StopInstances" + ], + "Resource": "*" + } + ] +} \ No newline at end of file diff --git a/aws/ec2-auto-stop-daily/main.tf b/aws/ec2-auto-stop-daily/main.tf index d9e1487..ac2ac52 100644 --- a/aws/ec2-auto-stop-daily/main.tf +++ b/aws/ec2-auto-stop-daily/main.tf @@ -6,42 +6,13 @@ provider "aws" { resource "aws_iam_role" "lambda_role" { name = "EC2-Auto-Stop-Lambda" - assume_role_policy = <