mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 09:50:45 +00:00
XIN-240: Add IAM roles for ecs task execution
This commit is contained in:
parent
e22a873d00
commit
f7f4986142
1 changed files with 30 additions and 0 deletions
|
|
@ -119,4 +119,34 @@ resource "aws_security_group" "devnet_efs_security_group" {
|
||||||
tags = {
|
tags = {
|
||||||
Name = "TfDevnetEfs"
|
Name = "TfDevnetEfs"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# IAM policies
|
||||||
|
|
||||||
|
data "aws_iam_policy_document" "xdc_ecs_tasks_execution_role" {
|
||||||
|
statement {
|
||||||
|
actions = ["sts:AssumeRole"]
|
||||||
|
|
||||||
|
principals {
|
||||||
|
type = "Service"
|
||||||
|
identifiers = ["ecs-tasks.amazonaws.com"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create the role
|
||||||
|
resource "aws_iam_role" "devnet_xdc_ecs_tasks_execution_role" {
|
||||||
|
name = "devnet-xdc-ecs-task-execution-role"
|
||||||
|
assume_role_policy = "${data.aws_iam_policy_document.xdc_ecs_tasks_execution_role.json}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Attached the AWS managed policies to the new role
|
||||||
|
resource "aws_iam_role_policy_attachment" "devnet_xdc_ecs_tasks_execution_role" {
|
||||||
|
for_each = toset([
|
||||||
|
"arn:aws:iam::aws:policy/AmazonElasticFileSystemClientFullAccess",
|
||||||
|
"arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy",
|
||||||
|
"arn:aws:iam::aws:policy/AmazonElasticFileSystemsUtils"
|
||||||
|
])
|
||||||
|
role = aws_iam_role.devnet_xdc_ecs_tasks_execution_role.name
|
||||||
|
policy_arn = each.value
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue