terraform: generate conf with http backend
This commit is contained in:
parent
affa0f0149
commit
32239c379a
16 changed files with 43 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
import datetime
|
||||
import os
|
||||
from typing import Iterable, Optional, Any, List
|
||||
|
||||
from app import app
|
||||
|
@ -70,6 +71,12 @@ class BridgeAutomation(TerraformAutomation):
|
|||
BridgeConf.provider == self.provider
|
||||
).all(),
|
||||
global_namespace=app.config['GLOBAL_NAMESPACE'],
|
||||
terraform_modules_path=os.path.join(*list(os.path.split(app.root_path))[:-1], 'terraform-modules'),
|
||||
backend_config=f"""backend "http" {{
|
||||
lock_address = "{app.config['TFSTATE_BACKEND']}/{self.short_name}"
|
||||
unlock_address = "{app.config['TFSTATE_BACKEND']}/{self.short_name}"
|
||||
address = "{app.config['TFSTATE_BACKEND']}/{self.short_name}"
|
||||
}}""",
|
||||
**{
|
||||
k: app.config[k.upper()]
|
||||
for k in self.template_parameters
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue