-
Notifications
You must be signed in to change notification settings - Fork 97
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
[FIX] Terraform provider version inconsistency within stages #2862
base: main
Are you sure you want to change the base?
Changes from all commits
e14e835
8380884
3da475d
b8ac266
31ec936
7934255
92f4cf6
2527979
657014e
66440a3
35048e6
dd64020
8923dda
8538ec3
f152e72
5f0c07c
046b21a
b57c61b
79f4e01
ce9832f
1c0be1e
0c48e5b
9cc390c
38a4b90
82c85ea
d8b0699
e31e7f8
c4d3786
84601d6
9293d3a
6e7edf8
0e82a79
469d45e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,10 @@ | |
from _nebari.provider.cloud import amazon_web_services, azure_cloud, google_cloud | ||
from _nebari.stages.base import NebariTerraformStage | ||
from _nebari.stages.kubernetes_services import SharedFsEnum | ||
from _nebari.stages.tf_objects import NebariTerraformState | ||
from _nebari.stages.tf_objects import ( | ||
NebariOpentofuRequiredProvider, | ||
NebariTerraformState, | ||
) | ||
from _nebari.utils import ( | ||
AZURE_NODE_RESOURCE_GROUP_SUFFIX, | ||
construct_azure_resource_group_name, | ||
|
@@ -732,8 +735,12 @@ def state_imports(self) -> List[Tuple[str, str]]: | |
] | ||
|
||
def tf_objects(self) -> List[Dict]: | ||
resources = super().tf_objects() | ||
|
||
if self.config.provider == schema.ProviderEnum.gcp: | ||
return [ | ||
*resources, | ||
NebariOpentofuRequiredProvider("google", self.config), | ||
opentofu.Provider( | ||
"google", | ||
project=self.config.google_cloud_platform.project, | ||
|
@@ -743,15 +750,27 @@ def tf_objects(self) -> List[Dict]: | |
] | ||
elif self.config.provider == schema.ProviderEnum.azure: | ||
return [ | ||
*resources, | ||
NebariOpentofuRequiredProvider("azurerm", self.config), | ||
NebariTerraformState(self.name, self.config), | ||
] | ||
elif self.config.provider == schema.ProviderEnum.aws: | ||
return [ | ||
*resources, | ||
NebariOpentofuRequiredProvider("aws", self.config), | ||
opentofu.Provider("aws", region=self.config.amazon_web_services.region), | ||
NebariTerraformState(self.name, self.config), | ||
] | ||
elif self.config.provider == schema.ProviderEnum.local: | ||
return [ | ||
*resources, | ||
NebariOpentofuRequiredProvider("kind", self.config), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think originally, I had in mind a |
||
NebariOpentofuRequiredProvider("docker", self.config), | ||
NebariOpentofuRequiredProvider("kubectl", self.config), | ||
NebariOpentofuRequiredProvider("kubernetes", self.config), | ||
] | ||
else: | ||
return [] | ||
return resources | ||
|
||
def input_vars(self, stage_outputs: Dict[str, Dict[str, Any]]): | ||
if self.config.provider == schema.ProviderEnum.local: | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.
If I understood correctly, this was included since we also wanted to render the _tf.json files for the module versions right? I've been testing this locally so far today, and even without this the actual versions have been correctly used by each stage and its underlying modules. I will follow on what we discussed back then to refresh my head around why we went this route, but we might not need ti anymore :)