Answers: <p>Normally this is due to wrong values being passed, specifically these:</p>
  <p><strong>SPACELIFT_TOKEN</strong> - the token you’ve received from Spacelift on worker pool creation ( this would be in a file called worker-pool-x.config)</p>
  <p><strong>SPACELIFT_POOL_PRIVATE_KEY</strong> - the contents of the private key file you generated, in base64.</p>
  <p>However, I will list out all the variables and where to get them from, If you are saving them in a Spacelift stack then they would be prefixed with TF_VAR_</p>
  <ul>
  <li><strong>TF_VAR_worker_pool_id</strong> - the worker pool id, you can copy this value from the worker pool page</li>
  <li><strong>TF_VAR_worker_pool_private_key</strong> - you can get this by running the command <code>cat spacelift.key | base64 -w 0</code> in your command line. For Mac users, the command is <code>cat spacelift.key | base64 -b 0</code>.</li>
  <li><strong>TF_VAR_worker_pool_config</strong> - This will be the contents of the .config file that was downloaded when you created your worker
  pool.(this is the same as the SPACELIFT_TOKEN previously mentioned)</li>
  <li><strong>TF_VAR_spacelift_api_key_endpoint</strong> - account api endpoint eg https://.app.spacelift.io</li>
  <li><strong>TF_VAR_spacelift_api_key_id</strong> You can create an API key by navigating to organization settings &gt; create key. After the key is created, you can copy its id.</li>
  <li><strong>TF_VAR_spacelift_api_key_secret</strong> - Once you create the API key, you can find the secret in the config file.</li>
  <li><strong>TF_VAR_worker_pool_security_groups</strong> &amp; <strong>TF_VAR_worker_pool_subnets</strong> will be the security group and subnets you want to use.</li>
  </ul>
  
Answers: CC BY-SA 4.0
Answers: 2024-02-01T21:09:26.913Z
Answers: 2024-02-01T21:09:26.913Z
Answers: Spacelift
Body: <p>I created a private worker using <a href="https://github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2" rel="nofollow noreferrer">https://github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2</a></p>
  <p>However, my worker pool shows as 0 even though I can see the worker in my AWS Console. What could be happening?</p>
  
Tags: <amazon-web-services><terraform><spacelift>
Title: Worker Pool in Spacelift showing as 0 workers
UserDisplayName: Danielle Murphy
ThreadText: # Worker Pool in Spacelift showing as 0 workers
  
  (Asked by: username_0 on 2024-02-01)
  
  I created a private worker using <https://github.com/username_1-io/terraform-aws-username_1-workerpool-on-ec2>
  
  However, my worker pool shows as 0 even though I can see the worker in my AWS Console. What could be happening?
  
  **Tags:** amazon-web-services, terraform, spacelift
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-02-01. Score: 1 | Accepted answer
  
  Normally this is due to wrong values being passed, specifically these:
  
  **username_1\_TOKEN** - the token you’ve received from username_1 on worker pool creation ( this would be in a file called worker-pool-x.config)
  
  **username_1\_POOL\_PRIVATE\_KEY** - the contents of the private key file you generated, in base64.
  
  However, I will list out all the variables and where to get them from, If you are saving them in a username_1 stack then they would be prefixed with TF\_VAR\_
  
  * **TF\_VAR\_worker\_pool\_id** - the worker pool id, you can copy this value from the worker pool page
  * **TF\_VAR\_worker\_pool\_private\_key** - you can get this by running the command `cat username_1.key | base64 -w 0` in your command line. For Mac users, the command is `cat username_1.key | base64 -b 0`.
  * **TF\_VAR\_worker\_pool\_config** - This will be the contents of the .config file that was downloaded when you created your worker
    pool.(this is the same as the username_1\_TOKEN previously mentioned)
  * **TF\_VAR\_spacelift\_api\_key\_endpoint** - account api endpoint eg https://.app.username_1.io
  * **TF\_VAR\_spacelift\_api\_key\_id** You can create an API key by navigating to organization settings > create key. After the key is created, you can copy its id.
  * **TF\_VAR\_spacelift\_api\_key\_secret** - Once you create the API key, you can find the secret in the config file.
  * **TF\_VAR\_worker\_pool\_security\_groups** & **TF\_VAR\_worker\_pool\_subnets** will be the security group and subnets you want to use.
  
  
  ---
  
  