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

aws_ssm_parameter has hard coded name which prevents from generating multiple runners #967

Closed
lmilbaum opened this issue Sep 21, 2023 · 4 comments

Comments

@lmilbaum
Copy link
Contributor

Describe the bug

My configuration consists of two runners. Each attached to its own repository.
When the second runner is applied, the creation of aws_ssm_parameter resource from main.tf line 14 fails because
resource with the same name exists.

To Reproduce

Steps to reproduce the behavior:

Configure two module blocks in the configuration

Expected behavior

Ability to define the resource name dynamically such that the second runner creates aws_ssm_parameter resource with a different name

Additional context

Add any other context about the problem here.

@kayman-mk
Copy link
Collaborator

I guess the environment is identical which shouldn't. Could you please set different environment names for different runners?

@lmilbaum
Copy link
Contributor Author

I guess the environment is identical which shouldn't. Could you please set different environment names for different runners?

I could but then I need to remember that when the code changes to apply it to two production environments. Not ideal.

@kayman-mk
Copy link
Collaborator

Could you please elaborate on this? I didn't get the point.

module "gitlab_runner_1" {
  environment= "abc"
}

module "gitlab_runner_2" {
  environment= "def"
}

I don't have to do anything in case the module changes. Just two runners with two different environment names. The runner token which is stored, is totally managed by the module. There is no need to adjust something.

@lmilbaum
Copy link
Contributor Author

Could you please elaborate on this? I didn't get the point.

module "gitlab_runner_1" {
  environment= "abc"
}

module "gitlab_runner_2" {
  environment= "def"
}

I don't have to do anything in case the module changes. Just two runners with two different environment names. The runner token which is stored, is totally managed by the module. There is no need to adjust something.

Thanks for the clarification. My misunderstanding. Will try the suggested solution.

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

2 participants