parent
aa0ff5802f
commit
257a2eacea
2 changed files with 11 additions and 13 deletions
|
@ -10,6 +10,7 @@ from app.terraform import BaseAutomation
|
|||
from app.terraform.block_bridge_github import BlockBridgeGitHubAutomation
|
||||
from app.terraform.block_external import BlockExternalAutomation
|
||||
from app.terraform.block_ooni import BlockOONIAutomation
|
||||
from app.terraform.eotk import EotkAutomation
|
||||
from app.terraform.alarms.proxy_azure_cdn import AlarmProxyAzureCdnAutomation
|
||||
from app.terraform.alarms.proxy_cloudfront import AlarmProxyCloudfrontAutomation
|
||||
from app.terraform.alarms.proxy_http_status import AlarmProxyHTTPStatusAutomation
|
||||
|
@ -37,6 +38,7 @@ jobs = {
|
|||
BridgeGandiAutomation,
|
||||
BridgeHcloudAutomation,
|
||||
BridgeOvhAutomation,
|
||||
EotkAutomation,
|
||||
ListGithubAutomation,
|
||||
ListGitlabAutomation,
|
||||
ListS3Automation,
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from app import app
|
||||
from app.models.base import Group
|
||||
from app.terraform import BaseAutomation
|
||||
from app.terraform.terraform import TerraformAutomation
|
||||
|
||||
|
||||
class EotkAutomation(BaseAutomation):
|
||||
class EotkAutomation(TerraformAutomation):
|
||||
short_name = "eotk"
|
||||
description = "Deploy EOTK instances to AWS"
|
||||
|
||||
template_parameters = [
|
||||
"aws_access_key",
|
||||
|
@ -50,21 +51,16 @@ class EotkAutomation(BaseAutomation):
|
|||
{% endfor %}
|
||||
"""
|
||||
|
||||
def generate_terraform(self):
|
||||
self.write_terraform_config(
|
||||
def tf_generate(self):
|
||||
self.tf_write(
|
||||
self.template,
|
||||
groups=Group.query.filter(Group.eotk == True).all(),
|
||||
groups=Group.query.filter(
|
||||
Group.eotk == True,
|
||||
Group.destroyed == None
|
||||
).all(),
|
||||
global_namespace=app.config['GLOBAL_NAMESPACE'],
|
||||
**{
|
||||
k: app.config[k.upper()]
|
||||
for k in self.template_parameters
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
with app.app_context():
|
||||
auto = EotkAutomation()
|
||||
auto.generate_terraform()
|
||||
auto.terraform_init()
|
||||
auto.terraform_apply()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue