Something went wrong on our end
-
Nuwan Rajika Kumarasiri authored
This volume will act as the persistence storage for Secure Agent's logs and configurations.
Nuwan Rajika Kumarasiri authoredThis volume will act as the persistence storage for Secure Agent's logs and configurations.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
iam.tf 909 B
# define a policy document for role below
data "aws_iam_policy_document" "ecs-agent" {
statement {
actions = [
"sts:AssumeRole"]
principals {
type = "Service"
identifiers = [
"ec2.amazonaws.com"]
}
}
}
# define the role for ECS agent so that ECS container agent can make API calls
resource "aws_iam_role" "ecs-agent" {
name = var.ecs_iam_role
assume_role_policy = data.aws_iam_policy_document.ecs-agent.json
}
# grant role permission for ECS agent operations
resource "aws_iam_role_policy_attachment" "ecs-agent" {
role = aws_iam_role.ecs-agent.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"
}
# allow instance profile to assume this role
resource "aws_iam_instance_profile" "ecs-instance-profile" {
name = "secure-agent-ecs-instance-profile"
role = aws_iam_role.ecs-agent.name
}