Created
April 15, 2020 06:35
-
-
Save wshihadeh/de368d17bdd77962574d0f699735751d to your computer and use it in GitHub Desktop.
aws_iam_role
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_iam_role" "stop_start_ec2_role" { | |
name = "StopStartEC2Role" | |
assume_role_policy = <<EOF | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": "sts:AssumeRole", | |
"Principal": { | |
"Service": "lambda.amazonaws.com" | |
}, | |
"Effect": "Allow", | |
"Sid": "" | |
} | |
] | |
} | |
EOF | |
} | |
resource "aws_iam_role_policy_attachment" "lambda_role_policy" { | |
role = "${aws_iam_role.stop_start_ec2_role.name}" | |
policy_arn = "${aws_iam_policy.stop_start_ec2_policy.arn}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment