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

Do we have a support to define dependency between Module kind? #408

Open
Ashish7812 opened this issue May 8, 2024 · 2 comments
Open

Do we have a support to define dependency between Module kind? #408

Ashish7812 opened this issue May 8, 2024 · 2 comments
Labels
acknowledged enhancement New feature or request question Further information is requested

Comments

@Ashish7812
Copy link

Operator Version, Kind and Kubernetes Version

  • Operator version:
  • Kind: Workspace | Module
  • Kubernetes version:

YAML Manifest File

# Copy-paste your YAML manifest here

Output Log

Kubectl Outputs

Question

I am using the Module kind to deploy my infrastructure. The infrastructure layer is divided into two modules.

  1. Network
  2. Compute

The following one is for the Network module.

apiVersion: app.terraform.io/v1alpha2
kind: Module
metadata:
name: network
spec:
organization:
token:
secretKeyRef:
name: terraformrc
key: token
destroyOnDeletion: true
module:
source: "s3::https://s3.amazonaws.com//network.zip"
variables:
- name: Owner
- name: Region
- name: StageName
workspace:
name: workspace-a1

Similarly I have created for the compute module. The question is how can I define the dependency between these two modules so that the network should be deployed first and then the compute module will be deployed.

The two modules will be deployed in the same workspace. Can we define a dependency between modules in the same workspace?

References

Community Note

  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
@Ashish7812 Ashish7812 added the question Further information is requested label May 8, 2024
@Ashish7812
Copy link
Author

Ashish7812 commented May 14, 2024

I came across the terraform stack concept. In the stack concept, there is a component-level dependency that suits my requirements.

so do we have a plan to support the terraform stack in the HCP terraform cloud operator?

@arybolovlev
Copy link
Contributor

Hi @Ashish7812,

If I understand you correctly, this cannot be achieved now with the Module controller. It implements API-driven workflow, which would be a limitation if we talk about a single Workspace. A potential workaround would be a new module that includes those 2 that you have and set dependencies in there, however, as of today it might not work well in some configurations and might require restarting a run.

As you have mentioned, the stack concept is something that may help to address your needs. Once it is GA it will take some time for us to discuss whether or not a support for it would be added to the operator. and if we decide positively -- it will take some time to develop a new controller.

Thanks!

@iBrandyJackson iBrandyJackson added enhancement New feature or request acknowledged labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants