diff --git a/README.md b/README.md index 6752a64..a6a0301 100644 --- a/README.md +++ b/README.md @@ -25,16 +25,16 @@ Truefoundry AWS platform features | Name | Type | |------|------| -| [aws_iam_policy.truefoundry_platform_feature_cloud_integration_policy](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_policy) | resource | +| [aws_iam_policy.truefoundry_platform_feature_cluster_integration_policy](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_policy) | resource | | [aws_iam_policy.truefoundry_platform_feature_user_ecr_policy](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_policy) | resource | | [aws_iam_policy.truefoundry_platform_feature_user_s3_policy](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_policy) | resource | | [aws_iam_policy.truefoundry_platform_feature_user_ssm_policy](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_policy) | resource | | [aws_iam_role.truefoundry_platform_feature_iam_role](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_role) | resource | -| [aws_iam_role_policy_attachment.truefoundry_platform_user_cloud_integration_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.truefoundry_platform_user_cluster_integration_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_role_policy_attachment) | resource | | [aws_iam_role_policy_attachment.truefoundry_platform_user_ecr_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_role_policy_attachment) | resource | | [aws_iam_role_policy_attachment.truefoundry_platform_user_s3_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_role_policy_attachment) | resource | | [aws_iam_role_policy_attachment.truefoundry_platform_user_ssm_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_policy_document.truefoundry_platform_feature_cloud_integration_policy_document](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_policy_document.truefoundry_platform_feature_cluster_integration_policy_document](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/data-sources/iam_policy_document) | data source | | [aws_iam_policy_document.truefoundry_platform_feature_user_ecr_policy_document](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/data-sources/iam_policy_document) | data source | | [aws_iam_policy_document.truefoundry_platform_feature_user_s3_policy_document](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/data-sources/iam_policy_document) | data source | | [aws_iam_policy_document.truefoundry_platform_feature_user_ssm_policy_document](https://registry.terraform.io/providers/hashicorp/aws/5.14.0/docs/data-sources/iam_policy_document) | data source | @@ -54,7 +54,7 @@ Truefoundry AWS platform features | [cluster\_name](#input\_cluster\_name) | Name of the EKS cluster | `string` | n/a | yes | | [control\_plane\_roles](#input\_control\_plane\_roles) | Control plane roles that can assume your platform role | `list(string)` |
[| no | | [feature\_blob\_storage\_enabled](#input\_feature\_blob\_storage\_enabled) | Enable blob storage feature in the platform | `bool` | `true` | no | -| [feature\_cloud\_integration\_enabled](#input\_feature\_cloud\_integration\_enabled) | Enable cloud integration feature in the platform | `bool` | `true` | no | +| [feature\_cluster\_integration\_enabled](#input\_feature\_cluster\_integration\_enabled) | Enable cluster integration feature in the platform | `bool` | `true` | no | | [feature\_docker\_registry\_enabled](#input\_feature\_docker\_registry\_enabled) | Enable docker registry feature in the platform | `bool` | `true` | no | | [feature\_secrets\_enabled](#input\_feature\_secrets\_enabled) | Enable secrets manager feature in the platform | `bool` | `true` | no | | [platform\_feature\_enabled](#input\_platform\_feature\_enabled) | Enable platform features like docker registry, secrets manager and blob storage | `bool` | `true` | no | diff --git a/iam.tf b/iam.tf index 61c481a..eb593fc 100644 --- a/iam.tf +++ b/iam.tf @@ -74,8 +74,8 @@ data "aws_iam_policy_document" "truefoundry_platform_feature_user_ecr_policy_doc } } -data "aws_iam_policy_document" "truefoundry_platform_feature_cloud_integration_policy_document" { - count = var.platform_feature_enabled ? var.feature_cloud_integration_enabled ? 1 : 0 : 0 +data "aws_iam_policy_document" "truefoundry_platform_feature_cluster_integration_policy_document" { + count = var.platform_feature_enabled ? var.feature_cluster_integration_enabled ? 1 : 0 : 0 statement { effect = "Allow" actions = [ @@ -146,11 +146,11 @@ resource "aws_iam_policy" "truefoundry_platform_feature_user_ecr_policy" { } -resource "aws_iam_policy" "truefoundry_platform_feature_cloud_integration_policy" { - count = var.platform_feature_enabled ? var.feature_cloud_integration_enabled ? 1 : 0 : 0 - name_prefix = "${local.truefoundry_unique_name}-cloud-integration-access" - description = "IAM policy for TrueFoundry user for platform features cloud integration" - policy = data.aws_iam_policy_document.truefoundry_platform_feature_cloud_integration_policy_document[0].json +resource "aws_iam_policy" "truefoundry_platform_feature_cluster_integration_policy" { + count = var.platform_feature_enabled ? var.feature_cluster_integration_enabled ? 1 : 0 : 0 + name_prefix = "${local.truefoundry_unique_name}-cluster-integration-access" + description = "IAM policy for TrueFoundry user for platform features cluster integration" + policy = data.aws_iam_policy_document.truefoundry_platform_feature_cluster_integration_policy_document[0].json tags = local.tags } @@ -197,8 +197,8 @@ resource "aws_iam_role_policy_attachment" "truefoundry_platform_user_ecr_policy_ policy_arn = aws_iam_policy.truefoundry_platform_feature_user_ecr_policy[0].arn } -resource "aws_iam_role_policy_attachment" "truefoundry_platform_user_cloud_integration_policy_attachment" { - count = var.platform_feature_enabled ? var.feature_cloud_integration_enabled ? 1 : 0 : 0 +resource "aws_iam_role_policy_attachment" "truefoundry_platform_user_cluster_integration_policy_attachment" { + count = var.platform_feature_enabled ? var.feature_cluster_integration_enabled ? 1 : 0 : 0 role = aws_iam_role.truefoundry_platform_feature_iam_role[0].name - policy_arn = aws_iam_policy.truefoundry_platform_feature_cloud_integration_policy[0].arn -} \ No newline at end of file + policy_arn = aws_iam_policy.truefoundry_platform_feature_cluster_integration_policy[0].arn +} diff --git a/variables.tf b/variables.tf index 9181483..6848b53 100644 --- a/variables.tf +++ b/variables.tf @@ -116,10 +116,10 @@ variable "feature_docker_registry_enabled" { } ################################################################################ -# Cloud Integration +# Cluster Integration ################################################################################ -variable "feature_cloud_integration_enabled" { - description = "Enable cloud integration feature in the platform" +variable "feature_cluster_integration_enabled" { + description = "Enable cluster integration feature in the platform" type = bool default = true } @@ -132,4 +132,4 @@ variable "tags" { description = "A map of tags to add to all resources" type = map(string) default = {} -} \ No newline at end of file +}
"arn:aws:iam::416964291864:role/tfy-ctl-euwe1-production-truefoundry-deps"
]