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" {
|
2024-02-09 05:48:45 -08:00
|
|
|
role = aws_iam_role.social.name
|
2023-11-12 16:50:05 -08:00
|
|
|
policy_arn = aws_iam_policy.ssm.arn
|
|
|
|
}
|
|
|
|
|
|
|
|
|