Skip to content

Commit

Permalink
Merge branch 'GoogleCloudPlatform:main' into backupDisplayName
Browse files Browse the repository at this point in the history
  • Loading branch information
GauravJain21 authored Sep 15, 2023
2 parents b259895 + 6696d29 commit 8551b80
Show file tree
Hide file tree
Showing 40 changed files with 815 additions and 108 deletions.
33 changes: 33 additions & 0 deletions mmv1/products/cloudrunv2/Job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ examples:
vpc_access_connector_name: 'run-vpc'
vpc_compute_subnetwork_name: 'run-subnetwork'
compute_network_name: 'run-network'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_directvpc'
primary_resource_id: 'default'
primary_resource_name: "fmt.Sprintf(\"tf-test-cloudrun-job%s\", context[\"random_suffix\"\
])"
vars:
cloud_run_job_name: 'cloudrun-job'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_secret'
primary_resource_id: 'default'
Expand Down Expand Up @@ -645,6 +652,32 @@ properties:
values:
- :ALL_TRAFFIC
- :PRIVATE_RANGES_ONLY
default_from_api: true
- !ruby/object:Api::Type::Array
name: 'networkInterfaces'
description: |-
Direct VPC egress settings. Currently only single network interface is supported.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'network'
description: |-
The VPC network that the Cloud Run resource will be able to send traffic to. At least one of network or subnetwork must be specified. If both
network and subnetwork are specified, the given VPC subnetwork must belong to the given VPC network. If network is not specified, it will be
looked up from the subnetwork.
default_from_api: true
- !ruby/object:Api::Type::String
name: 'subnetwork'
description: |-
The VPC subnetwork that the Cloud Run resource will get IPs from. At least one of network or subnetwork must be specified. If both
network and subnetwork are specified, the given VPC subnetwork must belong to the given VPC network. If subnetwork is not specified, the
subnetwork with the same name with the network will be used.
default_from_api: true
- !ruby/object:Api::Type::Array
name: 'tags'
description: |-
Network tags applied to this Cloud Run job.
item_type: Api::Type::String
- !ruby/object:Api::Type::Integer
name: 'maxRetries'
description: |-
Expand Down
34 changes: 34 additions & 0 deletions mmv1/products/cloudrunv2/Service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ examples:
vpc_access_connector_name: 'run-vpc'
vpc_compute_subnetwork_name: 'run-subnetwork'
compute_network_name: 'run-network'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_service_directvpc'
primary_resource_id: 'default'
primary_resource_name: "fmt.Sprintf(\"tf-test-cloudrun-srv%s\",
context[\"random_suffix\"\
])"
vars:
cloud_run_service_name: 'cloudrun-service'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_service_probes'
primary_resource_id: 'default'
Expand Down Expand Up @@ -301,6 +309,32 @@ properties:
values:
- :ALL_TRAFFIC
- :PRIVATE_RANGES_ONLY
default_from_api: true
- !ruby/object:Api::Type::Array
name: 'networkInterfaces'
description: |-
Direct VPC egress settings. Currently only single network interface is supported.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'network'
description: |-
The VPC network that the Cloud Run resource will be able to send traffic to. At least one of network or subnetwork must be specified. If both
network and subnetwork are specified, the given VPC subnetwork must belong to the given VPC network. If network is not specified, it will be
looked up from the subnetwork.
default_from_api: true
- !ruby/object:Api::Type::String
name: 'subnetwork'
description: |-
The VPC subnetwork that the Cloud Run resource will get IPs from. At least one of network or subnetwork must be specified. If both
network and subnetwork are specified, the given VPC subnetwork must belong to the given VPC network. If subnetwork is not specified, the
subnetwork with the same name with the network will be used.
default_from_api: true
- !ruby/object:Api::Type::Array
name: 'tags'
description: |-
Network tags applied to this Cloud Run service.
item_type: Api::Type::String
- !ruby/object:Api::Type::String
name: 'timeout'
description: |-
Expand Down
6 changes: 3 additions & 3 deletions mmv1/products/networkservices/EdgeCacheService.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ async: !ruby/object:Api::OpAsync
base_url: '{{op_id}}'
wait_ms: 1000
timeouts: !ruby/object:Api::Timeouts
insert_minutes: 30
update_minutes: 30
delete_minutes: 30
insert_minutes: 60
update_minutes: 60
delete_minutes: 60
result: !ruby/object:Api::OpAsync::Result
path: 'response'
status: !ruby/object:Api::OpAsync::Status
Expand Down
26 changes: 26 additions & 0 deletions mmv1/templates/terraform/examples/cloudrunv2_job_directvpc.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['cloud_run_job_name'] %>"
location = "us-central1"
launch_stage = "BETA"
template {
template{
containers {
image = "us-docker.pkg.dev/cloudrun/container/job"
}
vpc_access {
network_interfaces {
network = "default"
subnetwork = "default"
tags = ["tag1", "tag2", "tag3"]
}
egress = "ALL_TRAFFIC"
}
}
}

lifecycle {
ignore_changes = [
launch_stage,
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['cloud_run_service_name'] %>"
location = "us-central1"
launch_stage = "BETA"
template {
containers {
image = "us-docker.pkg.dev/cloudrun/container/hello"
}
vpc_access{
network_interfaces {
network = "default"
subnetwork = "default"
tags = ["tag1", "tag2", "tag3"]
}
egress = "ALL_TRAFFIC"
}
}
}
8 changes: 4 additions & 4 deletions mmv1/third_party/terraform/go.mod.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
cloud.google.com/go/bigtable v1.19.0
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.50.0
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.51.0
github.com/apparentlymart/go-cidr v1.1.0
github.com/davecgh/go-spew v1.1.1
github.com/dnaeon/go-vcr v1.0.1
Expand All @@ -26,8 +26,8 @@ require (
github.com/sirupsen/logrus v1.8.1
golang.org/x/net v0.14.0
golang.org/x/oauth2 v0.11.0
google.golang.org/api v0.138.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577
google.golang.org/api v0.139.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
)
Expand Down Expand Up @@ -55,7 +55,7 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932 // indirect
github.com/google/s2a-go v0.1.5 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
Expand Down
Loading

0 comments on commit 8551b80

Please sign in to comment.