terraform/ecc-aws-054-iam_policies_full_administrative_privileges/red/iam.tf (38 lines of code) (raw):

resource "aws_iam_policy" "this" { name = "054_policy_red" policy = <<EOF { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "*", "Resource": "*" } ] } EOF } resource "aws_iam_role" "this" { name = "054_role_red" assume_role_policy = <<EOF { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "sts:AssumeRole", "Principal": { "Service": [ "lambda.amazonaws.com" ] } } ] } EOF } resource "aws_iam_role_policy_attachment" "this" { role = aws_iam_role.this.name policy_arn = aws_iam_policy.this.arn }