Add execution/invocation commands to outputs
This commit is contained in:
committed by
Wiktor Niesiobędzki
parent
b73114c0a8
commit
62f789c249
@@ -410,10 +410,11 @@ module "cf-http" {
|
||||
| [function](outputs.tf#L29) | Cloud function resources. | |
|
||||
| [function_name](outputs.tf#L34) | Cloud function name. | |
|
||||
| [id](outputs.tf#L39) | Fully qualified function id. | |
|
||||
| [service_account](outputs.tf#L44) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L49) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L54) | Service account email. | |
|
||||
| [vpc_connector](outputs.tf#L62) | VPC connector resource if created. | |
|
||||
| [invoke_command](outputs.tf#L44) | Command to invoke Cloud Function. | |
|
||||
| [service_account](outputs.tf#L53) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L58) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L63) | Service account email. | |
|
||||
| [vpc_connector](outputs.tf#L71) | VPC connector resource if created. | |
|
||||
|
||||
## Fixtures
|
||||
|
||||
|
||||
@@ -41,6 +41,15 @@ output "id" {
|
||||
value = google_cloudfunctions_function.function.id
|
||||
}
|
||||
|
||||
output "invoke_command" {
|
||||
description = "Command to invoke Cloud Function."
|
||||
value = var.trigger_config != null ? null : <<-EOT
|
||||
curl -H "Authorization: bearer $(gcloud auth print-identity-token)" \
|
||||
${google_cloudfunctions_function.function.https_trigger_url} \
|
||||
-X POST -d 'data'
|
||||
EOT
|
||||
}
|
||||
|
||||
output "service_account" {
|
||||
description = "Service account resource."
|
||||
value = try(google_service_account.service_account[0], null)
|
||||
|
||||
@@ -343,14 +343,15 @@ module "cf-http" {
|
||||
| [function](outputs.tf#L29) | Cloud function resources. | |
|
||||
| [function_name](outputs.tf#L34) | Cloud function name. | |
|
||||
| [id](outputs.tf#L39) | Fully qualified function id. | |
|
||||
| [service_account](outputs.tf#L44) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L49) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L54) | Service account email. | |
|
||||
| [trigger_service_account](outputs.tf#L62) | Service account resource. | |
|
||||
| [trigger_service_account_email](outputs.tf#L67) | Service account email. | |
|
||||
| [trigger_service_account_iam_email](outputs.tf#L72) | Service account email. | |
|
||||
| [uri](outputs.tf#L80) | Cloud function service uri. | |
|
||||
| [vpc_connector](outputs.tf#L85) | VPC connector resource if created. | |
|
||||
| [invoke_command](outputs.tf#L44) | Command to invoke Cloud Run Function. | |
|
||||
| [service_account](outputs.tf#L53) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L58) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L63) | Service account email. | |
|
||||
| [trigger_service_account](outputs.tf#L71) | Service account resource. | |
|
||||
| [trigger_service_account_email](outputs.tf#L76) | Service account email. | |
|
||||
| [trigger_service_account_iam_email](outputs.tf#L81) | Service account email. | |
|
||||
| [uri](outputs.tf#L89) | Cloud function service uri. | |
|
||||
| [vpc_connector](outputs.tf#L94) | VPC connector resource if created. | |
|
||||
|
||||
## Fixtures
|
||||
|
||||
|
||||
@@ -41,6 +41,15 @@ output "id" {
|
||||
value = google_cloudfunctions2_function.function.id
|
||||
}
|
||||
|
||||
output "invoke_command" {
|
||||
description = "Command to invoke Cloud Run Function."
|
||||
value = var.trigger_config != null ? null : <<-EOT
|
||||
curl -H "Authorization: bearer $(gcloud auth print-identity-token)" \
|
||||
${google_cloudfunctions2_function.function.service_config[0].uri} \
|
||||
-X POST -d 'data'
|
||||
EOT
|
||||
}
|
||||
|
||||
output "service_account" {
|
||||
description = "Service account resource."
|
||||
value = try(google_service_account.service_account[0], null)
|
||||
|
||||
@@ -569,14 +569,15 @@ module "cloud_run" {
|
||||
| name | description | sensitive |
|
||||
|---|---|:---:|
|
||||
| [id](outputs.tf#L17) | Fully qualified job or service id. | |
|
||||
| [job](outputs.tf#L22) | Cloud Run Job. | |
|
||||
| [service](outputs.tf#L27) | Cloud Run Service. | |
|
||||
| [service_account](outputs.tf#L32) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L37) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L42) | Service account email. | |
|
||||
| [service_name](outputs.tf#L50) | Cloud Run service name. | |
|
||||
| [service_uri](outputs.tf#L55) | Main URI in which the service is serving traffic. | |
|
||||
| [vpc_connector](outputs.tf#L60) | VPC connector resource if created. | |
|
||||
| [invoke_command](outputs.tf#L22) | Command to invoke Cloud Run Service / submit job. | |
|
||||
| [job](outputs.tf#L36) | Cloud Run Job. | |
|
||||
| [service](outputs.tf#L41) | Cloud Run Service. | |
|
||||
| [service_account](outputs.tf#L46) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L51) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L56) | Service account email. | |
|
||||
| [service_name](outputs.tf#L64) | Cloud Run service name. | |
|
||||
| [service_uri](outputs.tf#L69) | Main URI in which the service is serving traffic. | |
|
||||
| [vpc_connector](outputs.tf#L74) | VPC connector resource if created. | |
|
||||
|
||||
## Fixtures
|
||||
|
||||
|
||||
@@ -19,6 +19,20 @@ output "id" {
|
||||
value = var.create_job ? google_cloud_run_v2_job.job[0].id : google_cloud_run_v2_service.service[0].id
|
||||
}
|
||||
|
||||
output "invoke_command" {
|
||||
description = "Command to invoke Cloud Run Service / submit job."
|
||||
value = (
|
||||
var.create_job ? <<-EOT
|
||||
gcloud run jobs execute --project ${var.project_id} --region ${var.region} --wait ${google_cloud_run_v2_job.job[0].name} --args=
|
||||
EOT
|
||||
: <<-EOT
|
||||
curl -H "Authorization: bearer $(gcloud auth print-identity-token)" \
|
||||
${google_cloud_run_v2_service.service[0].uri} \
|
||||
-X POST -d 'data'
|
||||
EOT
|
||||
)
|
||||
}
|
||||
|
||||
output "job" {
|
||||
description = "Cloud Run Job."
|
||||
value = var.create_job ? google_cloud_run_v2_job.job[0] : null
|
||||
|
||||
@@ -450,10 +450,11 @@ module "cloud_run" {
|
||||
| name | description | sensitive |
|
||||
|---|---|:---:|
|
||||
| [id](outputs.tf#L18) | Fully qualified service id. | |
|
||||
| [service](outputs.tf#L23) | Cloud Run service. | |
|
||||
| [service_account](outputs.tf#L28) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L33) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L38) | Service account email. | |
|
||||
| [service_name](outputs.tf#L46) | Cloud Run service name. | |
|
||||
| [vpc_connector](outputs.tf#L52) | VPC connector resource if created. | |
|
||||
| [invoke_command](outputs.tf#L23) | Command to invoke Cloud Run Service / submit job. | |
|
||||
| [service](outputs.tf#L32) | Cloud Run service. | |
|
||||
| [service_account](outputs.tf#L37) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L42) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L47) | Service account email. | |
|
||||
| [service_name](outputs.tf#L55) | Cloud Run service name. | |
|
||||
| [vpc_connector](outputs.tf#L61) | VPC connector resource if created. | |
|
||||
<!-- END TFDOC -->
|
||||
|
||||
@@ -20,6 +20,15 @@ output "id" {
|
||||
value = google_cloud_run_service.service.id
|
||||
}
|
||||
|
||||
output "invoke_command" {
|
||||
description = "Command to invoke Cloud Run Service / submit job."
|
||||
value = <<-EOT
|
||||
curl -H "Authorization: bearer $(gcloud auth print-identity-token)" \
|
||||
${google_cloud_run_service.service.status[0].url} \
|
||||
-X POST -d 'data'
|
||||
EOT
|
||||
}
|
||||
|
||||
output "service" {
|
||||
description = "Cloud Run service."
|
||||
value = google_cloud_run_service.service
|
||||
|
||||
@@ -953,12 +953,13 @@ module "sole-tenancy" {
|
||||
| [instance](outputs.tf#L36) | Instance resource. | ✓ |
|
||||
| [internal_ip](outputs.tf#L42) | Instance main interface internal IP address. | |
|
||||
| [internal_ips](outputs.tf#L50) | Instance interfaces internal IP addresses. | |
|
||||
| [self_link](outputs.tf#L58) | Instance self links. | |
|
||||
| [service_account](outputs.tf#L63) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L68) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L73) | Service account email. | |
|
||||
| [template](outputs.tf#L82) | Template resource. | |
|
||||
| [template_name](outputs.tf#L87) | Template name. | |
|
||||
| [login_command](outputs.tf#L58) | Command to SSH into the machine. | |
|
||||
| [self_link](outputs.tf#L63) | Instance self links. | |
|
||||
| [service_account](outputs.tf#L68) | Service account resource. | |
|
||||
| [service_account_email](outputs.tf#L73) | Service account email. | |
|
||||
| [service_account_iam_email](outputs.tf#L78) | Service account email. | |
|
||||
| [template](outputs.tf#L87) | Template resource. | |
|
||||
| [template_name](outputs.tf#L92) | Template name. | |
|
||||
|
||||
## Fixtures
|
||||
|
||||
|
||||
@@ -55,6 +55,11 @@ output "internal_ips" {
|
||||
]
|
||||
}
|
||||
|
||||
output "login_command" {
|
||||
description = "Command to SSH into the machine."
|
||||
value = "gcloud compute ssh --project ${var.project_id} --zone ${var.zone} ${var.name}"
|
||||
}
|
||||
|
||||
output "self_link" {
|
||||
description = "Instance self links."
|
||||
value = try(google_compute_instance.default[0].self_link, null)
|
||||
|
||||
Reference in New Issue
Block a user