Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting service_account_set_key_path for more than one key #36

Open
nitrocode opened this issue Mar 18, 2023 · 0 comments
Open

Allow setting service_account_set_key_path for more than one key #36

nitrocode opened this issue Mar 18, 2023 · 0 comments

Comments

@nitrocode
Copy link
Member

Have a question? Please checkout our Slack Community or visit our Slack Archive.

Slack Community

Describe the Feature

Allow setting service_account_set_key_path for more than one key for cases like datadog where we may want to use the same role for the following

clusterAgent.rbac.serviceAccountAnnotations.eks\\.amazonaws\\.com/role-arn
agents.rbac.serviceAccountAnnotations.eks\\.amazonaws\\.com/role-arn

A single input would only code one of those. We should be able to set multiple.

Workaround

locals {
  service_account_name = "datadog*"

  iam_role_arn = "arn:${data.aws_partition.current.partition}:iam::${data.aws_caller_identity.current.account_id}:role/${module.this.id}-${trimsuffix(local.service_account_name, "*")}@${var.kubernetes_namespace}"
}
module "datadog_agent" {
  source  = "cloudposse/helm-release/aws"
  version = "0.7.0"

  # ...

  set = [
    {
      name  = "clusterAgent.rbac.serviceAccountAnnotations.eks\\.amazonaws\\.com/role-arn"
      type  = "string"
      value = local.iam_role_arn
    },
    {
      name  = "agents.rbac.serviceAccountAnnotations.eks\\.amazonaws\\.com/role-arn"
      type  = "string"
      value = local.iam_role_arn
    },
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant