File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed
terraform-unity/modules/terraform-unity-sps-airflow Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ """
2
+ # DAG Name: Env Test
3
+
4
+ # Purpose
5
+
6
+ # Usage
7
+ """ # noqa: E501
8
+
9
+ from datetime import datetime
10
+
11
+ from airflow .models import Variable
12
+ from airflow .operators .bash import BashOperator
13
+
14
+ from airflow import DAG
15
+
16
+ default_args = {
17
+ "owner" : "unity-sps" ,
18
+ "start_date" : datetime .utcfromtimestamp (0 ),
19
+ }
20
+
21
+ with DAG (
22
+ dag_id = "env_test" ,
23
+ default_args = default_args ,
24
+ schedule = None ,
25
+ is_paused_upon_creation = False ,
26
+ tags = ["test" ],
27
+ ) as dag :
28
+ dump_env = BashOperator (
29
+ task_id = "env" ,
30
+ bash_command = "env" ,
31
+ )
32
+
33
+ check_vars = BashOperator (
34
+ task_id = "check" ,
35
+ bash_command = "echo {} {} {} {} {}" .format (
36
+ Variable .get ("unity_project" ),
37
+ Variable .get ("unity_venue" ),
38
+ Variable .get ("unity_deployment_name" ),
39
+ Variable .get ("unity_counter" ),
40
+ Variable .get ("unity_cluster_name" ),
41
+ ),
42
+ )
43
+ dump_env >> check_vars
Original file line number Diff line number Diff line change @@ -261,6 +261,16 @@ dags:
261
261
env :
262
262
- name : " AIRFLOW_VAR_KUBERNETES_PIPELINE_NAMESPACE"
263
263
value : " ${kubernetes_namespace}"
264
+ - name : " AIRFLOW_VAR_UNITY_PROJECT"
265
+ value : " ${unity_project}"
266
+ - name : " AIRFLOW_VAR_UNITY_VENUE"
267
+ value : " ${unity_venue}"
268
+ - name : " AIRFLOW_VAR_UNITY_DEPLOYMENT_NAME"
269
+ value : " ${unity_deployment_name}"
270
+ - name : " AIRFLOW_VAR_UNITY_COUNTER"
271
+ value : " ${unity_counter}"
272
+ - name : " AIRFLOW_VAR_UNITY_CLUSTER_NAME"
273
+ value : " ${unity_cluster_name}"
264
274
265
275
# https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/security/api.html
266
276
extraEnv : |
Original file line number Diff line number Diff line change @@ -510,6 +510,11 @@ resource "helm_release" "airflow" {
510
510
webserver_navbar_color = local.airflow_webserver_navbar_color
511
511
service_area = upper (var. service_area )
512
512
service_area_version = var.release
513
+ unity_project = var.project
514
+ unity_venue = var.venue
515
+ unity_deployment_name = var.deployment_name
516
+ unity_counter = var.counter
517
+ unity_cluster_name = data.aws_eks_cluster.cluster.name
513
518
})
514
519
]
515
520
set_sensitive {
You can’t perform that action at this time.
0 commit comments