resource "aws_iam_policy_attachment" "AmazonEKS_EFS_CSI_Driver_Policy_Attachment" {
  name = "AmazonEKS_EFS_CSI_Driver_Policy_Attachment"
  roles = [
    aws_iam_role.lcsp-eks-euc1-prod-prometheus-role.name,
    aws_iam_role.lcsp-eks-use1-prod-prometheus-role.name
  ]
  policy_arn = "arn:aws:iam::${var.account_id}:policy/AmazonEKS_EFS_CSI_Driver_Policy"
}

resource "aws_iam_policy_attachment" "AssumeRoleWithWebIdentity_Policy_Attachment" {
  name = "AssumeRoleWithWebIdentity_Policy_Attachment"
  roles = [
    aws_iam_role.lcsp-eks-euc1-prod-prometheus-role.name,
    aws_iam_role.lcsp-eks-use1-prod-prometheus-role.name
  ]
  policy_arn = "arn:aws:iam::${var.account_id}:policy/AssumeRoleWithWebIdentity"
}

resource "aws_iam_policy_attachment" "AmazonEBSCSIDriver_Policy_Attachment" {
  name = "AmazonEBSCSIDriver_Policy_Attachment"
  roles = [
    aws_iam_role.lcsp-eks-euc1-prod-prometheus-role.name,
    aws_iam_role.lcsp-eks-use1-prod-prometheus-role.name,
    aws_iam_role.lcsp-EKS-worker-node-Role.name
  ]
  policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy"
}

resource "aws_iam_policy_attachment" "lambda-monitor-rds-subnet-ips-policy-attachment" {
  name       = "lambda_monitor_rds_subnet_ips_policy_attachment"
  roles      = [aws_iam_role.lambda-monitor-rds-subnet-ips-role.name]
  policy_arn = aws_iam_policy.lambda-monitor-rds-subnet-ips-policy.arn
}

resource "aws_iam_role_policy_attachment" "grps_testpod_sme_eks_euc1_prod_policy_attachment" {
  role       = aws_iam_role.grps-testpod-sme-eks-euc1-prod-role.name
  policy_arn = aws_iam_policy.grps-testpod-sme-eks-euc1-prod-policy.arn
}