Skip to content

Speed up terraform run time in total#36

Merged
pavlovic-ivan merged 6 commits intomainfrom
apply-from-plan-file
Mar 3, 2026
Merged

Speed up terraform run time in total#36
pavlovic-ivan merged 6 commits intomainfrom
apply-from-plan-file

Conversation

@pavlovic-ivan
Copy link
Contributor

Add action cleanup-plan. Change terraform apply so that it applies changes saved to tfplan file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about adding an input parameter (boolean) for cleanup? in most cases, cleanup of the plan is what we want and it's only for the "apply" case that we don't. this would avoid adding so much stuff to all the workflows!

alternatively we would use a "post" step for it, which would be ideal, but I believe it requires using a proper JS action rather that a composite one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me think about it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgiannuzzi i think it's now resolved. please take a look

@pavlovic-ivan pavlovic-ivan requested a review from jgiannuzzi March 2, 2026 14:41
TF_WORKSPACE: ${{ inputs.tfc-workspace }}
run: |
terraform plan -no-color -input=false -out=tfplan
echo "plan-file=tfplan" >> $GITHUB_OUTPUT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be an absolute path to avoid confusion

@pavlovic-ivan pavlovic-ivan requested a review from jgiannuzzi March 3, 2026 10:50
jgiannuzzi
jgiannuzzi previously approved these changes Mar 3, 2026
TF_WORKSPACE: ${{ inputs.tfc-workspace }}
run: |
terraform plan -no-color -input=false -out=tfplan
echo "plan-file=$(pwd)/tfplan" >> $GITHUB_OUTPUT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that outputting the plan file should be based on whether keep-plan is true, otherwise we can output a plan file even when there is none.

@pavlovic-ivan pavlovic-ivan merged commit 3086a9e into main Mar 3, 2026
@pavlovic-ivan pavlovic-ivan deleted the apply-from-plan-file branch March 3, 2026 12:28
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

Successfully merging this pull request may close these issues.

2 participants