Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ doctor:
refresh-go:
cd mmv1;\
bundle exec compiler.rb -e terraform -o $(OUTPUT_PATH) -v $(VERSION) $(mmv1_compile) --go-yaml; \
go run . --yaml --template
go run . --yaml --template; \
go run . --yaml --handwritten
31 changes: 21 additions & 10 deletions mmv1/description-copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,24 @@ import (
"strings"
)

func CopyAllDescriptions() {
identifiers := []string{
"description:",
"note:",
"set_hash_func:",
"warning:",
"required_properties:",
"optional_properties:",
"attributes:",
}

for i, id := range identifiers {
CopyText(id, len(identifiers)-1 == i)
}
}

// Used to copy/paste text from Ruby -> Go YAML files
func CopyText(identifier string) {
func CopyText(identifier string, last bool) {
var allProductFiles []string = make([]string, 0)
files, err := filepath.Glob("products/**/go_product.yaml")
if err != nil {
Expand Down Expand Up @@ -92,16 +108,11 @@ func CopyText(identifier string) {
for scanner.Scan() {
line := scanner.Text()
if firstLine {
if line == "NOT CONVERTED - RUN YAML MODE" {
firstLine = false
w.WriteString(fmt.Sprintf("%s\n", "NOT CONVERTED #2 - RUN YAML MODE"))
continue
} else if line == "NOT CONVERTED #2 - RUN YAML MODE" {
firstLine = false
w.WriteString(fmt.Sprintf("%s\n", "NOT CONVERTED #3 - RUN YAML MODE"))
continue
} else if line == "NOT CONVERTED #3 - RUN YAML MODE" {
if strings.Contains(line, "NOT CONVERTED - RUN YAML MODE") {
firstLine = false
if !last {
w.WriteString(fmt.Sprintf("NOT CONVERTED - RUN YAML MODE\n"))
}
continue
} else {
break
Expand Down
4 changes: 1 addition & 3 deletions mmv1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ func main() {
flag.Parse()

if *yamlMode {
CopyText("description:")
CopyText("note:")
CopyText("set_hash_func:")
CopyAllDescriptions()
}

if *templateMode {
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/compute/Address.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ properties:
configure Private Service Connect. Only global internal addresses can use
this purpose.


This should only be set when using an Internal address.
default_from_api: true
- !ruby/object:Api::Type::Enum
Expand Down
2 changes: 0 additions & 2 deletions mmv1/products/compute/BackendService.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,6 @@ properties:
UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains
equal-weight.


This field is applicable to either:

* A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2,
Expand All @@ -844,7 +843,6 @@ properties:
Load Balancing). Only MAGLEV and WEIGHTED_MAGLEV values are possible for External
Network Load Balancing. The default is MAGLEV.


If session_affinity is not NONE, and this field is not set to MAGLEV, WEIGHTED_MAGLEV,
or RING_HASH, session affinity settings will not take effect.

Expand Down
3 changes: 0 additions & 3 deletions mmv1/products/compute/ForwardingRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ properties:
* When the `target` is a Private Service Connect Google APIs
bundle, you must specify an `IPAddress`.


Otherwise, you can optionally specify an IP address that references an
existing static (reserved) IP address resource. When omitted, Google Cloud
assigns an ephemeral IP address.
Expand All @@ -304,7 +303,6 @@ properties:
* `global/addresses/address-name`
* `address-name`


The forwarding rule's `target` or `backendService`,
and in most cases, also the `loadBalancingScheme`, determine the
type of IP address that you can use. For detailed information, see
Expand Down Expand Up @@ -494,7 +492,6 @@ properties:
* `vpc-sc` - [ APIs that support VPC Service Controls](https://cloud.google.com/vpc-service-controls/docs/supported-products).
* `all-apis` - [All supported Google APIs](https://cloud.google.com/vpc/docs/private-service-connect#supported-apis).


For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment.
update_verb: :POST
update_url: 'projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}/setTarget'
Expand Down
3 changes: 0 additions & 3 deletions mmv1/products/compute/GlobalForwardingRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ properties:
* When the `target` is a Private Service Connect Google APIs
bundle, you must specify an `IPAddress`.


Otherwise, you can optionally specify an IP address that references an
existing static (reserved) IP address resource. When omitted, Google Cloud
assigns an ephemeral IP address.
Expand All @@ -256,7 +255,6 @@ properties:
* `global/addresses/address-name`
* `address-name`


The forwarding rule's `target`,
and in most cases, also the `loadBalancingScheme`, determine the
type of IP address that you can use. For detailed information, see
Expand Down Expand Up @@ -479,7 +477,6 @@ properties:
* `vpc-sc` - [ APIs that support VPC Service Controls](https://cloud.google.com/vpc-service-controls/docs/supported-products).
* `all-apis` - [All supported Google APIs](https://cloud.google.com/vpc/docs/private-service-connect#supported-apis).


For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment.
update_verb: :POST
update_url: 'projects/{{project}}/global/forwardingRules/{{name}}/setTarget'
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/compute/HttpHealthCheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ description: |
An HttpHealthCheck resource. This resource defines a template for how
individual VMs should be checked for health, via HTTP.


~> **Note:** google_compute_http_health_check is a legacy health check.
The newer [google_compute_health_check](/docs/providers/google/r/compute_health_check.html)
should be preferred for all uses except
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/compute/HttpsHealthCheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ description: |
An HttpsHealthCheck resource. This resource defines a template for how
individual VMs should be checked for health, via HTTPS.


~> **Note:** google_compute_https_health_check is a legacy health check.
The newer [google_compute_health_check](/docs/providers/google/r/compute_health_check.html)
should be preferred for all uses except
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/compute/ManagedSslCertificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ properties:
characters must be a dash, lowercase letter, or digit, except the last
character, which cannot be a dash.


These are in the same namespace as the managed SSL certificates.
- !ruby/object:Api::Type::NestedObject
name: 'managed'
Expand Down
2 changes: 0 additions & 2 deletions mmv1/products/compute/RegionBackendService.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,6 @@ properties:
UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains
equal-weight.


This field is applicable to either:

* A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2,
Expand All @@ -852,7 +851,6 @@ properties:
Load Balancing). Only MAGLEV and WEIGHTED_MAGLEV values are possible for External
Network Load Balancing. The default is MAGLEV.


If session_affinity is not NONE, and this field is not set to MAGLEV, WEIGHTED_MAGLEV,
or RING_HASH, session affinity settings will not take effect.

Expand Down
1 change: 0 additions & 1 deletion mmv1/products/compute/RegionSslCertificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ properties:
characters must be a dash, lowercase letter, or digit, except the last
character, which cannot be a dash.


These are in the same namespace as the managed SSL certificates.
default_from_api: true
custom_expand: 'templates/terraform/custom_expand/name_or_name_prefix.go.erb'
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/compute/SslCertificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ properties:
characters must be a dash, lowercase letter, or digit, except the last
character, which cannot be a dash.


These are in the same namespace as the managed SSL certificates.
default_from_api: true
custom_expand: 'templates/terraform/custom_expand/name_or_name_prefix.go.erb'
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/compute/go_Address.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ properties:
configure Private Service Connect. Only global internal addresses can use
this purpose.


This should only be set when using an Internal address.
default_from_api: true
- name: 'networkTier'
Expand Down
2 changes: 0 additions & 2 deletions mmv1/products/compute/go_BackendService.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,6 @@ properties:
UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains
equal-weight.


This field is applicable to either:

* A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2,
Expand All @@ -830,7 +829,6 @@ properties:
Load Balancing). Only MAGLEV and WEIGHTED_MAGLEV values are possible for External
Network Load Balancing. The default is MAGLEV.


If session_affinity is not NONE, and this field is not set to MAGLEV, WEIGHTED_MAGLEV,
or RING_HASH, session affinity settings will not take effect.

Expand Down
6 changes: 3 additions & 3 deletions mmv1/products/compute/go_Firewall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ references:
'Official Documentation': 'https://cloud.google.com/vpc/docs/firewalls'
api: 'https://cloud.google.com/compute/docs/reference/v1/firewalls'
docs:
optional_properties: '* `enable_logging` - (Optional, Deprecated) This field denotes whether to enable logging for a particular firewall rule.
If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of `log_config`
'
optional_properties: |
* `enable_logging` - (Optional, Deprecated) This field denotes whether to enable logging for a particular firewall rule.
If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of `log_config`
base_url: 'projects/{{project}}/global/firewalls'
has_self_link: true
update_verb: 'PATCH'
Expand Down
3 changes: 0 additions & 3 deletions mmv1/products/compute/go_ForwardingRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ properties:
* When the `target` is a Private Service Connect Google APIs
bundle, you must specify an `IPAddress`.


Otherwise, you can optionally specify an IP address that references an
existing static (reserved) IP address resource. When omitted, Google Cloud
assigns an ephemeral IP address.
Expand All @@ -291,7 +290,6 @@ properties:
* `global/addresses/address-name`
* `address-name`


The forwarding rule's `target` or `backendService`,
and in most cases, also the `loadBalancingScheme`, determine the
type of IP address that you can use. For detailed information, see
Expand Down Expand Up @@ -476,7 +474,6 @@ properties:
* `vpc-sc` - [ APIs that support VPC Service Controls](https://cloud.google.com/vpc-service-controls/docs/supported-products).
* `all-apis` - [All supported Google APIs](https://cloud.google.com/vpc/docs/private-service-connect#supported-apis).


For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment.
update_url: 'projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}/setTarget'
update_verb: 'POST'
Expand Down
3 changes: 0 additions & 3 deletions mmv1/products/compute/go_GlobalForwardingRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ properties:
* When the `target` is a Private Service Connect Google APIs
bundle, you must specify an `IPAddress`.


Otherwise, you can optionally specify an IP address that references an
existing static (reserved) IP address resource. When omitted, Google Cloud
assigns an ephemeral IP address.
Expand All @@ -247,7 +246,6 @@ properties:
* `global/addresses/address-name`
* `address-name`


The forwarding rule's `target`,
and in most cases, also the `loadBalancingScheme`, determine the
type of IP address that you can use. For detailed information, see
Expand Down Expand Up @@ -467,7 +465,6 @@ properties:
* `vpc-sc` - [ APIs that support VPC Service Controls](https://cloud.google.com/vpc-service-controls/docs/supported-products).
* `all-apis` - [All supported Google APIs](https://cloud.google.com/vpc/docs/private-service-connect#supported-apis).


For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment.
required: true
update_url: 'projects/{{project}}/global/forwardingRules/{{name}}/setTarget'
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/compute/go_HttpHealthCheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ description: |
An HttpHealthCheck resource. This resource defines a template for how
individual VMs should be checked for health, via HTTP.


~> **Note:** google_compute_http_health_check is a legacy health check.
The newer [google_compute_health_check](/docs/providers/google/r/compute_health_check.html)
should be preferred for all uses except
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/compute/go_HttpsHealthCheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ description: |
An HttpsHealthCheck resource. This resource defines a template for how
individual VMs should be checked for health, via HTTPS.


~> **Note:** google_compute_https_health_check is a legacy health check.
The newer [google_compute_health_check](/docs/providers/google/r/compute_health_check.html)
should be preferred for all uses except
Expand Down
25 changes: 12 additions & 13 deletions mmv1/products/compute/go_ManagedSslCertificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ references:
'Official Documentation': 'https://cloud.google.com/load-balancing/docs/ssl-certificates'
api: 'https://cloud.google.com/compute/docs/reference/rest/v1/sslCertificates'
docs:
warning: 'This resource should be used with extreme caution! Provisioning an SSL
certificate is complex. Ensure that you understand the lifecycle of a
certificate before attempting complex tasks like cert rotation automatically.
This resource will "return" as soon as the certificate object is created,
but post-creation the certificate object will go through a "provisioning"
process. The provisioning process can complete only when the domain name
for which the certificate is created points to a target pool which, itself,
points at the certificate. Depending on your DNS provider, this may take
some time, and migrating from self-managed certificates to Google-managed
certificates may entail some downtime while the certificate provisions.
warning: |
This resource should be used with extreme caution! Provisioning an SSL
certificate is complex. Ensure that you understand the lifecycle of a
certificate before attempting complex tasks like cert rotation automatically.
This resource will "return" as soon as the certificate object is created,
but post-creation the certificate object will go through a "provisioning"
process. The provisioning process can complete only when the domain name
for which the certificate is created points to a target pool which, itself,
points at the certificate. Depending on your DNS provider, this may take
some time, and migrating from self-managed certificates to Google-managed
certificates may entail some downtime while the certificate provisions.

In conclusion: Be extremely cautious.
'
In conclusion: Be extremely cautious.
base_url: 'projects/{{project}}/global/sslCertificates'
has_self_link: true
immutable: true
Expand Down Expand Up @@ -107,7 +107,6 @@ properties:
characters must be a dash, lowercase letter, or digit, except the last
character, which cannot be a dash.


These are in the same namespace as the managed SSL certificates.
- name: 'managed'
type: NestedObject
Expand Down
2 changes: 0 additions & 2 deletions mmv1/products/compute/go_RegionBackendService.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,6 @@ properties:
UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains
equal-weight.


This field is applicable to either:

* A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2,
Expand All @@ -836,7 +835,6 @@ properties:
Load Balancing). Only MAGLEV and WEIGHTED_MAGLEV values are possible for External
Network Load Balancing. The default is MAGLEV.


If session_affinity is not NONE, and this field is not set to MAGLEV, WEIGHTED_MAGLEV,
or RING_HASH, session affinity settings will not take effect.

Expand Down
7 changes: 3 additions & 4 deletions mmv1/products/compute/go_RegionSslCertificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ references:
'Official Documentation': 'https://cloud.google.com/load-balancing/docs/ssl-certificates'
api: 'https://cloud.google.com/compute/docs/reference/rest/v1/regionSslCertificates'
docs:
optional_properties: '* `name_prefix` - (Optional) Creates a unique name beginning with the
specified prefix. Conflicts with `name`.
'
optional_properties: |
* `name_prefix` - (Optional) Creates a unique name beginning with the
specified prefix. Conflicts with `name`.
base_url: 'projects/{{project}}/regions/{{region}}/sslCertificates'
has_self_link: true
immutable: true
Expand Down Expand Up @@ -119,7 +119,6 @@ properties:
characters must be a dash, lowercase letter, or digit, except the last
character, which cannot be a dash.


These are in the same namespace as the managed SSL certificates.
default_from_api: true
custom_expand: 'templates/terraform/custom_expand/go/name_or_name_prefix.go.tmpl'
Expand Down
10 changes: 5 additions & 5 deletions mmv1/products/compute/go_Route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ references:
'Using Routes': 'https://cloud.google.com/vpc/docs/using-routes'
api: 'https://cloud.google.com/compute/docs/reference/rest/v1/routes'
docs:
optional_properties: '* `next_hop_instance_zone` - (Optional when `next_hop_instance` is
specified) The zone of the instance specified in
`next_hop_instance`. Omit if `next_hop_instance` is specified as
a URL.
'
optional_properties: |
* `next_hop_instance_zone` - (Optional when `next_hop_instance` is
specified) The zone of the instance specified in
`next_hop_instance`. Omit if `next_hop_instance` is specified as
a URL.
base_url: 'projects/{{project}}/global/routes'
has_self_link: true
immutable: true
Expand Down
Loading