Skip to content

Commit

Permalink
[TM-805] minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-kovalyov committed Dec 5, 2024
1 parent 562ea4a commit d586d9b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions terraform/environments/oas/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,8 @@ resource "aws_iam_instance_profile" "ec2_instance_profile" {
}

resource "aws_iam_role" "ec2_instance_role" {
name = "${local.application_name}-role"
managed_policy_arns = ["arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"]
assume_role_policy = <<EOF
name = "${local.application_name}-role"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
Expand All @@ -259,6 +258,11 @@ resource "aws_iam_role" "ec2_instance_role" {
EOF
}

resource "aws_iam_role_policy_attachment" "ec2_instance_role_attachment" {
role = aws_iam_role.ec2_instance_role.name
policy_arn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
}

resource "aws_iam_role_policy" "ec2_instance_policy" {
#tfsec:ignore:aws-iam-no-policy-wildcards
name = "${local.application_name}-ec2-policy"
Expand Down

0 comments on commit d586d9b

Please sign in to comment.