-
Notifications
You must be signed in to change notification settings - Fork 273
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
improvement(terraform): support dynamic backends #6828
Conversation
c92162e
to
35b5ceb
Compare
35b5ceb
to
e87d8bf
Compare
386b489
to
c279759
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff!
const hasChanged = | ||
(currentBackendConfig && | ||
isPlainObject(currentBackendConfig) && | ||
!Object.entries(backendConfig).every(([key, value]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, is there a reason you're not using something like isEqual
from lodash-es
for the object comparison here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, just didn't think of it tbh
This change introduces a `backendConfig` field on the Terraform provider and action types. This field allows users to dynamically set the backend config for their Terraform stacks. Terraform itself doesn't allow variables in the backend config so this can be used instead to dynamically set the backend based on e.g. the environment.
c52fd43
to
ac65634
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! This is going to be super useful!
What this PR does / why we need it:
This change introduces a
backendConfig
field on the Terraformprovider and action types.
This field allows users to dynamically set the backend config for
their Terraform stacks.
Terraform itself doesn't allow variables in the backend config
so this can be used instead to dynamically set the backend
based on e.g. the environment.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
I still need to update the docs on the Terraform provider and remove the "
sed
hack". It's also an open question whether we mark this as experimental for now.But I can address both in a follow up PR.