Skip to content

Commit

Permalink
Add Suport for google_cloud_run_Job to TGC (#10599)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvfons committed May 10, 2024
1 parent 000856e commit 53a7d7f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions mmv1/templates/tgc/resource_converters.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func ResourceConverters() map[string][]cai.ResourceConverter {
"google_access_context_manager_access_policy": {accesscontextmanager.ResourceConverterAccessContextManagerAccessPolicy()},
"google_cloud_run_service": {cloudrun.ResourceConverterCloudRunService()},
"google_cloud_run_domain_mapping": {cloudrun.ResourceConverterCloudRunDomainMapping()},
"google_cloud_run_v2_job": {cloudrunv2.ResourceConverterCloudRunV2Job()},
"google_cloudfunctions_function": {resourceConverterCloudFunctionsCloudFunction()},
"google_monitoring_notification_channel": {monitoring.ResourceConverterMonitoringNotificationChannel()},
"google_monitoring_alert_policy": {monitoring.ResourceConverterMonitoringAlertPolicy()},
Expand Down
26 changes: 26 additions & 0 deletions mmv1/third_party/tgc/tests/data/example_cloud_run_v2_job.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"name":"//run.googleapis.com/projects/{{.Provider.project}}/locations/us-central1/jobs/cloudrun-job",
"asset_type":"run.googleapis.com/Job",
"resource":{
"version":"v2",
"discovery_document_uri":"https://www.googleapis.com/discovery/v1/apis/run/v2/rest",
"discovery_name":"Job",
"parent":"//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
"data":{
"template":{
"template":{
"containers":[
{
"image":"us-docker.pkg.dev/cloudrun/container/hello"
}
],
"maxRetries":3
}
}
}
},
"ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}",
"ancestors": ["organizations/{{.OrgID}}"]
}
]
25 changes: 25 additions & 0 deletions mmv1/third_party/tgc/tests/data/example_cloud_run_v2_job.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
terraform {
required_providers {
google = {
source = "hashicorp/google-beta"
version = "~> {{.Provider.version}}"
}
}
}

provider "google" {
{{if .Provider.credentials }}credentials = "{{.Provider.credentials}}"{{end}}
}

resource "google_cloud_run_v2_job" "default" {
name = "cloudrun-job"
location = "us-central1"

template {
template {
containers {
image = "us-docker.pkg.dev/cloudrun/container/hello"
}
}
}
}

0 comments on commit 53a7d7f

Please sign in to comment.