# Automatically Creating Workspaces

**URL:** <https://discuss.hashicorp.com/t/automatically-creating-workspaces/74363>\
**Category:** Terraform\
**Created:** [April 10, 2025, 2:05pm UTC](https://discuss.hashicorp.com/t/automatically-creating-workspaces/74363 "2025-04-10T14:05:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew-kemp-dahlberg](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/andrew-kemp-dahlberg/32/45199_2.png) [@andrew-kemp-dahlberg](https://discuss.hashicorp.com/u/andrew-kemp-dahlberg)\
**Post date:** [April 10, 2025, 2:05pm UTC](https://discuss.hashicorp.com/t/automatically-creating-workspaces/74363/1 "2025-04-10T14:05:04Z")

</div>

Hey All - I’m pretty new to terraform. Been spending the last 4 months or so getting the basics down and I finally feel confident enough to put together a POC for Okta as my background is IAM.

I am starting with my applications and am planning on having a single repository labeled terraform-okta and two permanent branches (dev) - which will deploy to a sandbox and main which will deploy to prod.

within each branch will be the “apps” directory that will contain the directories of each module, and later I will add more directories for different module types.

I am wondering A. Does this sound like a reasonable way to have my Repository set up.

B. I am planning on using GitHub actions and I have found plenty of info on the CI pieces and running tests before merge, I’ve also found plenty of info on CD post workspace creation so I’m just going to copy people alot smarter than me.

What I’m really wondering is what is the best way to automatically create my workspaces through CD? Should I not even be doing this because I can hardly find any information on this aspect.

---

<div class="post-metadata">

**Author:** ![wyardley](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/wyardley/32/21845_2.png) [@wyardley](https://discuss.hashicorp.com/u/wyardley)\
**Post date:** [April 14, 2025, 8:34pm UTC](https://discuss.hashicorp.com/t/automatically-creating-workspaces/74363/2 "2025-04-14T20:34:26Z")

</div>

Are you talking about [workspaces](https://developer.hashicorp.com/terraform/language/state/workspaces) in the Terraform sense (i.e., different layers _within_ a state, allowing some limited way of using the same code across different environments for each “workspace”), or, more “workspace” in the Terraform cloud / TFE sense?

Normally, if you’re not using TF Cloud, I would call the units that are in a single state “states” or “substates”.

In either case, the first time you apply something, the state or “workspace” should get created the first time you apply it; if you’re trying to build out your own workflows using a CI provider, you may want to make a reusable workflow that’s somewhat parameterized so that you can call it consistently for a given state or workspace.

Hope that kind of answers your question?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/hashicorp/original/1X/79bf76adfd92a75631996933098f9ce29d37abf3.svg) [@system](https://discuss.hashicorp.com/u/system)\
**Post date:** [October 11, 2025, 8:34pm UTC](https://discuss.hashicorp.com/t/automatically-creating-workspaces/74363/3 "2025-10-11T20:34:48Z")

</div>

Closed on October 11, 2025, 8:34pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
