@@ -74,61 +74,61 @@ resource "google_workflows_workflow" "workflow" {
74
74
]
75
75
}
76
76
77
- data "google_client_config" "current" {
77
+ # data "google_client_config" "current" {
78
78
79
- }
79
+ # }
80
80
81
- # # Trigger the execution of the setup workflow with an API call
82
- data "http" "call_workflows_setup" {
83
- url = " https://workflowexecutions.googleapis.com/v1/projects/${ module . project-services . project_id } /locations/${ var . region } /workflows/${ google_workflows_workflow . workflow . name } /executions"
84
- method = " POST"
85
- request_headers = {
86
- Accept = " application/json"
87
- Authorization = " Bearer ${ data . google_client_config . current . access_token } " }
88
- depends_on = [
89
- google_storage_bucket . raw_bucket ,
90
- google_bigquery_routine . sp_bigqueryml_generate_create ,
91
- google_bigquery_routine . sp_bigqueryml_model ,
92
- google_bigquery_routine . sproc_sp_demo_lookerstudio_report ,
93
- google_bigquery_routine . sp_provision_lookup_tables ,
94
- google_workflows_workflow . workflow ,
95
- google_storage_bucket . raw_bucket ,
96
- google_cloudfunctions2_function . notebook_deploy_function ,
97
- time_sleep . wait_after_function ,
98
- google_service_account_iam_member . workflow_auth_function
99
- ]
100
- }
81
+ # # # Trigger the execution of the setup workflow with an API call
82
+ # data "http" "call_workflows_setup" {
83
+ # url = "https://workflowexecutions.googleapis.com/v1/projects/${module.project-services.project_id}/locations/${var.region}/workflows/${google_workflows_workflow.workflow.name}/executions"
84
+ # method = "POST"
85
+ # request_headers = {
86
+ # Accept = "application/json"
87
+ # Authorization = "Bearer ${data.google_client_config.current.access_token}" }
88
+ # depends_on = [
89
+ # google_storage_bucket.raw_bucket,
90
+ # google_bigquery_routine.sp_bigqueryml_generate_create,
91
+ # google_bigquery_routine.sp_bigqueryml_model,
92
+ # google_bigquery_routine.sproc_sp_demo_lookerstudio_report,
93
+ # google_bigquery_routine.sp_provision_lookup_tables,
94
+ # google_workflows_workflow.workflow,
95
+ # google_storage_bucket.raw_bucket,
96
+ # google_cloudfunctions2_function.notebook_deploy_function,
97
+ # time_sleep.wait_after_function,
98
+ # google_service_account_iam_member.workflow_auth_function
99
+ # ]
100
+ # }
101
101
102
- # Sleep for 120 seconds to allow the workflow to execute and finish setup
103
- resource "time_sleep" "wait_after_workflow_execution" {
104
- create_duration = " 120s"
105
- depends_on = [
106
- data . http . call_workflows_setup ,
107
- ]
108
- }
102
+ # # Sleep for 120 seconds to allow the workflow to execute and finish setup
103
+ # resource "time_sleep" "wait_after_workflow_execution" {
104
+ # create_duration = "120s"
105
+ # depends_on = [
106
+ # data.http.call_workflows_setup,
107
+ # ]
108
+ # }
109
109
110
- # # Trigger the execution of the setup workflow with an API call
111
- data "http" "call_workflows_state_1" {
112
- url = " https://workflowexecutions.googleapis.com/v1/projects/${ module . project-services . project_id } /locations/${ var . region } /workflows/${ google_workflows_workflow . workflow . name } /executions"
113
- method = " GET"
114
- request_headers = {
115
- Accept = " application/json"
116
- Authorization = " Bearer ${ data . google_client_config . current . access_token } " }
117
- depends_on = [
118
- time_sleep . wait_after_workflow_execution ,
119
- ]
120
- }
110
+ # # # Trigger the execution of the setup workflow with an API call
111
+ # data "http" "call_workflows_state_1" {
112
+ # url = "https://workflowexecutions.googleapis.com/v1/projects/${module.project-services.project_id}/locations/${var.region}/workflows/${google_workflows_workflow.workflow.name}/executions"
113
+ # method = "GET"
114
+ # request_headers = {
115
+ # Accept = "application/json"
116
+ # Authorization = "Bearer ${data.google_client_config.current.access_token}" }
117
+ # depends_on = [
118
+ # time_sleep.wait_after_workflow_execution,
119
+ # ]
120
+ # }
121
121
122
- data "http" "retry_workflows_1" {
123
- count = data. http . call_workflows_state_1 . executions [0 ]. state == " SUCCEEDED" || data. http . call_workflows_state_1 . executions [0 ]. state == " ACTIVE" ? 0 : 1
124
- url = " https://workflowexecutions.googleapis.com/v1/projects/${ module . project-services . project_id } /locations/${ var . region } /workflows/${ google_workflows_workflow . workflow . name } /executions"
125
- method = " POST"
126
- request_headers = {
127
- Accept = " application/json"
128
- Authorization = " Bearer ${ data . google_client_config . current . access_token } " }
129
- depends_on = [
130
- data . http . call_workflows_state_1 ]
131
- }
122
+ # data "http" "retry_workflows_1" {
123
+ # count = jsonencode( data.http.call_workflows_state_1) .executions[0].state == "SUCCEEDED" || data.http.call_workflows_state_1.executions[0].state == "ACTIVE" ? 0 : 1
124
+ # url = "https://workflowexecutions.googleapis.com/v1/projects/${module.project-services.project_id}/locations/${var.region}/workflows/${google_workflows_workflow.workflow.name}/executions"
125
+ # method = "POST"
126
+ # request_headers = {
127
+ # Accept = "application/json"
128
+ # Authorization = "Bearer ${data.google_client_config.current.access_token}" }
129
+ # depends_on = [
130
+ # data.http.call_workflows_state_1]
131
+ # }
132
132
133
133
# # Sleep for 30 seconds to recheck the workflow state
134
134
# resource "time_sleep" "wait_to_recheck_workflow" {
@@ -164,9 +164,9 @@ data "http" "retry_workflows_1" {
164
164
165
165
# Sleep for 120 seconds to allow the workflow to execute and finish setup
166
166
resource "time_sleep" "complete_workflow" {
167
- count = data. http . call_workflows_state_1 . executions [0 ]. state == " SUCCEEDED" ? 0 : 1
167
+ # count = data.http.call_workflows_state_1.executions[0].state == "SUCCEEDED" ? 0 : 1
168
168
create_duration = " 120s"
169
169
depends_on = [
170
- data . http . retry_workflows_1 ,
170
+ # data.http.retry_workflows_1,
171
171
]
172
172
}
0 commit comments