masto-aio/terraform/ssm.tf

32 lines
634 B
Terraform
Raw Normal View History

2023-11-12 16:50:05 -08:00
# SSM permissions
data "aws_iam_policy_document" "assume_role_policy" {
statement {
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["ec2.amazonaws.com"]
}
}
}
resource "aws_iam_policy" "ssm" {
name = "social_ssm"
policy = data.aws_iam_policy.ssm.policy
path = "/"
description = "SSM permissions for social"
}
data "aws_iam_policy" "ssm" {
arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM"
}
resource "aws_iam_role_policy_attachment" "ssm" {
role = aws_iam_role.social.name
2023-11-12 16:50:05 -08:00
policy_arn = aws_iam_policy.ssm.arn
}