mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-16 16:47:20 +01:00
feat: Add SourceArn condition to Fargate profile trust policy (#3039)
feat: add `SourceArn` condition to fargate-profile assume_role_policy
This commit is contained in:
@@ -52,6 +52,7 @@ No modules.
|
|||||||
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
|
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
|
||||||
| [aws_iam_policy_document.assume_role_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
|
| [aws_iam_policy_document.assume_role_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
|
||||||
| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |
|
| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |
|
||||||
|
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
data "aws_partition" "current" {}
|
data "aws_partition" "current" {}
|
||||||
data "aws_caller_identity" "current" {}
|
data "aws_caller_identity" "current" {}
|
||||||
|
data "aws_region" "current" {}
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
create_iam_role = var.create && var.create_iam_role
|
create_iam_role = var.create && var.create_iam_role
|
||||||
@@ -30,6 +31,15 @@ data "aws_iam_policy_document" "assume_role_policy" {
|
|||||||
type = "Service"
|
type = "Service"
|
||||||
identifiers = ["eks-fargate-pods.amazonaws.com"]
|
identifiers = ["eks-fargate-pods.amazonaws.com"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
condition {
|
||||||
|
test = "ArnLike"
|
||||||
|
variable = "aws:SourceArn"
|
||||||
|
|
||||||
|
values = [
|
||||||
|
"arn:${data.aws_partition.current.partition}:eks:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:fargateprofile/${var.cluster_name}/*",
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user