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

Add module.cache.policy_arn to outputs for other gitlab runner module to reference #943

Closed
houdinisparks opened this issue Aug 27, 2023 · 4 comments
Labels
enhancement 🆕 New feature or request stale Issue/PR is stale and closed automatically

Comments

@houdinisparks
Copy link

Describe the solution you'd like

I have multiple runners deployed, in a docker-machine runner - multiple runner agents architecture.
I want to re-use the cache bucket (of a runner) created, with other runners, but currently there's no easy way yet to reference the docker-machine policy arn created within the module.cache child module.

Describe alternatives you've considered

Suggest a solution

Proposing to

  1. Add module.cache.policy_arn as an output to outputs.tf file, i.e
output "runner_cache_bucket_users_policy_arn" {
  description = "ARN of the policy for users of the cache (bucket)."
  value       = length(module.cache) > 0 ? module.cache[0].policy_arn : null
}

Additional context

@kayman-mk
Copy link
Collaborator

Could you please give some more details? I use the same setup but have no need for that. Creating the cache separately should solve this problem, doesn't it?

module "cache" {
  source  = "cattle-ops/gitlab-runner/aws//modules/cache"
  version = "6.5.1"
  # ... other options left out for readability
}

module "gitlab_runner_1" {
  for_each = data.aws_subnet.runners

  source  = "cattle-ops/gitlab-runner/aws"
  version = "6.5.1"

  cache_shared = true

  cache_bucket = {
    create = false
    policy = "${module.cache.policy_arn}"
    bucket = "${module.cache.bucket}"
  }

  # ... other options left out for readability
}

module "gitlab_runner_2" {
  for_each = data.aws_subnet.runners

  source  = "cattle-ops/gitlab-runner/aws"
  version = "6.5.1"

  cache_shared = true

  cache_bucket = {
    create = false
    policy = "${module.cache.policy_arn}"
    bucket = "${module.cache.bucket}"
  }

  # ... other options left out for readability
}

@kayman-mk kayman-mk added the enhancement 🆕 New feature or request label Aug 31, 2023
@kayman-mk
Copy link
Collaborator

@houdinisparks Have you had the time to check this?

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

@github-actions github-actions bot added the stale Issue/PR is stale and closed automatically label Nov 28, 2023
Copy link
Contributor

This issue was closed because it has been stalled for 15 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🆕 New feature or request stale Issue/PR is stale and closed automatically
Projects
None yet
Development

No branches or pull requests

2 participants