-
Notifications
You must be signed in to change notification settings - Fork 173
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
[Feature Request] Terraform Cloud integration #34
Comments
Initial code on I tested it locally using
then, write the planfile into a JSON:
|
Implementing the TFC portion seems pretty straight forward based on the API docs... should we expect rover to generate a new run if a plan doesn't already exist? That seems like it could lead to unintended consequences... 🤔 I'll implement it without triggering a new run if one doesn't already exist for now, based on feedback, I might add another flag that creates a new run if one doesn't exist |
I agree, especially since TFC could queue runs together. Love the first MVP of this though, being able to pass that JSON file to generate the rover output is a huge win! |
Just integrated TFC and tested it out 😄 This requires you set your Terraform Cloud token to the
You must set the If you do not set I've tested a couple times and it seems like it works well. There's a slight hiccup when rover generates a new run, since it takes time for the plan JSON to be available to the user. I hardcoded a 10 second pause and it seems to work well so far, but need to play with it more to make it more robust. With new run:
Without new run:
|
I'm planning on looking at #46 later this week and determine if it's feasible to attach it in this release. If it is, I'll aim for a new release with both features the following week. Otherwise, I'll cut a release with the TFC integration only so folks can use it immediately 😄 |
This looks awesome, the only thing I can think is TFC uses
WorkflowIn theory user A could initiate a run.Items[0] // User A run_id as run-123 and then sit to wait for confirmation. Then while waiting for confirmation or immediately following the first run.Items[0] // User B run_id as run-456 Rover resultAt that same moment it's created user A would run rover and get user B's run.Items[0] // User A run_id as run-456
Probably a very, very rare circumstance, but could still possibly happen and something to think about 😄 as the feature is developed or for later iterations to enhance durability . Edit: this will be extremely unlikely due to the console waiting for completion. This would really only occur in the following circumstances (AFAIK):
Once again, this would really only work for |
Yep, that makes sense. That was the issue I was running into earlier today when testing too -- thank you for articulating and explaining it so clearly. I'm going to think about a better solution for this in the next couple days, the only one I can think of is iterating through the runs until it discovers one with a plan It's not an elegant solution, but I think if we do that, plus append the run ID to the workspace name (so it appears in the visualization), it'll help address the workflow you raised 😄 |
One possible solution -- you could make it so if someone uses Definitely interested in seeing what you come up with!! |
I think Currently if someone uses |
Gonna aim for a release next week. My personal laptop died, so dropped it of for repairs 😬 |
Just to note I did get it to work using this command.
Two things about this:
|
Integrate with Terraform Cloud. When you provide rover TFC credentials, rover should be able to pull the latest plan and generate a visualization
Would be nice if we could create a GitHub action with this integration
The text was updated successfully, but these errors were encountered: