Skip to content

Instantly share code, notes, and snippets.

@muresan
Last active June 8, 2022 12:21
Show Gist options
  • Save muresan/7c1aca765407eb9fb6611e1c02c8aaab to your computer and use it in GitHub Desktop.
Save muresan/7c1aca765407eb9fb6611e1c02c8aaab to your computer and use it in GitHub Desktop.
git magic-modules diff
diff --git a/google/resource_compute_forwarding_rule.go b/google/resource_compute_forwarding_rule.go
index 45581e30e..024e53d6e 100644
--- a/google/resource_compute_forwarding_rule.go
+++ b/google/resource_compute_forwarding_rule.go
@@ -1,30 +1,27 @@
// ----------------------------------------------------------------------------
//
-// *** AUTO GENERATED CODE *** Type: DCL ***
+// *** AUTO GENERATED CODE *** Type: MMv1 ***
//
// ----------------------------------------------------------------------------
//
-// This file is managed by Magic Modules (https://github.com/GoogleCloudPlatform/magic-modules)
-// and is based on the DCL (https://github.com/GoogleCloudPlatform/declarative-resource-client-library).
-// Changes will need to be made to the DCL or Magic Modules instead of here.
+// This file is automatically generated by Magic Modules and manual
+// changes will be clobbered when the file is regenerated.
//
-// We are not currently able to accept contributions to this file. If changes
-// are required, please file an issue at https://github.com/hashicorp/terraform-provider-google/issues/new/choose
+// Please read more about how to change this file in
+// .github/CONTRIBUTING.md.
//
// ----------------------------------------------------------------------------
package google
import (
- "context"
"fmt"
"log"
+ "reflect"
+ "strings"
"time"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
-
- dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
- compute "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/compute"
)
func resourceComputeForwardingRule() *schema.Resource {
@@ -46,278 +43,445 @@ func resourceComputeForwardingRule() *schema.Resource {
Schema: map[string]*schema.Schema{
"name": {
- Type: schema.TypeString,
- Required: true,
- ForceNew: true,
- Description: "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- },
-
- "all_ports": {
- Type: schema.TypeBool,
- Optional: true,
- ForceNew: true,
- Description: "This field is used along with the `backend_service` field for internal load balancing or with the `target` field for internal TargetInstance. This field cannot be used with `port` or `portRange` fields. When the load balancing scheme is `INTERNAL` and protocol is TCP/UDP, specify this field to allow packets addressed to any ports will be forwarded to the backends configured with this forwarding rule.",
- },
-
- "allow_global_access": {
- Type: schema.TypeBool,
- Optional: true,
- Description: "This field is used along with the `backend_service` field for internal load balancing or with the `target` field for internal TargetInstance. If the field is set to `TRUE`, clients can access ILB from all regions. Otherwise only allows access from clients in the same region as the internal load balancer.",
- },
-
- "backend_service": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- DiffSuppressFunc: compareSelfLinkOrResourceName,
- Description: "This field is only used for `INTERNAL` load balancing. For internal load balancing, this field identifies the BackendService resource to receive the matched traffic.",
- },
-
- "description": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- Description: "An optional description of this resource. Provide this property when you create the resource.",
+ Type: schema.TypeString,
+ Required: true,
+ ForceNew: true,
+ Description: `Name of the resource; provided by the client when the resource is
+created. The name must be 1-63 characters long, and comply with
+RFC1035. Specifically, the name must be 1-63 characters long and match
+the regular expression '[a-z]([-a-z0-9]*[a-z0-9])?' which means the
+first character must be a lowercase letter, and all following
+characters must be a dash, lowercase letter, or digit, except the last
+character, which cannot be a dash.`,
},
-
"ip_address": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
DiffSuppressFunc: internalIpDiffSuppress,
- Description: "IP address that this forwarding rule serves. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the target that you specify in the forwarding rule. If you don't specify a reserved IP address, an ephemeral IP address is assigned. Methods for specifying an IP address: * IPv4 dotted decimal, as in `100.1.2.3` * Full URL, as in `https://www.googleapis.com/compute/v1/projects/project_id/regions/region/addresses/address-name` * Partial URL or by name, as in: * `projects/project_id/regions/region/addresses/address-name` * `regions/region/addresses/address-name` * `global/addresses/address-name` * `address-name` The loadBalancingScheme and the forwarding rule's target determine the type of IP address that you can use. For detailed information, refer to [IP address specifications](/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications).",
+ Description: `The IP address that this forwarding rule serves. When a client sends
+traffic to this IP address, the forwarding rule directs the traffic to
+the target that you specify in the forwarding rule. The
+loadBalancingScheme and the forwarding rule's target determine the
+type of IP address that you can use. For detailed information, refer
+to [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications).
+
+An address can be specified either by a literal IP address or a
+reference to an existing Address resource. If you don't specify a
+reserved IP address, an ephemeral IP address is assigned.
+
+The value must be set to 0.0.0.0 when the target is a targetGrpcProxy
+that has validateForProxyless field set to true.
+
+For Private Service Connect forwarding rules that forward traffic to
+Google APIs, IP address must be provided.`,
},
-
"ip_protocol": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
+ ValidateFunc: validateEnum([]string{"TCP", "UDP", "ESP", "AH", "SCTP", "ICMP", "L3_DEFAULT", ""}),
DiffSuppressFunc: caseDiffSuppress,
- Description: "The IP protocol to which this rule applies. For protocol forwarding, valid options are `TCP`, `UDP`, `ESP`, `AH`, `SCTP` or `ICMP`. For Internal TCP/UDP Load Balancing, the load balancing scheme is `INTERNAL`, and one of `TCP` or `UDP` are valid. For Traffic Director, the load balancing scheme is `INTERNAL_SELF_MANAGED`, and only `TCP`is valid. For Internal HTTP(S) Load Balancing, the load balancing scheme is `INTERNAL_MANAGED`, and only `TCP` is valid. For HTTP(S), SSL Proxy, and TCP Proxy Load Balancing, the load balancing scheme is `EXTERNAL` and only `TCP` is valid. For Network TCP/UDP Load Balancing, the load balancing scheme is `EXTERNAL`, and one of `TCP` or `UDP` is valid.",
- },
+ Description: `The IP protocol to which this rule applies.
- "is_mirroring_collector": {
- Type: schema.TypeBool,
- Optional: true,
- ForceNew: true,
- Description: "Indicates whether or not this load balancer can be used as a collector for packet mirroring. To prevent mirroring loops, instances behind this load balancer will not have their traffic mirrored even if a `PacketMirroring` rule applies to them. This can only be set to true for load balancers that have their `loadBalancingScheme` set to `INTERNAL`.",
+When the load balancing scheme is INTERNAL, only TCP and UDP are
+valid. Possible values: ["TCP", "UDP", "ESP", "AH", "SCTP", "ICMP", "L3_DEFAULT"]`,
},
-
- "labels": {
- Type: schema.TypeMap,
- Optional: true,
- Description: "Labels to apply to this rule.",
- Elem: &schema.Schema{Type: schema.TypeString},
+ "all_ports": {
+ Type: schema.TypeBool,
+ Optional: true,
+ ForceNew: true,
+ Description: `This field can be used with internal load balancer or network load balancer
+when the forwarding rule references a backend service, or with the target
+field when it references a TargetInstance. Set this to true to
+allow packets addressed to any ports to be forwarded to the backends configured
+with this forwarding rule. This can be used when the protocol is TCP/UDP, and it
+must be set to true when the protocol is set to L3_DEFAULT.
+Cannot be set if port or portRange are set.`,
+ },
+ "allow_global_access": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: `If true, clients can access ILB from all regions.
+Otherwise only allows from the local region the ILB is located at.`,
+ },
+ "backend_service": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ DiffSuppressFunc: compareSelfLinkOrResourceName,
+ Description: `A BackendService to receive the matched traffic. This is used only
+for INTERNAL load balancing.`,
+ },
+ "description": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ Description: `An optional description of this resource. Provide this property when
+you create the resource.`,
+ },
+ "is_mirroring_collector": {
+ Type: schema.TypeBool,
+ Optional: true,
+ ForceNew: true,
+ Description: `Indicates whether or not this load balancer can be used
+as a collector for packet mirroring. To prevent mirroring loops,
+instances behind this load balancer will not have their traffic
+mirrored even if a PacketMirroring rule applies to them. This
+can only be set to true for load balancers that have their
+loadBalancingScheme set to INTERNAL.`,
},
-
"load_balancing_scheme": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- Description: "Specifies the forwarding rule type.\n\n* `EXTERNAL` is used for:\n * Classic Cloud VPN gateways\n * Protocol forwarding to VMs from an external IP address\n * The following load balancers: HTTP(S), SSL Proxy, TCP Proxy, and Network TCP/UDP\n* `INTERNAL` is used for:\n * Protocol forwarding to VMs from an internal IP address\n * Internal TCP/UDP load balancers\n* `INTERNAL_MANAGED` is used for:\n * Internal HTTP(S) load balancers\n* `INTERNAL_SELF_MANAGED` is used for:\n * Traffic Director\n* `EXTERNAL_MANAGED` is used for:\n * Global external HTTP(S) load balancers \n\nFor more information about forwarding rules, refer to [Forwarding rule concepts](/load-balancing/docs/forwarding-rule-concepts). Possible values: INVALID, INTERNAL, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED, EXTERNAL, EXTERNAL_MANAGED",
- Default: "EXTERNAL",
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ ValidateFunc: validateEnum([]string{"EXTERNAL", "EXTERNAL_MANAGED", "INTERNAL", "INTERNAL_MANAGED", ""}),
+ Description: `This signifies what the ForwardingRule will be used for and can be
+EXTERNAL, EXTERNAL_MANAGED, INTERNAL, or INTERNAL_MANAGED. EXTERNAL is used for Classic
+Cloud VPN gateways, protocol forwarding to VMs from an external IP address,
+and HTTP(S), SSL Proxy, TCP Proxy, and Network TCP/UDP load balancers.
+INTERNAL is used for protocol forwarding to VMs from an internal IP address,
+and internal TCP/UDP load balancers.
+EXTERNAL_MANAGED is used for regional external HTTP(S) load balancers.
+INTERNAL_MANAGED is used for internal HTTP(S) load balancers. Default value: "EXTERNAL" Possible values: ["EXTERNAL", "EXTERNAL_MANAGED", "INTERNAL", "INTERNAL_MANAGED"]`,
+ Default: "EXTERNAL",
},
-
"network": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
DiffSuppressFunc: compareSelfLinkOrResourceName,
- Description: "This field is not used for external load balancing. For `INTERNAL` and `INTERNAL_SELF_MANAGED` load balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is not specified, the default network will be used.",
+ Description: `For internal load balancing, this field identifies the network that
+the load balanced IP should belong to for this Forwarding Rule. If
+this field is not specified, the default network will be used.
+This field is only used for INTERNAL load balancing.`,
},
-
"network_tier": {
- Type: schema.TypeString,
- Computed: true,
- Optional: true,
- ForceNew: true,
- Description: "This signifies the networking tier used for configuring this load balancer and can only take the following values: `PREMIUM`, `STANDARD`. For regional ForwardingRule, the valid values are `PREMIUM` and `STANDARD`. For GlobalForwardingRule, the valid value is `PREMIUM`. If this field is not specified, it is assumed to be `PREMIUM`. If `IPAddress` is specified, this value must be equal to the networkTier of the Address.",
+ Type: schema.TypeString,
+ Computed: true,
+ Optional: true,
+ ForceNew: true,
+ ValidateFunc: validateEnum([]string{"PREMIUM", "STANDARD", ""}),
+ Description: `The networking tier used for configuring this address. If this field is not
+specified, it is assumed to be PREMIUM. Possible values: ["PREMIUM", "STANDARD"]`,
},
-
"port_range": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
DiffSuppressFunc: portRangeDiffSuppress,
- Description: "When the load balancing scheme is `EXTERNAL`, `INTERNAL_SELF_MANAGED` and `INTERNAL_MANAGED`, you can specify a `port_range`. Use with a forwarding rule that points to a target proxy or a target pool. Do not use with a forwarding rule that points to a backend service. This field is used along with the `target` field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. Applicable only when `IPProtocol` is `TCP`, `UDP`, or `SCTP`, only packets addressed to ports in the specified range will be forwarded to `target`. Forwarding rules with the same `[IPAddress, IPProtocol]` pair must have disjoint port ranges. Some types of forwarding target have constraints on the acceptable ports:\n\n* TargetHttpProxy: 80, 8080\n* TargetHttpsProxy: 443\n* TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222\n* TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222\n* TargetVpnGateway: 500, 4500\n\n@pattern: d+(?:-d+)?",
+ Description: `This field is used along with the target field for TargetHttpProxy,
+TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway,
+TargetPool, TargetInstance.
+
+Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
+addressed to ports in the specified range will be forwarded to target.
+Forwarding rules with the same [IPAddress, IPProtocol] pair must have
+disjoint port ranges.
+
+Some types of forwarding target have constraints on the acceptable
+ports:
+
+* TargetHttpProxy: 80, 8080
+* TargetHttpsProxy: 443
+* TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
+ 1883, 5222
+* TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
+ 1883, 5222
+* TargetVpnGateway: 500, 4500`,
},
-
"ports": {
- Type: schema.TypeSet,
- Optional: true,
- ForceNew: true,
- Description: "This field is used along with the `backend_service` field for internal load balancing. When the load balancing scheme is `INTERNAL`, a list of ports can be configured, for example, ['80'], ['8000','9000']. Only packets addressed to these ports are forwarded to the backends configured with the forwarding rule. If the forwarding rule's loadBalancingScheme is INTERNAL, you can specify ports in one of the following ways: * A list of up to five ports, which can be non-contiguous * Keyword `ALL`, which causes the forwarding rule to forward traffic on any port of the forwarding rule's protocol. @pattern: d+(?:-d+)? For more information, refer to [Port specifications](/load-balancing/docs/forwarding-rule-concepts#port_specifications).",
- MaxItems: 5,
- Elem: &schema.Schema{Type: schema.TypeString},
- Set: schema.HashString,
- },
-
- "project": {
- Type: schema.TypeString,
- Computed: true,
- Optional: true,
- ForceNew: true,
- DiffSuppressFunc: compareSelfLinkOrResourceName,
- Description: "The project this resource belongs in.",
+ Type: schema.TypeSet,
+ Optional: true,
+ ForceNew: true,
+ Description: `This field is used along with internal load balancing and network
+load balancer when the forwarding rule references a backend service
+and when protocol is not L3_DEFAULT.
+
+A single port or a comma separated list of ports can be configured.
+Only packets addressed to these ports will be forwarded to the backends
+configured with this forwarding rule.
+
+You can only use one of ports and portRange, or allPorts.
+The three are mutually exclusive.
+
+You may specify a maximum of up to 5 ports, which can be non-contiguous.`,
+ MaxItems: 5,
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ },
+ Set: schema.HashString,
},
-
"region": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
DiffSuppressFunc: compareSelfLinkOrResourceName,
- Description: "The location of this resource.",
+ Description: `A reference to the region where the regional forwarding rule resides.
+This field is not applicable to global forwarding rules.`,
},
-
"service_directory_registrations": {
- Type: schema.TypeList,
- Computed: true,
- Optional: true,
- ForceNew: true,
- Description: "Service Directory resources to register this forwarding rule with. Currently, only supports a single Service Directory resource.",
- Elem: ComputeForwardingRuleServiceDirectoryRegistrationsSchema(),
+ Type: schema.TypeList,
+ Optional: true,
+ ForceNew: true,
+ Description: `Service Directory resources to register this forwarding rule with. Currently,
+only supports a single Service Directory resource.`,
+ MinItems: 0,
+ MaxItems: 1,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "namespace": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ Description: `Service Directory namespace to register the forwarding rule under.`,
+ },
+ "service": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ Description: `Service Directory service to register the forwarding rule under.`,
+ },
+ },
+ },
},
-
"service_label": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
- Description: "An optional prefix to the service name for this Forwarding Rule. If specified, the prefix is the first label of the fully qualified service name. The label must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Specifically, the label must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. This field is only used for internal load balancing.",
ValidateFunc: validateGCPName,
+ Description: `An optional prefix to the service name for this Forwarding Rule.
+If specified, will be the first label of the fully qualified service
+name.
+
+The label must be 1-63 characters long, and comply with RFC1035.
+Specifically, the label must be 1-63 characters long and match the
+regular expression '[a-z]([-a-z0-9]*[a-z0-9])?' which means the first
+character must be a lowercase letter, and all following characters
+must be a dash, lowercase letter, or digit, except the last
+character, which cannot be a dash.
+
+This field is only used for INTERNAL load balancing.`,
},
-
"subnetwork": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
DiffSuppressFunc: compareSelfLinkOrResourceName,
- Description: "This field is only used for `INTERNAL` load balancing. For internal load balancing, this field identifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule. If the network specified is in auto subnet mode, this field is optional. However, if the network is in custom subnet mode, a subnetwork must be specified.",
- },
+ Description: `The subnetwork that the load balanced IP should belong to for this
+Forwarding Rule. This field is only used for INTERNAL load balancing.
+If the network specified is in auto subnet mode, this field is
+optional. However, if the network is in custom subnet mode, a
+subnetwork must be specified.`,
+ },
"target": {
Type: schema.TypeString,
Optional: true,
DiffSuppressFunc: compareSelfLinkRelativePaths,
- Description: "The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate to the target object. For `INTERNAL_SELF_MANAGED` load balancing, only `targetHttpProxy` is valid, not `targetHttpsProxy`.",
+ Description: `The URL of the target resource to receive the matched traffic.
+The target must live in the same region as the forwarding rule.
+The forwarded traffic must be of a type appropriate to the target
+object.`,
},
-
"creation_timestamp": {
Type: schema.TypeString,
Computed: true,
- Description: "[Output Only] Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.",
+ Description: `Creation timestamp in RFC3339 text format.`,
},
-
- "label_fingerprint": {
+ "psc_connection_id": {
Type: schema.TypeString,
Computed: true,
- Description: "Used internally during label updates.",
+ Description: `The PSC connection id of the PSC Forwarding Rule in uint64 format.`,
},
-
- "self_link": {
- Type: schema.TypeString,
- Computed: true,
- Description: "[Output Only] Server-defined URL for the resource.",
+ "psc_connection_status": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: `The PSC connection status, can be one of the following: ACCEPTED, CLOSED, PENDING,
+REJECTED, STATUS_UNSPECIFIED, UNDEFINED_PSC_CONNECTION_STATUS.`,
},
-
"service_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "[Output Only] The internal fully qualified service name for this Forwarding Rule. This field is only used for internal load balancing.",
+ Type: schema.TypeString,
+ Computed: true,
+ Description: `The internal fully qualified service name for this Forwarding Rule.
+This field is only used for INTERNAL load balancing.`,
},
- },
- }
-}
-
-func ComputeForwardingRuleServiceDirectoryRegistrationsSchema() *schema.Resource {
- return &schema.Resource{
- Schema: map[string]*schema.Schema{
- "namespace": {
- Type: schema.TypeString,
- Computed: true,
- Optional: true,
- ForceNew: true,
- Description: "Service Directory namespace to register the forwarding rule under.",
+ "project": {
+ Type: schema.TypeString,
+ Optional: true,
+ Computed: true,
+ ForceNew: true,
},
-
- "service": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- Description: "Service Directory service to register the forwarding rule under.",
+ "self_link": {
+ Type: schema.TypeString,
+ Computed: true,
},
},
+ UseJSONNumber: true,
}
}
func resourceComputeForwardingRuleCreate(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
- project, err := getProject(d, config)
+ userAgent, err := generateUserAgentString(d, config.userAgent)
if err != nil {
return err
}
- region, err := getRegion(d, config)
+
+ obj := make(map[string]interface{})
+ isMirroringCollectorProp, err := expandComputeForwardingRuleIsMirroringCollector(d.Get("is_mirroring_collector"), d, config)
if err != nil {
return err
+ } else if v, ok := d.GetOkExists("is_mirroring_collector"); !isEmptyValue(reflect.ValueOf(isMirroringCollectorProp)) && (ok || !reflect.DeepEqual(v, isMirroringCollectorProp)) {
+ obj["isMirroringCollector"] = isMirroringCollectorProp
}
-
- obj := &compute.ForwardingRule{
- Name: dcl.String(d.Get("name").(string)),
- AllPorts: dcl.Bool(d.Get("all_ports").(bool)),
- AllowGlobalAccess: dcl.Bool(d.Get("allow_global_access").(bool)),
- BackendService: dcl.String(d.Get("backend_service").(string)),
- Description: dcl.String(d.Get("description").(string)),
- IPAddress: dcl.StringOrNil(d.Get("ip_address").(string)),
- IPProtocol: compute.ForwardingRuleIPProtocolEnumRef(d.Get("ip_protocol").(string)),
- IsMirroringCollector: dcl.Bool(d.Get("is_mirroring_collector").(bool)),
- Labels: checkStringMap(d.Get("labels")),
- LoadBalancingScheme: compute.ForwardingRuleLoadBalancingSchemeEnumRef(d.Get("load_balancing_scheme").(string)),
- Network: dcl.StringOrNil(d.Get("network").(string)),
- NetworkTier: compute.ForwardingRuleNetworkTierEnumRef(d.Get("network_tier").(string)),
- PortRange: dcl.String(d.Get("port_range").(string)),
- Ports: expandStringArray(d.Get("ports")),
- Project: dcl.String(project),
- Location: dcl.String(region),
- ServiceDirectoryRegistrations: expandComputeForwardingRuleServiceDirectoryRegistrationsArray(d.Get("service_directory_registrations")),
- ServiceLabel: dcl.String(d.Get("service_label").(string)),
- Subnetwork: dcl.StringOrNil(d.Get("subnetwork").(string)),
- Target: dcl.String(d.Get("target").(string)),
- }
-
- id, err := replaceVarsForId(d, config, "projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}")
- if err != nil {
- return fmt.Errorf("error constructing id: %s", err)
+ descriptionProp, err := expandComputeForwardingRuleDescription(d.Get("description"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
+ obj["description"] = descriptionProp
}
- d.SetId(id)
- createDirective := CreateDirective
- userAgent, err := generateUserAgentString(d, config.userAgent)
+ IPAddressProp, err := expandComputeForwardingRuleIPAddress(d.Get("ip_address"), d, config)
if err != nil {
return err
+ } else if v, ok := d.GetOkExists("ip_address"); !isEmptyValue(reflect.ValueOf(IPAddressProp)) && (ok || !reflect.DeepEqual(v, IPAddressProp)) {
+ obj["IPAddress"] = IPAddressProp
}
- billingProject := project
+ IPProtocolProp, err := expandComputeForwardingRuleIPProtocol(d.Get("ip_protocol"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("ip_protocol"); !isEmptyValue(reflect.ValueOf(IPProtocolProp)) && (ok || !reflect.DeepEqual(v, IPProtocolProp)) {
+ obj["IPProtocol"] = IPProtocolProp
+ }
+ backendServiceProp, err := expandComputeForwardingRuleBackendService(d.Get("backend_service"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("backend_service"); !isEmptyValue(reflect.ValueOf(backendServiceProp)) && (ok || !reflect.DeepEqual(v, backendServiceProp)) {
+ obj["backendService"] = backendServiceProp
+ }
+ loadBalancingSchemeProp, err := expandComputeForwardingRuleLoadBalancingScheme(d.Get("load_balancing_scheme"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("load_balancing_scheme"); !isEmptyValue(reflect.ValueOf(loadBalancingSchemeProp)) && (ok || !reflect.DeepEqual(v, loadBalancingSchemeProp)) {
+ obj["loadBalancingScheme"] = loadBalancingSchemeProp
+ }
+ nameProp, err := expandComputeForwardingRuleName(d.Get("name"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
+ obj["name"] = nameProp
+ }
+ networkProp, err := expandComputeForwardingRuleNetwork(d.Get("network"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(networkProp)) && (ok || !reflect.DeepEqual(v, networkProp)) {
+ obj["network"] = networkProp
+ }
+ portRangeProp, err := expandComputeForwardingRulePortRange(d.Get("port_range"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("port_range"); !isEmptyValue(reflect.ValueOf(portRangeProp)) && (ok || !reflect.DeepEqual(v, portRangeProp)) {
+ obj["portRange"] = portRangeProp
+ }
+ portsProp, err := expandComputeForwardingRulePorts(d.Get("ports"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("ports"); !isEmptyValue(reflect.ValueOf(portsProp)) && (ok || !reflect.DeepEqual(v, portsProp)) {
+ obj["ports"] = portsProp
+ }
+ subnetworkProp, err := expandComputeForwardingRuleSubnetwork(d.Get("subnetwork"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("subnetwork"); !isEmptyValue(reflect.ValueOf(subnetworkProp)) && (ok || !reflect.DeepEqual(v, subnetworkProp)) {
+ obj["subnetwork"] = subnetworkProp
+ }
+ targetProp, err := expandComputeForwardingRuleTarget(d.Get("target"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("target"); !isEmptyValue(reflect.ValueOf(targetProp)) && (ok || !reflect.DeepEqual(v, targetProp)) {
+ obj["target"] = targetProp
+ }
+ allowGlobalAccessProp, err := expandComputeForwardingRuleAllowGlobalAccess(d.Get("allow_global_access"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("allow_global_access"); ok || !reflect.DeepEqual(v, allowGlobalAccessProp) {
+ obj["allowGlobalAccess"] = allowGlobalAccessProp
+ }
+ allPortsProp, err := expandComputeForwardingRuleAllPorts(d.Get("all_ports"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("all_ports"); !isEmptyValue(reflect.ValueOf(allPortsProp)) && (ok || !reflect.DeepEqual(v, allPortsProp)) {
+ obj["allPorts"] = allPortsProp
+ }
+ networkTierProp, err := expandComputeForwardingRuleNetworkTier(d.Get("network_tier"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("network_tier"); !isEmptyValue(reflect.ValueOf(networkTierProp)) && (ok || !reflect.DeepEqual(v, networkTierProp)) {
+ obj["networkTier"] = networkTierProp
+ }
+ serviceDirectoryRegistrationsProp, err := expandComputeForwardingRuleServiceDirectoryRegistrations(d.Get("service_directory_registrations"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("service_directory_registrations"); !isEmptyValue(reflect.ValueOf(serviceDirectoryRegistrationsProp)) && (ok || !reflect.DeepEqual(v, serviceDirectoryRegistrationsProp)) {
+ obj["serviceDirectoryRegistrations"] = serviceDirectoryRegistrationsProp
+ }
+ serviceLabelProp, err := expandComputeForwardingRuleServiceLabel(d.Get("service_label"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("service_label"); !isEmptyValue(reflect.ValueOf(serviceLabelProp)) && (ok || !reflect.DeepEqual(v, serviceLabelProp)) {
+ obj["serviceLabel"] = serviceLabelProp
+ }
+ regionProp, err := expandComputeForwardingRuleRegion(d.Get("region"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(regionProp)) && (ok || !reflect.DeepEqual(v, regionProp)) {
+ obj["region"] = regionProp
+ }
+
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/regions/{{region}}/forwardingRules")
+ if err != nil {
+ return err
+ }
+
+ log.Printf("[DEBUG] Creating new ForwardingRule: %#v", obj)
+ billingProject := ""
+
+ project, err := getProject(d, config)
+ if err != nil {
+ return fmt.Errorf("Error fetching project for ForwardingRule: %s", err)
+ }
+ billingProject = project
+
// err == nil indicates that the billing_project value was found
if bp, err := getBillingProject(d, config); err == nil {
billingProject = bp
}
- client := NewDCLComputeClient(config, userAgent, billingProject, d.Timeout(schema.TimeoutCreate))
- if bp, err := replaceVars(d, config, client.Config.BasePath); err != nil {
- d.SetId("")
- return fmt.Errorf("Could not format %q: %w", client.Config.BasePath, err)
- } else {
- client.Config.BasePath = bp
+
+ res, err := sendRequestWithTimeout(config, "POST", billingProject, url, userAgent, obj, d.Timeout(schema.TimeoutCreate))
+ if err != nil {
+ return fmt.Errorf("Error creating ForwardingRule: %s", err)
+ }
+
+ // Store the ID now
+ id, err := replaceVars(d, config, "projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}")
+ if err != nil {
+ return fmt.Errorf("Error constructing id: %s", err)
}
- res, err := client.ApplyForwardingRule(context.Background(), obj, createDirective...)
+ d.SetId(id)
- if _, ok := err.(dcl.DiffAfterApplyError); ok {
- log.Printf("[DEBUG] Diff after apply returned from the DCL: %s", err)
- } else if err != nil {
+ err = computeOperationWaitTime(
+ config, res, project, "Creating ForwardingRule", userAgent,
+ d.Timeout(schema.TimeoutCreate))
+
+ if err != nil {
// The resource didn't actually create
d.SetId("")
- return fmt.Errorf("Error creating ForwardingRule: %s", err)
+ return fmt.Errorf("Error waiting to create ForwardingRule: %s", err)
}
log.Printf("[DEBUG] Finished creating ForwardingRule %q: %#v", d.Id(), res)
@@ -327,263 +491,249 @@ func resourceComputeForwardingRuleCreate(d *schema.ResourceData, meta interface{
func resourceComputeForwardingRuleRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
- project, err := getProject(d, config)
+ userAgent, err := generateUserAgentString(d, config.userAgent)
if err != nil {
return err
}
- region, err := getRegion(d, config)
+
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}")
if err != nil {
return err
}
- obj := &compute.ForwardingRule{
- Name: dcl.String(d.Get("name").(string)),
- AllPorts: dcl.Bool(d.Get("all_ports").(bool)),
- AllowGlobalAccess: dcl.Bool(d.Get("allow_global_access").(bool)),
- BackendService: dcl.String(d.Get("backend_service").(string)),
- Description: dcl.String(d.Get("description").(string)),
- IPAddress: dcl.StringOrNil(d.Get("ip_address").(string)),
- IPProtocol: compute.ForwardingRuleIPProtocolEnumRef(d.Get("ip_protocol").(string)),
- IsMirroringCollector: dcl.Bool(d.Get("is_mirroring_collector").(bool)),
- Labels: checkStringMap(d.Get("labels")),
- LoadBalancingScheme: compute.ForwardingRuleLoadBalancingSchemeEnumRef(d.Get("load_balancing_scheme").(string)),
- Network: dcl.StringOrNil(d.Get("network").(string)),
- NetworkTier: compute.ForwardingRuleNetworkTierEnumRef(d.Get("network_tier").(string)),
- PortRange: dcl.String(d.Get("port_range").(string)),
- Ports: expandStringArray(d.Get("ports")),
- Project: dcl.String(project),
- Location: dcl.String(region),
- ServiceDirectoryRegistrations: expandComputeForwardingRuleServiceDirectoryRegistrationsArray(d.Get("service_directory_registrations")),
- ServiceLabel: dcl.String(d.Get("service_label").(string)),
- Subnetwork: dcl.StringOrNil(d.Get("subnetwork").(string)),
- Target: dcl.String(d.Get("target").(string)),
- }
+ billingProject := ""
- userAgent, err := generateUserAgentString(d, config.userAgent)
+ project, err := getProject(d, config)
if err != nil {
- return err
+ return fmt.Errorf("Error fetching project for ForwardingRule: %s", err)
}
- billingProject := project
+ billingProject = project
+
// err == nil indicates that the billing_project value was found
if bp, err := getBillingProject(d, config); err == nil {
billingProject = bp
}
- client := NewDCLComputeClient(config, userAgent, billingProject, d.Timeout(schema.TimeoutRead))
- if bp, err := replaceVars(d, config, client.Config.BasePath); err != nil {
- d.SetId("")
- return fmt.Errorf("Could not format %q: %w", client.Config.BasePath, err)
- } else {
- client.Config.BasePath = bp
- }
- res, err := client.GetForwardingRule(context.Background(), obj)
+
+ res, err := sendRequest(config, "GET", billingProject, url, userAgent, nil)
if err != nil {
- resourceName := fmt.Sprintf("ComputeForwardingRule %q", d.Id())
- return handleNotFoundDCLError(err, d, resourceName)
+ return handleNotFoundError(err, d, fmt.Sprintf("ComputeForwardingRule %q", d.Id()))
}
- if err = d.Set("name", res.Name); err != nil {
- return fmt.Errorf("error setting name in state: %s", err)
+ if err := d.Set("project", project); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("all_ports", res.AllPorts); err != nil {
- return fmt.Errorf("error setting all_ports in state: %s", err)
+
+ if err := d.Set("creation_timestamp", flattenComputeForwardingRuleCreationTimestamp(res["creationTimestamp"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("allow_global_access", res.AllowGlobalAccess); err != nil {
- return fmt.Errorf("error setting allow_global_access in state: %s", err)
+ if err := d.Set("is_mirroring_collector", flattenComputeForwardingRuleIsMirroringCollector(res["isMirroringCollector"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("backend_service", res.BackendService); err != nil {
- return fmt.Errorf("error setting backend_service in state: %s", err)
+ if err := d.Set("description", flattenComputeForwardingRuleDescription(res["description"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("description", res.Description); err != nil {
- return fmt.Errorf("error setting description in state: %s", err)
+ if err := d.Set("ip_address", flattenComputeForwardingRuleIPAddress(res["IPAddress"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("ip_address", res.IPAddress); err != nil {
- return fmt.Errorf("error setting ip_address in state: %s", err)
+ if err := d.Set("ip_protocol", flattenComputeForwardingRuleIPProtocol(res["IPProtocol"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("ip_protocol", res.IPProtocol); err != nil {
- return fmt.Errorf("error setting ip_protocol in state: %s", err)
+ if err := d.Set("backend_service", flattenComputeForwardingRuleBackendService(res["backendService"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("is_mirroring_collector", res.IsMirroringCollector); err != nil {
- return fmt.Errorf("error setting is_mirroring_collector in state: %s", err)
+ if err := d.Set("load_balancing_scheme", flattenComputeForwardingRuleLoadBalancingScheme(res["loadBalancingScheme"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("labels", res.Labels); err != nil {
- return fmt.Errorf("error setting labels in state: %s", err)
+ if err := d.Set("name", flattenComputeForwardingRuleName(res["name"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("load_balancing_scheme", res.LoadBalancingScheme); err != nil {
- return fmt.Errorf("error setting load_balancing_scheme in state: %s", err)
+ if err := d.Set("network", flattenComputeForwardingRuleNetwork(res["network"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("network", res.Network); err != nil {
- return fmt.Errorf("error setting network in state: %s", err)
+ if err := d.Set("port_range", flattenComputeForwardingRulePortRange(res["portRange"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("network_tier", res.NetworkTier); err != nil {
- return fmt.Errorf("error setting network_tier in state: %s", err)
+ if err := d.Set("ports", flattenComputeForwardingRulePorts(res["ports"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("port_range", res.PortRange); err != nil {
- return fmt.Errorf("error setting port_range in state: %s", err)
+ if err := d.Set("subnetwork", flattenComputeForwardingRuleSubnetwork(res["subnetwork"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("ports", res.Ports); err != nil {
- return fmt.Errorf("error setting ports in state: %s", err)
+ if err := d.Set("target", flattenComputeForwardingRuleTarget(res["target"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("project", res.Project); err != nil {
- return fmt.Errorf("error setting project in state: %s", err)
+ if err := d.Set("allow_global_access", flattenComputeForwardingRuleAllowGlobalAccess(res["allowGlobalAccess"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("region", res.Location); err != nil {
- return fmt.Errorf("error setting region in state: %s", err)
+ if err := d.Set("all_ports", flattenComputeForwardingRuleAllPorts(res["allPorts"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("service_directory_registrations", flattenComputeForwardingRuleServiceDirectoryRegistrationsArray(res.ServiceDirectoryRegistrations)); err != nil {
- return fmt.Errorf("error setting service_directory_registrations in state: %s", err)
+ if err := d.Set("network_tier", flattenComputeForwardingRuleNetworkTier(res["networkTier"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("service_label", res.ServiceLabel); err != nil {
- return fmt.Errorf("error setting service_label in state: %s", err)
+ if err := d.Set("service_directory_registrations", flattenComputeForwardingRuleServiceDirectoryRegistrations(res["serviceDirectoryRegistrations"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("subnetwork", res.Subnetwork); err != nil {
- return fmt.Errorf("error setting subnetwork in state: %s", err)
+ if err := d.Set("service_label", flattenComputeForwardingRuleServiceLabel(res["serviceLabel"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("target", res.Target); err != nil {
- return fmt.Errorf("error setting target in state: %s", err)
+ if err := d.Set("service_name", flattenComputeForwardingRuleServiceName(res["serviceName"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("creation_timestamp", res.CreationTimestamp); err != nil {
- return fmt.Errorf("error setting creation_timestamp in state: %s", err)
+ if err := d.Set("psc_connection_id", flattenComputeForwardingRulePscConnectionId(res["pscConnectionId"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("label_fingerprint", res.LabelFingerprint); err != nil {
- return fmt.Errorf("error setting label_fingerprint in state: %s", err)
+ if err := d.Set("psc_connection_status", flattenComputeForwardingRulePscConnectionStatus(res["pscConnectionStatus"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("self_link", res.SelfLink); err != nil {
- return fmt.Errorf("error setting self_link in state: %s", err)
+ if err := d.Set("region", flattenComputeForwardingRuleRegion(res["region"], d, config)); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
- if err = d.Set("service_name", res.ServiceName); err != nil {
- return fmt.Errorf("error setting service_name in state: %s", err)
+ if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil {
+ return fmt.Errorf("Error reading ForwardingRule: %s", err)
}
return nil
}
+
func resourceComputeForwardingRuleUpdate(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
- project, err := getProject(d, config)
- if err != nil {
- return err
- }
- region, err := getRegion(d, config)
- if err != nil {
- return err
- }
-
- obj := &compute.ForwardingRule{
- Name: dcl.String(d.Get("name").(string)),
- AllPorts: dcl.Bool(d.Get("all_ports").(bool)),
- AllowGlobalAccess: dcl.Bool(d.Get("allow_global_access").(bool)),
- BackendService: dcl.String(d.Get("backend_service").(string)),
- Description: dcl.String(d.Get("description").(string)),
- IPAddress: dcl.StringOrNil(d.Get("ip_address").(string)),
- IPProtocol: compute.ForwardingRuleIPProtocolEnumRef(d.Get("ip_protocol").(string)),
- IsMirroringCollector: dcl.Bool(d.Get("is_mirroring_collector").(bool)),
- Labels: checkStringMap(d.Get("labels")),
- LoadBalancingScheme: compute.ForwardingRuleLoadBalancingSchemeEnumRef(d.Get("load_balancing_scheme").(string)),
- Network: dcl.StringOrNil(d.Get("network").(string)),
- NetworkTier: compute.ForwardingRuleNetworkTierEnumRef(d.Get("network_tier").(string)),
- PortRange: dcl.String(d.Get("port_range").(string)),
- Ports: expandStringArray(d.Get("ports")),
- Project: dcl.String(project),
- Location: dcl.String(region),
- ServiceDirectoryRegistrations: expandComputeForwardingRuleServiceDirectoryRegistrationsArray(d.Get("service_directory_registrations")),
- ServiceLabel: dcl.String(d.Get("service_label").(string)),
- Subnetwork: dcl.StringOrNil(d.Get("subnetwork").(string)),
- Target: dcl.String(d.Get("target").(string)),
- }
- directive := UpdateDirective
userAgent, err := generateUserAgentString(d, config.userAgent)
if err != nil {
return err
}
billingProject := ""
- // err == nil indicates that the billing_project value was found
- if bp, err := getBillingProject(d, config); err == nil {
- billingProject = bp
- }
- client := NewDCLComputeClient(config, userAgent, billingProject, d.Timeout(schema.TimeoutUpdate))
- if bp, err := replaceVars(d, config, client.Config.BasePath); err != nil {
- d.SetId("")
- return fmt.Errorf("Could not format %q: %w", client.Config.BasePath, err)
- } else {
- client.Config.BasePath = bp
- }
- res, err := client.ApplyForwardingRule(context.Background(), obj, directive...)
-
- if _, ok := err.(dcl.DiffAfterApplyError); ok {
- log.Printf("[DEBUG] Diff after apply returned from the DCL: %s", err)
- } else if err != nil {
- // The resource didn't actually create
- d.SetId("")
- return fmt.Errorf("Error updating ForwardingRule: %s", err)
- }
- log.Printf("[DEBUG] Finished creating ForwardingRule %q: %#v", d.Id(), res)
+ project, err := getProject(d, config)
+ if err != nil {
+ return fmt.Errorf("Error fetching project for ForwardingRule: %s", err)
+ }
+ billingProject = project
+
+ d.Partial(true)
+
+ if d.HasChange("target") {
+ obj := make(map[string]interface{})
+
+ targetProp, err := expandComputeForwardingRuleTarget(d.Get("target"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("target"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, targetProp)) {
+ obj["target"] = targetProp
+ }
+
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}/setTarget")
+ if err != nil {
+ return err
+ }
+
+ // err == nil indicates that the billing_project value was found
+ if bp, err := getBillingProject(d, config); err == nil {
+ billingProject = bp
+ }
+
+ res, err := sendRequestWithTimeout(config, "POST", billingProject, url, userAgent, obj, d.Timeout(schema.TimeoutUpdate))
+ if err != nil {
+ return fmt.Errorf("Error updating ForwardingRule %q: %s", d.Id(), err)
+ } else {
+ log.Printf("[DEBUG] Finished updating ForwardingRule %q: %#v", d.Id(), res)
+ }
+
+ err = computeOperationWaitTime(
+ config, res, project, "Updating ForwardingRule", userAgent,
+ d.Timeout(schema.TimeoutUpdate))
+ if err != nil {
+ return err
+ }
+ }
+ if d.HasChange("allow_global_access") {
+ obj := make(map[string]interface{})
+
+ allowGlobalAccessProp, err := expandComputeForwardingRuleAllowGlobalAccess(d.Get("allow_global_access"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("allow_global_access"); ok || !reflect.DeepEqual(v, allowGlobalAccessProp) {
+ obj["allowGlobalAccess"] = allowGlobalAccessProp
+ }
+
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}")
+ if err != nil {
+ return err
+ }
+
+ // err == nil indicates that the billing_project value was found
+ if bp, err := getBillingProject(d, config); err == nil {
+ billingProject = bp
+ }
+
+ res, err := sendRequestWithTimeout(config, "PATCH", billingProject, url, userAgent, obj, d.Timeout(schema.TimeoutUpdate))
+ if err != nil {
+ return fmt.Errorf("Error updating ForwardingRule %q: %s", d.Id(), err)
+ } else {
+ log.Printf("[DEBUG] Finished updating ForwardingRule %q: %#v", d.Id(), res)
+ }
+
+ err = computeOperationWaitTime(
+ config, res, project, "Updating ForwardingRule", userAgent,
+ d.Timeout(schema.TimeoutUpdate))
+ if err != nil {
+ return err
+ }
+ }
+
+ d.Partial(false)
return resourceComputeForwardingRuleRead(d, meta)
}
func resourceComputeForwardingRuleDelete(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
- project, err := getProject(d, config)
- if err != nil {
- return err
- }
- region, err := getRegion(d, config)
+ userAgent, err := generateUserAgentString(d, config.userAgent)
if err != nil {
return err
}
- obj := &compute.ForwardingRule{
- Name: dcl.String(d.Get("name").(string)),
- AllPorts: dcl.Bool(d.Get("all_ports").(bool)),
- AllowGlobalAccess: dcl.Bool(d.Get("allow_global_access").(bool)),
- BackendService: dcl.String(d.Get("backend_service").(string)),
- Description: dcl.String(d.Get("description").(string)),
- IPAddress: dcl.StringOrNil(d.Get("ip_address").(string)),
- IPProtocol: compute.ForwardingRuleIPProtocolEnumRef(d.Get("ip_protocol").(string)),
- IsMirroringCollector: dcl.Bool(d.Get("is_mirroring_collector").(bool)),
- Labels: checkStringMap(d.Get("labels")),
- LoadBalancingScheme: compute.ForwardingRuleLoadBalancingSchemeEnumRef(d.Get("load_balancing_scheme").(string)),
- Network: dcl.StringOrNil(d.Get("network").(string)),
- NetworkTier: compute.ForwardingRuleNetworkTierEnumRef(d.Get("network_tier").(string)),
- PortRange: dcl.String(d.Get("port_range").(string)),
- Ports: expandStringArray(d.Get("ports")),
- Project: dcl.String(project),
- Location: dcl.String(region),
- ServiceDirectoryRegistrations: expandComputeForwardingRuleServiceDirectoryRegistrationsArray(d.Get("service_directory_registrations")),
- ServiceLabel: dcl.String(d.Get("service_label").(string)),
- Subnetwork: dcl.StringOrNil(d.Get("subnetwork").(string)),
- Target: dcl.String(d.Get("target").(string)),
+ billingProject := ""
+
+ project, err := getProject(d, config)
+ if err != nil {
+ return fmt.Errorf("Error fetching project for ForwardingRule: %s", err)
}
+ billingProject = project
- log.Printf("[DEBUG] Deleting ForwardingRule %q", d.Id())
- userAgent, err := generateUserAgentString(d, config.userAgent)
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}")
if err != nil {
return err
}
- billingProject := project
+
+ var obj map[string]interface{}
+ log.Printf("[DEBUG] Deleting ForwardingRule %q", d.Id())
+
// err == nil indicates that the billing_project value was found
if bp, err := getBillingProject(d, config); err == nil {
billingProject = bp
}
- client := NewDCLComputeClient(config, userAgent, billingProject, d.Timeout(schema.TimeoutDelete))
- if bp, err := replaceVars(d, config, client.Config.BasePath); err != nil {
- d.SetId("")
- return fmt.Errorf("Could not format %q: %w", client.Config.BasePath, err)
- } else {
- client.Config.BasePath = bp
+
+ res, err := sendRequestWithTimeout(config, "DELETE", billingProject, url, userAgent, obj, d.Timeout(schema.TimeoutDelete))
+ if err != nil {
+ return handleNotFoundError(err, d, "ForwardingRule")
}
- if err := client.DeleteForwardingRule(context.Background(), obj); err != nil {
- return fmt.Errorf("Error deleting ForwardingRule: %s", err)
+
+ err = computeOperationWaitTime(
+ config, res, project, "Deleting ForwardingRule", userAgent,
+ d.Timeout(schema.TimeoutDelete))
+
+ if err != nil {
+ return err
}
- log.Printf("[DEBUG] Finished deleting ForwardingRule %q", d.Id())
+ log.Printf("[DEBUG] Finished deleting ForwardingRule %q: %#v", d.Id(), res)
return nil
}
func resourceComputeForwardingRuleImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
config := meta.(*Config)
-
if err := parseImportId([]string{
"projects/(?P<project>[^/]+)/regions/(?P<region>[^/]+)/forwardingRules/(?P<name>[^/]+)",
"(?P<project>[^/]+)/(?P<region>[^/]+)/(?P<name>[^/]+)",
@@ -594,7 +744,7 @@ func resourceComputeForwardingRuleImport(d *schema.ResourceData, meta interface{
}
// Replace import id for the resource id
- id, err := replaceVarsForId(d, config, "projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}")
+ id, err := replaceVars(d, config, "projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}")
if err != nil {
return nil, fmt.Errorf("Error constructing id: %s", err)
}
@@ -603,60 +753,303 @@ func resourceComputeForwardingRuleImport(d *schema.ResourceData, meta interface{
return []*schema.ResourceData{d}, nil
}
-func expandComputeForwardingRuleServiceDirectoryRegistrationsArray(o interface{}) []compute.ForwardingRuleServiceDirectoryRegistrations {
- if o == nil {
- return nil
+func flattenComputeForwardingRuleCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleIsMirroringCollector(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleIPAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleIPProtocol(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ if v == nil {
+ return v
}
+ return ConvertSelfLinkToV1(v.(string))
+}
+
+func flattenComputeForwardingRuleLoadBalancingScheme(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleName(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- objs := o.([]interface{})
- if len(objs) == 0 || objs[0] == nil {
- return nil
+func flattenComputeForwardingRuleNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ if v == nil {
+ return v
}
+ return ConvertSelfLinkToV1(v.(string))
+}
- items := make([]compute.ForwardingRuleServiceDirectoryRegistrations, 0, len(objs))
- for _, item := range objs {
- i := expandComputeForwardingRuleServiceDirectoryRegistrations(item)
- items = append(items, *i)
+func flattenComputeForwardingRulePortRange(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRulePorts(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ if v == nil {
+ return v
}
+ return schema.NewSet(schema.HashString, v.([]interface{}))
+}
+
+func flattenComputeForwardingRuleSubnetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ if v == nil {
+ return v
+ }
+ return ConvertSelfLinkToV1(v.(string))
+}
+
+func flattenComputeForwardingRuleTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleAllowGlobalAccess(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- return items
+func flattenComputeForwardingRuleAllPorts(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
}
-func expandComputeForwardingRuleServiceDirectoryRegistrations(o interface{}) *compute.ForwardingRuleServiceDirectoryRegistrations {
- if o == nil {
- return nil
+func flattenComputeForwardingRuleNetworkTier(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleServiceDirectoryRegistrations(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ if v == nil {
+ return v
+ }
+ l := v.([]interface{})
+ transformed := make([]interface{}, 0, len(l))
+ for _, raw := range l {
+ original := raw.(map[string]interface{})
+ if len(original) < 1 {
+ // Do not include empty json objects coming back from the api
+ continue
+ }
+ transformed = append(transformed, map[string]interface{}{
+ "namespace": flattenComputeForwardingRuleServiceDirectoryRegistrationsNamespace(original["namespace"], d, config),
+ "service": flattenComputeForwardingRuleServiceDirectoryRegistrationsService(original["service"], d, config),
+ })
}
+ return transformed
+}
+func flattenComputeForwardingRuleServiceDirectoryRegistrationsNamespace(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- obj := o.(map[string]interface{})
- return &compute.ForwardingRuleServiceDirectoryRegistrations{
- Namespace: dcl.StringOrNil(obj["namespace"].(string)),
- Service: dcl.String(obj["service"].(string)),
+func flattenComputeForwardingRuleServiceDirectoryRegistrationsService(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleServiceLabel(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleServiceName(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRulePscConnectionId(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRulePscConnectionStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+
+func flattenComputeForwardingRuleRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ if v == nil {
+ return v
}
+ return NameFromSelfLinkStateFunc(v)
+}
+
+func expandComputeForwardingRuleIsMirroringCollector(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
}
-func flattenComputeForwardingRuleServiceDirectoryRegistrationsArray(objs []compute.ForwardingRuleServiceDirectoryRegistrations) []interface{} {
- if objs == nil {
- return nil
+func expandComputeForwardingRuleIPAddress(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleIPProtocol(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleBackendService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ // This method returns a full self link from a partial self link.
+ if v == nil || v.(string) == "" {
+ // It does not try to construct anything from empty.
+ return "", nil
+ } else if strings.HasPrefix(v.(string), "https://") {
+ // Anything that starts with a URL scheme is assumed to be a self link worth using.
+ return v, nil
+ } else if strings.HasPrefix(v.(string), "projects/") {
+ // If the self link references a project, we'll just stuck the compute prefix on it
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}"+v.(string))
+ if err != nil {
+ return "", err
+ }
+ return url, nil
+ } else if strings.HasPrefix(v.(string), "regions/") || strings.HasPrefix(v.(string), "zones/") {
+ // For regional or zonal resources which include their region or zone, just put the project in front.
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/")
+ if err != nil {
+ return nil, err
+ }
+ return url + v.(string), nil
+ }
+ // Anything else is assumed to be a regional resource, with a partial link that begins with the resource name.
+ // This isn't very likely - it's a last-ditch effort to extract something useful here. We can do a better job
+ // as soon as MultiResourceRefs are working since we'll know the types that this field is supposed to point to.
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/regions/{{region}}/")
+ if err != nil {
+ return nil, err
}
+ return url + v.(string), nil
+}
- items := []interface{}{}
- for _, item := range objs {
- i := flattenComputeForwardingRuleServiceDirectoryRegistrations(&item)
- items = append(items, i)
+func expandComputeForwardingRuleLoadBalancingScheme(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true)
+ if err != nil {
+ return nil, fmt.Errorf("Invalid value for network: %s", err)
}
+ return f.RelativeLink(), nil
+}
+
+func expandComputeForwardingRulePortRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
- return items
+func expandComputeForwardingRulePorts(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v.(*schema.Set).List(), nil
}
-func flattenComputeForwardingRuleServiceDirectoryRegistrations(obj *compute.ForwardingRuleServiceDirectoryRegistrations) interface{} {
- if obj == nil || obj.Empty() {
- return nil
+func expandComputeForwardingRuleSubnetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ f, err := parseRegionalFieldValue("subnetworks", v.(string), "project", "region", "zone", d, config, true)
+ if err != nil {
+ return nil, fmt.Errorf("Invalid value for subnetwork: %s", err)
}
- transformed := map[string]interface{}{
- "namespace": obj.Namespace,
- "service": obj.Service,
+ return f.RelativeLink(), nil
+}
+
+func expandComputeForwardingRuleTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ // This method returns a full self link from a partial self link.
+ if v == nil || v.(string) == "" {
+ // It does not try to construct anything from empty.
+ return "", nil
+ } else if strings.HasPrefix(v.(string), "https://") {
+ // Anything that starts with a URL scheme is assumed to be a self link worth using.
+ return v, nil
+ } else if strings.HasPrefix(v.(string), "projects/") {
+ // If the self link references a project, we'll just stuck the compute prefix on it
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}"+v.(string))
+ if err != nil {
+ return "", err
+ }
+ return url, nil
+ } else if strings.HasPrefix(v.(string), "regions/") || strings.HasPrefix(v.(string), "zones/") {
+ // For regional or zonal resources which include their region or zone, just put the project in front.
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/")
+ if err != nil {
+ return nil, err
+ }
+ return url + v.(string), nil
+ }
+ // Anything else is assumed to be a regional resource, with a partial link that begins with the resource name.
+ // This isn't very likely - it's a last-ditch effort to extract something useful here. We can do a better job
+ // as soon as MultiResourceRefs are working since we'll know the types that this field is supposed to point to.
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/regions/{{region}}/")
+ if err != nil {
+ return nil, err
}
+ return url + v.(string), nil
+}
- return transformed
+func expandComputeForwardingRuleAllowGlobalAccess(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleAllPorts(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleNetworkTier(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleServiceDirectoryRegistrations(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ l := v.([]interface{})
+ req := make([]interface{}, 0, len(l))
+ for _, raw := range l {
+ if raw == nil {
+ continue
+ }
+ original := raw.(map[string]interface{})
+ transformed := make(map[string]interface{})
+
+ transformedNamespace, err := expandComputeForwardingRuleServiceDirectoryRegistrationsNamespace(original["namespace"], d, config)
+ if err != nil {
+ return nil, err
+ } else if val := reflect.ValueOf(transformedNamespace); val.IsValid() && !isEmptyValue(val) {
+ transformed["namespace"] = transformedNamespace
+ }
+
+ transformedService, err := expandComputeForwardingRuleServiceDirectoryRegistrationsService(original["service"], d, config)
+ if err != nil {
+ return nil, err
+ } else if val := reflect.ValueOf(transformedService); val.IsValid() && !isEmptyValue(val) {
+ transformed["service"] = transformedService
+ }
+
+ req = append(req, transformed)
+ }
+ return req, nil
+}
+
+func expandComputeForwardingRuleServiceDirectoryRegistrationsNamespace(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleServiceDirectoryRegistrationsService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+func expandComputeForwardingRuleServiceLabel(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeForwardingRuleRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true)
+ if err != nil {
+ return nil, fmt.Errorf("Invalid value for region: %s", err)
+ }
+ return f.RelativeLink(), nil
}
diff --git a/google/resource_compute_global_forwarding_rule.go b/google/resource_compute_global_forwarding_rule.go
index 6512ebeb1..b806a7c44 100644
--- a/google/resource_compute_global_forwarding_rule.go
+++ b/google/resource_compute_global_forwarding_rule.go
@@ -1,30 +1,26 @@
// ----------------------------------------------------------------------------
//
-// *** AUTO GENERATED CODE *** Type: DCL ***
+// *** AUTO GENERATED CODE *** Type: MMv1 ***
//
// ----------------------------------------------------------------------------
//
-// This file is managed by Magic Modules (https://github.com/GoogleCloudPlatform/magic-modules)
-// and is based on the DCL (https://github.com/GoogleCloudPlatform/declarative-resource-client-library).
-// Changes will need to be made to the DCL or Magic Modules instead of here.
+// This file is automatically generated by Magic Modules and manual
+// changes will be clobbered when the file is regenerated.
//
-// We are not currently able to accept contributions to this file. If changes
-// are required, please file an issue at https://github.com/hashicorp/terraform-provider-google/issues/new/choose
+// Please read more about how to change this file in
+// .github/CONTRIBUTING.md.
//
// ----------------------------------------------------------------------------
package google
import (
- "context"
"fmt"
"log"
+ "reflect"
"time"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
-
- dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
- compute "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/compute"
)
func resourceComputeGlobalForwardingRule() *schema.Resource {
@@ -46,410 +42,500 @@ func resourceComputeGlobalForwardingRule() *schema.Resource {
Schema: map[string]*schema.Schema{
"name": {
- Type: schema.TypeString,
- Required: true,
- ForceNew: true,
- Description: "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ Type: schema.TypeString,
+ Required: true,
+ ForceNew: true,
+ Description: `Name of the resource; provided by the client when the resource is
+created. The name must be 1-63 characters long, and comply with
+RFC1035. Specifically, the name must be 1-63 characters long and match
+the regular expression '[a-z]([-a-z0-9]*[a-z0-9])?' which means the
+first character must be a lowercase letter, and all following
+characters must be a dash, lowercase letter, or digit, except the last
+character, which cannot be a dash.`,
},
-
"target": {
Type: schema.TypeString,
Required: true,
DiffSuppressFunc: compareSelfLinkRelativePaths,
- Description: "The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate to the target object. For `INTERNAL_SELF_MANAGED` load balancing, only `targetHttpProxy` is valid, not `targetHttpsProxy`.",
- },
+ Description: `The URL of the target resource to receive the matched traffic.
+The forwarded traffic must be of a type appropriate to the target object.
+For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets
+are valid.
- "description": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- Description: "An optional description of this resource. Provide this property when you create the resource.",
+([Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html) only) For global address with a purpose of PRIVATE_SERVICE_CONNECT and
+addressType of INTERNAL, only "all-apis" and "vpc-sc" are valid.`,
},
-
"ip_address": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
DiffSuppressFunc: internalIpDiffSuppress,
- Description: "IP address that this forwarding rule serves. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the target that you specify in the forwarding rule. If you don't specify a reserved IP address, an ephemeral IP address is assigned. Methods for specifying an IP address: * IPv4 dotted decimal, as in `100.1.2.3` * Full URL, as in `https://www.googleapis.com/compute/v1/projects/project_id/regions/region/addresses/address-name` * Partial URL or by name, as in: * `projects/project_id/regions/region/addresses/address-name` * `regions/region/addresses/address-name` * `global/addresses/address-name` * `address-name` The loadBalancingScheme and the forwarding rule's target determine the type of IP address that you can use. For detailed information, refer to [IP address specifications](/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications).",
+ Description: `The IP address that this forwarding rule serves. When a client sends
+traffic to this IP address, the forwarding rule directs the traffic to
+the target that you specify in the forwarding rule. The
+loadBalancingScheme and the forwarding rule's target determine the
+type of IP address that you can use. For detailed information, refer
+to [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications).
+
+An address can be specified either by a literal IP address or a
+reference to an existing Address resource. If you don't specify a
+reserved IP address, an ephemeral IP address is assigned.
+
+The value must be set to 0.0.0.0 when the target is a targetGrpcProxy
+that has validateForProxyless field set to true.
+
+For Private Service Connect forwarding rules that forward traffic to
+Google APIs, IP address must be provided.`,
},
-
"ip_protocol": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
+ ValidateFunc: validateEnum([]string{"TCP", "UDP", "ESP", "AH", "SCTP", "ICMP", ""}),
DiffSuppressFunc: caseDiffSuppress,
- Description: "The IP protocol to which this rule applies. For protocol forwarding, valid options are `TCP`, `UDP`, `ESP`, `AH`, `SCTP` or `ICMP`. For Internal TCP/UDP Load Balancing, the load balancing scheme is `INTERNAL`, and one of `TCP` or `UDP` are valid. For Traffic Director, the load balancing scheme is `INTERNAL_SELF_MANAGED`, and only `TCP`is valid. For Internal HTTP(S) Load Balancing, the load balancing scheme is `INTERNAL_MANAGED`, and only `TCP` is valid. For HTTP(S), SSL Proxy, and TCP Proxy Load Balancing, the load balancing scheme is `EXTERNAL` and only `TCP` is valid. For Network TCP/UDP Load Balancing, the load balancing scheme is `EXTERNAL`, and one of `TCP` or `UDP` is valid.",
+ Description: `The IP protocol to which this rule applies. When the load balancing scheme is
+INTERNAL_SELF_MANAGED, only TCP is valid. This field must not be set if the
+global address is configured as a purpose of PRIVATE_SERVICE_CONNECT
+and addressType of INTERNAL Possible values: ["TCP", "UDP", "ESP", "AH", "SCTP", "ICMP"]`,
},
-
- "ip_version": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- Description: "The IP Version that will be used by this forwarding rule. Valid options are `IPV4` or `IPV6`. This can only be specified for an external global forwarding rule. Possible values: UNSPECIFIED_VERSION, IPV4, IPV6",
+ "description": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ Description: `An optional description of this resource. Provide this property when
+you create the resource.`,
},
-
- "labels": {
- Type: schema.TypeMap,
- Optional: true,
- Description: "Labels to apply to this rule.",
- Elem: &schema.Schema{Type: schema.TypeString},
+ "ip_version": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ ValidateFunc: validateEnum([]string{"IPV4", "IPV6", ""}),
+ Description: `The IP Version that will be used by this global forwarding rule. Possible values: ["IPV4", "IPV6"]`,
},
-
"load_balancing_scheme": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- Description: "Specifies the forwarding rule type.\n\n* `EXTERNAL` is used for:\n * Classic Cloud VPN gateways\n * Protocol forwarding to VMs from an external IP address\n * The following load balancers: HTTP(S), SSL Proxy, TCP Proxy, and Network TCP/UDP\n* `INTERNAL` is used for:\n * Protocol forwarding to VMs from an internal IP address\n * Internal TCP/UDP load balancers\n* `INTERNAL_MANAGED` is used for:\n * Internal HTTP(S) load balancers\n* `INTERNAL_SELF_MANAGED` is used for:\n * Traffic Director\n* `EXTERNAL_MANAGED` is used for:\n * Global external HTTP(S) load balancers \n\nFor more information about forwarding rules, refer to [Forwarding rule concepts](/load-balancing/docs/forwarding-rule-concepts). Possible values: INVALID, INTERNAL, INTERNAL_MANAGED, INTERNAL_SELF_MANAGED, EXTERNAL, EXTERNAL_MANAGED",
- Default: "EXTERNAL",
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ ValidateFunc: validateEnum([]string{"EXTERNAL", "EXTERNAL_MANAGED", "INTERNAL_SELF_MANAGED", ""}),
+ Description: `This signifies what the GlobalForwardingRule will be used for.
+The value of INTERNAL_SELF_MANAGED means that this will be used for
+Internal Global HTTP(S) LB. The value of EXTERNAL means that this
+will be used for External Global Load Balancing (HTTP(S) LB,
+External TCP/UDP LB, SSL Proxy). The value of EXTERNAL_MANAGED means
+that this will be used for Global external HTTP(S) load balancers.
+
+([Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html) only) Note: This field must be set "" if the global address is
+configured as a purpose of PRIVATE_SERVICE_CONNECT and addressType of INTERNAL. Default value: "EXTERNAL" Possible values: ["EXTERNAL", "EXTERNAL_MANAGED", "INTERNAL_SELF_MANAGED"]`,
+ Default: "EXTERNAL",
},
-
"metadata_filters": {
- Type: schema.TypeList,
- Optional: true,
- ForceNew: true,
- Description: "Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set of [xDS](https://github.com/envoyproxy/data-plane-api/blob/master/XDS_PROTOCOL.md) compliant clients. In their xDS requests to Loadbalancer, xDS clients present [node metadata](https://github.com/envoyproxy/data-plane-api/search?q=%22message+Node%22+in%3A%2Fenvoy%2Fapi%2Fv2%2Fcore%2Fbase.proto&). If a match takes place, the relevant configuration is made available to those proxies. Otherwise, all the resources (e.g. `TargetHttpProxy`, `UrlMap`) referenced by the `ForwardingRule` will not be visible to those proxies.\n\nFor each `metadataFilter` in this list, if its `filterMatchCriteria` is set to MATCH_ANY, at least one of the `filterLabel`s must match the corresponding label provided in the metadata. If its `filterMatchCriteria` is set to MATCH_ALL, then all of its `filterLabel`s must match with corresponding labels provided in the metadata.\n\n`metadataFilters` specified here will be applifed before those specified in the `UrlMap` that this `ForwardingRule` references.\n\n`metadataFilters` only applies to Loadbalancers that have their loadBalancingScheme set to `INTERNAL_SELF_MANAGED`.",
- Elem: ComputeGlobalForwardingRuleMetadataFilterSchema(),
+ Type: schema.TypeList,
+ Optional: true,
+ ForceNew: true,
+ Description: `Opaque filter criteria used by Loadbalancer to restrict routing
+configuration to a limited set xDS compliant clients. In their xDS
+requests to Loadbalancer, xDS clients present node metadata. If a
+match takes place, the relevant routing configuration is made available
+to those proxies.
+
+For each metadataFilter in this list, if its filterMatchCriteria is set
+to MATCH_ANY, at least one of the filterLabels must match the
+corresponding label provided in the metadata. If its filterMatchCriteria
+is set to MATCH_ALL, then all of its filterLabels must match with
+corresponding labels in the provided metadata.
+
+metadataFilters specified here can be overridden by those specified in
+the UrlMap that this ForwardingRule references.
+
+metadataFilters only applies to Loadbalancers that have their
+loadBalancingScheme set to INTERNAL_SELF_MANAGED.`,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "filter_labels": {
+ Type: schema.TypeList,
+ Required: true,
+ ForceNew: true,
+ Description: `The list of label value pairs that must match labels in the
+provided metadata based on filterMatchCriteria
+
+This list must not be empty and can have at the most 64 entries.`,
+ MinItems: 1,
+ MaxItems: 64,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Required: true,
+ ForceNew: true,
+ Description: `Name of the metadata label. The length must be between
+1 and 1024 characters, inclusive.`,
+ },
+ "value": {
+ Type: schema.TypeString,
+ Required: true,
+ ForceNew: true,
+ Description: `The value that the label must match. The value has a maximum
+length of 1024 characters.`,
+ },
+ },
+ },
+ },
+ "filter_match_criteria": {
+ Type: schema.TypeString,
+ Required: true,
+ ForceNew: true,
+ ValidateFunc: validateEnum([]string{"MATCH_ANY", "MATCH_ALL"}),
+ Description: `Specifies how individual filterLabel matches within the list of
+filterLabels contribute towards the overall metadataFilter match.
+
+MATCH_ANY - At least one of the filterLabels must have a matching
+label in the provided metadata.
+MATCH_ALL - All filterLabels must have matching labels in the
+provided metadata. Possible values: ["MATCH_ANY", "MATCH_ALL"]`,
+ },
+ },
+ },
},
-
- "network": {
- Type: schema.TypeString,
- Computed: true,
- Optional: true,
- ForceNew: true,
- DiffSuppressFunc: compareSelfLinkOrResourceName,
- Description: "This field is not used for external load balancing. For `INTERNAL` and `INTERNAL_SELF_MANAGED` load balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is not specified, the default network will be used.",
- },
-
"port_range": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
DiffSuppressFunc: portRangeDiffSuppress,
- Description: "When the load balancing scheme is `EXTERNAL`, `INTERNAL_SELF_MANAGED` and `INTERNAL_MANAGED`, you can specify a `port_range`. Use with a forwarding rule that points to a target proxy or a target pool. Do not use with a forwarding rule that points to a backend service. This field is used along with the `target` field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. Applicable only when `IPProtocol` is `TCP`, `UDP`, or `SCTP`, only packets addressed to ports in the specified range will be forwarded to `target`. Forwarding rules with the same `[IPAddress, IPProtocol]` pair must have disjoint port ranges. Some types of forwarding target have constraints on the acceptable ports:\n\n* TargetHttpProxy: 80, 8080\n* TargetHttpsProxy: 443\n* TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222\n* TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222\n* TargetVpnGateway: 500, 4500\n\n@pattern: d+(?:-d+)?",
+ Description: `This field is used along with the target field for TargetHttpProxy,
+TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway,
+TargetPool, TargetInstance.
+
+Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
+addressed to ports in the specified range will be forwarded to target.
+Forwarding rules with the same [IPAddress, IPProtocol] pair must have
+disjoint port ranges.
+
+Some types of forwarding target have constraints on the acceptable
+ports:
+
+* TargetHttpProxy: 80, 8080
+* TargetHttpsProxy: 443
+* TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
+ 1883, 5222
+* TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995,
+ 1883, 5222
+* TargetVpnGateway: 500, 4500`,
},
-
- "project": {
- Type: schema.TypeString,
- Computed: true,
- Optional: true,
- ForceNew: true,
- DiffSuppressFunc: compareSelfLinkOrResourceName,
- Description: "The project this resource belongs in.",
- },
-
- "label_fingerprint": {
+ "psc_connection_id": {
Type: schema.TypeString,
Computed: true,
- Description: "Used internally during label updates.",
+ Description: `The PSC connection id of the PSC Forwarding Rule in uint64 format.`,
},
-
- "self_link": {
- Type: schema.TypeString,
- Computed: true,
- Description: "[Output Only] Server-defined URL for the resource.",
+ "psc_connection_status": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: `The PSC connection status, can be one of the following: ACCEPTED, CLOSED, PENDING,
+REJECTED, STATUS_UNSPECIFIED, UNDEFINED_PSC_CONNECTION_STATUS.`,
},
- },
- }
-}
-
-func ComputeGlobalForwardingRuleMetadataFilterSchema() *schema.Resource {
- return &schema.Resource{
- Schema: map[string]*schema.Schema{
- "filter_labels": {
- Type: schema.TypeList,
- Required: true,
- ForceNew: true,
- Description: "The list of label value pairs that must match labels in the provided metadata based on `filterMatchCriteria`\n\nThis list must not be empty and can have at the most 64 entries.",
- MaxItems: 64,
- MinItems: 1,
- Elem: ComputeGlobalForwardingRuleMetadataFilterFilterLabelSchema(),
- },
-
- "filter_match_criteria": {
- Type: schema.TypeString,
- Required: true,
- ForceNew: true,
- Description: "Specifies how individual `filterLabel` matches within the list of `filterLabel`s contribute towards the overall `metadataFilter` match.\n\nSupported values are:\n\n* MATCH_ANY: At least one of the `filterLabels` must have a matching label in the provided metadata.\n* MATCH_ALL: All `filterLabels` must have matching labels in the provided metadata. Possible values: NOT_SET, MATCH_ALL, MATCH_ANY",
- },
- },
- }
-}
-
-func ComputeGlobalForwardingRuleMetadataFilterFilterLabelSchema() *schema.Resource {
- return &schema.Resource{
- Schema: map[string]*schema.Schema{
- "name": {
- Type: schema.TypeString,
- Required: true,
- ForceNew: true,
- Description: "Name of metadata label.\n\nThe name can have a maximum length of 1024 characters and must be at least 1 character long.",
+ "project": {
+ Type: schema.TypeString,
+ Optional: true,
+ Computed: true,
+ ForceNew: true,
},
-
- "value": {
- Type: schema.TypeString,
- Required: true,
- ForceNew: true,
- Description: "The value of the label must match the specified value.\n\nvalue can have a maximum length of 1024 characters.",
+ "self_link": {
+ Type: schema.TypeString,
+ Computed: true,
},
},
+ UseJSONNumber: true,
}
}
func resourceComputeGlobalForwardingRuleCreate(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
- project, err := getProject(d, config)
+ userAgent, err := generateUserAgentString(d, config.userAgent)
if err != nil {
return err
}
- obj := &compute.ForwardingRule{
- Name: dcl.String(d.Get("name").(string)),
- Target: dcl.String(d.Get("target").(string)),
- Description: dcl.String(d.Get("description").(string)),
- IPAddress: dcl.StringOrNil(d.Get("ip_address").(string)),
- IPProtocol: compute.ForwardingRuleIPProtocolEnumRef(d.Get("ip_protocol").(string)),
- IPVersion: compute.ForwardingRuleIPVersionEnumRef(d.Get("ip_version").(string)),
- Labels: checkStringMap(d.Get("labels")),
- LoadBalancingScheme: compute.ForwardingRuleLoadBalancingSchemeEnumRef(d.Get("load_balancing_scheme").(string)),
- MetadataFilter: expandComputeGlobalForwardingRuleMetadataFilterArray(d.Get("metadata_filters")),
- Network: dcl.StringOrNil(d.Get("network").(string)),
- PortRange: dcl.String(d.Get("port_range").(string)),
- Project: dcl.String(project),
+ obj := make(map[string]interface{})
+ descriptionProp, err := expandComputeGlobalForwardingRuleDescription(d.Get("description"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
+ obj["description"] = descriptionProp
}
-
- id, err := replaceVarsForId(d, config, "projects/{{project}}/global/forwardingRules/{{name}}")
+ IPAddressProp, err := expandComputeGlobalForwardingRuleIPAddress(d.Get("ip_address"), d, config)
if err != nil {
- return fmt.Errorf("error constructing id: %s", err)
+ return err
+ } else if v, ok := d.GetOkExists("ip_address"); !isEmptyValue(reflect.ValueOf(IPAddressProp)) && (ok || !reflect.DeepEqual(v, IPAddressProp)) {
+ obj["IPAddress"] = IPAddressProp
}
- d.SetId(id)
- createDirective := CreateDirective
- userAgent, err := generateUserAgentString(d, config.userAgent)
+ IPProtocolProp, err := expandComputeGlobalForwardingRuleIPProtocol(d.Get("ip_protocol"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("ip_protocol"); !isEmptyValue(reflect.ValueOf(IPProtocolProp)) && (ok || !reflect.DeepEqual(v, IPProtocolProp)) {
+ obj["IPProtocol"] = IPProtocolProp
+ }
+ ipVersionProp, err := expandComputeGlobalForwardingRuleIpVersion(d.Get("ip_version"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("ip_version"); !isEmptyValue(reflect.ValueOf(ipVersionProp)) && (ok || !reflect.DeepEqual(v, ipVersionProp)) {
+ obj["ipVersion"] = ipVersionProp
+ }
+ loadBalancingSchemeProp, err := expandComputeGlobalForwardingRuleLoadBalancingScheme(d.Get("load_balancing_scheme"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("load_balancing_scheme"); !isEmptyValue(reflect.ValueOf(loadBalancingSchemeProp)) && (ok || !reflect.DeepEqual(v, loadBalancingSchemeProp)) {
+ obj["loadBalancingScheme"] = loadBalancingSchemeProp
+ }
+ metadataFiltersProp, err := expandComputeGlobalForwardingRuleMetadataFilters(d.Get("metadata_filters"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("metadata_filters"); !isEmptyValue(reflect.ValueOf(metadataFiltersProp)) && (ok || !reflect.DeepEqual(v, metadataFiltersProp)) {
+ obj["metadataFilters"] = metadataFiltersProp
+ }
+ nameProp, err := expandComputeGlobalForwardingRuleName(d.Get("name"), d, config)
if err != nil {
return err
+ } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
+ obj["name"] = nameProp
}
- billingProject := project
+ portRangeProp, err := expandComputeGlobalForwardingRulePortRange(d.Get("port_range"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("port_range"); !isEmptyValue(reflect.ValueOf(portRangeProp)) && (ok || !reflect.DeepEqual(v, portRangeProp)) {
+ obj["portRange"] = portRangeProp
+ }
+ targetProp, err := expandComputeGlobalForwardingRuleTarget(d.Get("target"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("target"); !isEmptyValue(reflect.ValueOf(targetProp)) && (ok || !reflect.DeepEqual(v, targetProp)) {
+ obj["target"] = targetProp
+ }
+
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/global/forwardingRules")
+ if err != nil {
+ return err
+ }
+
+ log.Printf("[DEBUG] Creating new GlobalForwardingRule: %#v", obj)
+ billingProject := ""
+
+ project, err := getProject(d, config)
+ if err != nil {
+ return fmt.Errorf("Error fetching project for GlobalForwardingRule: %s", err)
+ }
+ billingProject = project
+
// err == nil indicates that the billing_project value was found
if bp, err := getBillingProject(d, config); err == nil {
billingProject = bp
}
- client := NewDCLComputeClient(config, userAgent, billingProject, d.Timeout(schema.TimeoutCreate))
- if bp, err := replaceVars(d, config, client.Config.BasePath); err != nil {
- d.SetId("")
- return fmt.Errorf("Could not format %q: %w", client.Config.BasePath, err)
- } else {
- client.Config.BasePath = bp
+
+ res, err := sendRequestWithTimeout(config, "POST", billingProject, url, userAgent, obj, d.Timeout(schema.TimeoutCreate))
+ if err != nil {
+ return fmt.Errorf("Error creating GlobalForwardingRule: %s", err)
}
- res, err := client.ApplyForwardingRule(context.Background(), obj, createDirective...)
- if _, ok := err.(dcl.DiffAfterApplyError); ok {
- log.Printf("[DEBUG] Diff after apply returned from the DCL: %s", err)
- } else if err != nil {
+ // Store the ID now
+ id, err := replaceVars(d, config, "projects/{{project}}/global/forwardingRules/{{name}}")
+ if err != nil {
+ return fmt.Errorf("Error constructing id: %s", err)
+ }
+ d.SetId(id)
+
+ err = computeOperationWaitTime(
+ config, res, project, "Creating GlobalForwardingRule", userAgent,
+ d.Timeout(schema.TimeoutCreate))
+
+ if err != nil {
// The resource didn't actually create
d.SetId("")
- return fmt.Errorf("Error creating ForwardingRule: %s", err)
+ return fmt.Errorf("Error waiting to create GlobalForwardingRule: %s", err)
}
- log.Printf("[DEBUG] Finished creating ForwardingRule %q: %#v", d.Id(), res)
+ log.Printf("[DEBUG] Finished creating GlobalForwardingRule %q: %#v", d.Id(), res)
return resourceComputeGlobalForwardingRuleRead(d, meta)
}
func resourceComputeGlobalForwardingRuleRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
- project, err := getProject(d, config)
+ userAgent, err := generateUserAgentString(d, config.userAgent)
if err != nil {
return err
}
- obj := &compute.ForwardingRule{
- Name: dcl.String(d.Get("name").(string)),
- Target: dcl.String(d.Get("target").(string)),
- Description: dcl.String(d.Get("description").(string)),
- IPAddress: dcl.StringOrNil(d.Get("ip_address").(string)),
- IPProtocol: compute.ForwardingRuleIPProtocolEnumRef(d.Get("ip_protocol").(string)),
- IPVersion: compute.ForwardingRuleIPVersionEnumRef(d.Get("ip_version").(string)),
- Labels: checkStringMap(d.Get("labels")),
- LoadBalancingScheme: compute.ForwardingRuleLoadBalancingSchemeEnumRef(d.Get("load_balancing_scheme").(string)),
- MetadataFilter: expandComputeGlobalForwardingRuleMetadataFilterArray(d.Get("metadata_filters")),
- Network: dcl.StringOrNil(d.Get("network").(string)),
- PortRange: dcl.String(d.Get("port_range").(string)),
- Project: dcl.String(project),
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/global/forwardingRules/{{name}}")
+ if err != nil {
+ return err
}
- userAgent, err := generateUserAgentString(d, config.userAgent)
+ billingProject := ""
+
+ project, err := getProject(d, config)
if err != nil {
- return err
+ return fmt.Errorf("Error fetching project for GlobalForwardingRule: %s", err)
}
- billingProject := project
+ billingProject = project
+
// err == nil indicates that the billing_project value was found
if bp, err := getBillingProject(d, config); err == nil {
billingProject = bp
}
- client := NewDCLComputeClient(config, userAgent, billingProject, d.Timeout(schema.TimeoutRead))
- if bp, err := replaceVars(d, config, client.Config.BasePath); err != nil {
- d.SetId("")
- return fmt.Errorf("Could not format %q: %w", client.Config.BasePath, err)
- } else {
- client.Config.BasePath = bp
- }
- res, err := client.GetForwardingRule(context.Background(), obj)
+
+ res, err := sendRequest(config, "GET", billingProject, url, userAgent, nil)
if err != nil {
- resourceName := fmt.Sprintf("ComputeGlobalForwardingRule %q", d.Id())
- return handleNotFoundDCLError(err, d, resourceName)
+ return handleNotFoundError(err, d, fmt.Sprintf("ComputeGlobalForwardingRule %q", d.Id()))
}
- if err = d.Set("name", res.Name); err != nil {
- return fmt.Errorf("error setting name in state: %s", err)
+ if err := d.Set("project", project); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("target", res.Target); err != nil {
- return fmt.Errorf("error setting target in state: %s", err)
- }
- if err = d.Set("description", res.Description); err != nil {
- return fmt.Errorf("error setting description in state: %s", err)
+
+ if err := d.Set("description", flattenComputeGlobalForwardingRuleDescription(res["description"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("ip_address", res.IPAddress); err != nil {
- return fmt.Errorf("error setting ip_address in state: %s", err)
+ if err := d.Set("ip_address", flattenComputeGlobalForwardingRuleIPAddress(res["IPAddress"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("ip_protocol", res.IPProtocol); err != nil {
- return fmt.Errorf("error setting ip_protocol in state: %s", err)
+ if err := d.Set("ip_protocol", flattenComputeGlobalForwardingRuleIPProtocol(res["IPProtocol"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("ip_version", res.IPVersion); err != nil {
- return fmt.Errorf("error setting ip_version in state: %s", err)
+ if err := d.Set("ip_version", flattenComputeGlobalForwardingRuleIpVersion(res["ipVersion"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("labels", res.Labels); err != nil {
- return fmt.Errorf("error setting labels in state: %s", err)
+ if err := d.Set("load_balancing_scheme", flattenComputeGlobalForwardingRuleLoadBalancingScheme(res["loadBalancingScheme"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("load_balancing_scheme", res.LoadBalancingScheme); err != nil {
- return fmt.Errorf("error setting load_balancing_scheme in state: %s", err)
+ if err := d.Set("metadata_filters", flattenComputeGlobalForwardingRuleMetadataFilters(res["metadataFilters"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("metadata_filters", flattenComputeGlobalForwardingRuleMetadataFilterArray(res.MetadataFilter)); err != nil {
- return fmt.Errorf("error setting metadata_filters in state: %s", err)
+ if err := d.Set("name", flattenComputeGlobalForwardingRuleName(res["name"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("network", res.Network); err != nil {
- return fmt.Errorf("error setting network in state: %s", err)
+ if err := d.Set("port_range", flattenComputeGlobalForwardingRulePortRange(res["portRange"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("port_range", res.PortRange); err != nil {
- return fmt.Errorf("error setting port_range in state: %s", err)
+ if err := d.Set("target", flattenComputeGlobalForwardingRuleTarget(res["target"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("project", res.Project); err != nil {
- return fmt.Errorf("error setting project in state: %s", err)
+ if err := d.Set("psc_connection_id", flattenComputeGlobalForwardingRulePscConnectionId(res["pscConnectionId"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("label_fingerprint", res.LabelFingerprint); err != nil {
- return fmt.Errorf("error setting label_fingerprint in state: %s", err)
+ if err := d.Set("psc_connection_status", flattenComputeGlobalForwardingRulePscConnectionStatus(res["pscConnectionStatus"], d, config)); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
- if err = d.Set("self_link", res.SelfLink); err != nil {
- return fmt.Errorf("error setting self_link in state: %s", err)
+ if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil {
+ return fmt.Errorf("Error reading GlobalForwardingRule: %s", err)
}
return nil
}
+
func resourceComputeGlobalForwardingRuleUpdate(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
- project, err := getProject(d, config)
- if err != nil {
- return err
- }
-
- obj := &compute.ForwardingRule{
- Name: dcl.String(d.Get("name").(string)),
- Target: dcl.String(d.Get("target").(string)),
- Description: dcl.String(d.Get("description").(string)),
- IPAddress: dcl.StringOrNil(d.Get("ip_address").(string)),
- IPProtocol: compute.ForwardingRuleIPProtocolEnumRef(d.Get("ip_protocol").(string)),
- IPVersion: compute.ForwardingRuleIPVersionEnumRef(d.Get("ip_version").(string)),
- Labels: checkStringMap(d.Get("labels")),
- LoadBalancingScheme: compute.ForwardingRuleLoadBalancingSchemeEnumRef(d.Get("load_balancing_scheme").(string)),
- MetadataFilter: expandComputeGlobalForwardingRuleMetadataFilterArray(d.Get("metadata_filters")),
- Network: dcl.StringOrNil(d.Get("network").(string)),
- PortRange: dcl.String(d.Get("port_range").(string)),
- Project: dcl.String(project),
- }
- directive := UpdateDirective
userAgent, err := generateUserAgentString(d, config.userAgent)
if err != nil {
return err
}
billingProject := ""
- // err == nil indicates that the billing_project value was found
- if bp, err := getBillingProject(d, config); err == nil {
- billingProject = bp
- }
- client := NewDCLComputeClient(config, userAgent, billingProject, d.Timeout(schema.TimeoutUpdate))
- if bp, err := replaceVars(d, config, client.Config.BasePath); err != nil {
- d.SetId("")
- return fmt.Errorf("Could not format %q: %w", client.Config.BasePath, err)
- } else {
- client.Config.BasePath = bp
+
+ project, err := getProject(d, config)
+ if err != nil {
+ return fmt.Errorf("Error fetching project for GlobalForwardingRule: %s", err)
}
- res, err := client.ApplyForwardingRule(context.Background(), obj, directive...)
+ billingProject = project
- if _, ok := err.(dcl.DiffAfterApplyError); ok {
- log.Printf("[DEBUG] Diff after apply returned from the DCL: %s", err)
- } else if err != nil {
- // The resource didn't actually create
- d.SetId("")
- return fmt.Errorf("Error updating ForwardingRule: %s", err)
+ d.Partial(true)
+
+ if d.HasChange("target") {
+ obj := make(map[string]interface{})
+
+ targetProp, err := expandComputeGlobalForwardingRuleTarget(d.Get("target"), d, config)
+ if err != nil {
+ return err
+ } else if v, ok := d.GetOkExists("target"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, targetProp)) {
+ obj["target"] = targetProp
+ }
+
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/global/forwardingRules/{{name}}/setTarget")
+ if err != nil {
+ return err
+ }
+
+ // err == nil indicates that the billing_project value was found
+ if bp, err := getBillingProject(d, config); err == nil {
+ billingProject = bp
+ }
+
+ res, err := sendRequestWithTimeout(config, "POST", billingProject, url, userAgent, obj, d.Timeout(schema.TimeoutUpdate))
+ if err != nil {
+ return fmt.Errorf("Error updating GlobalForwardingRule %q: %s", d.Id(), err)
+ } else {
+ log.Printf("[DEBUG] Finished updating GlobalForwardingRule %q: %#v", d.Id(), res)
+ }
+
+ err = computeOperationWaitTime(
+ config, res, project, "Updating GlobalForwardingRule", userAgent,
+ d.Timeout(schema.TimeoutUpdate))
+ if err != nil {
+ return err
+ }
}
- log.Printf("[DEBUG] Finished creating ForwardingRule %q: %#v", d.Id(), res)
+ d.Partial(false)
return resourceComputeGlobalForwardingRuleRead(d, meta)
}
func resourceComputeGlobalForwardingRuleDelete(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
- project, err := getProject(d, config)
+ userAgent, err := generateUserAgentString(d, config.userAgent)
if err != nil {
return err
}
- obj := &compute.ForwardingRule{
- Name: dcl.String(d.Get("name").(string)),
- Target: dcl.String(d.Get("target").(string)),
- Description: dcl.String(d.Get("description").(string)),
- IPAddress: dcl.StringOrNil(d.Get("ip_address").(string)),
- IPProtocol: compute.ForwardingRuleIPProtocolEnumRef(d.Get("ip_protocol").(string)),
- IPVersion: compute.ForwardingRuleIPVersionEnumRef(d.Get("ip_version").(string)),
- Labels: checkStringMap(d.Get("labels")),
- LoadBalancingScheme: compute.ForwardingRuleLoadBalancingSchemeEnumRef(d.Get("load_balancing_scheme").(string)),
- MetadataFilter: expandComputeGlobalForwardingRuleMetadataFilterArray(d.Get("metadata_filters")),
- Network: dcl.StringOrNil(d.Get("network").(string)),
- PortRange: dcl.String(d.Get("port_range").(string)),
- Project: dcl.String(project),
+ billingProject := ""
+
+ project, err := getProject(d, config)
+ if err != nil {
+ return fmt.Errorf("Error fetching project for GlobalForwardingRule: %s", err)
}
+ billingProject = project
- log.Printf("[DEBUG] Deleting ForwardingRule %q", d.Id())
- userAgent, err := generateUserAgentString(d, config.userAgent)
+ url, err := replaceVars(d, config, "{{ComputeBasePath}}projects/{{project}}/global/forwardingRules/{{name}}")
if err != nil {
return err
}
- billingProject := project
+
+ var obj map[string]interface{}
+ log.Printf("[DEBUG] Deleting GlobalForwardingRule %q", d.Id())
+
// err == nil indicates that the billing_project value was found
if bp, err := getBillingProject(d, config); err == nil {
billingProject = bp
}
- client := NewDCLComputeClient(config, userAgent, billingProject, d.Timeout(schema.TimeoutDelete))
- if bp, err := replaceVars(d, config, client.Config.BasePath); err != nil {
- d.SetId("")
- return fmt.Errorf("Could not format %q: %w", client.Config.BasePath, err)
- } else {
- client.Config.BasePath = bp
+
+ res, err := sendRequestWithTimeout(config, "DELETE", billingProject, url, userAgent, obj, d.Timeout(schema.TimeoutDelete))
+ if err != nil {
+ return handleNotFoundError(err, d, "GlobalForwardingRule")
}
- if err := client.DeleteForwardingRule(context.Background(), obj); err != nil {
- return fmt.Errorf("Error deleting ForwardingRule: %s", err)
+
+ err = computeOperationWaitTime(
+ config, res, project, "Deleting GlobalForwardingRule", userAgent,
+ d.Timeout(schema.TimeoutDelete))
+
+ if err != nil {
+ return err
}
- log.Printf("[DEBUG] Finished deleting ForwardingRule %q", d.Id())
+ log.Printf("[DEBUG] Finished deleting GlobalForwardingRule %q: %#v", d.Id(), res)
return nil
}
func resourceComputeGlobalForwardingRuleImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
config := meta.(*Config)
-
if err := parseImportId([]string{
"projects/(?P<project>[^/]+)/global/forwardingRules/(?P<name>[^/]+)",
"(?P<project>[^/]+)/(?P<name>[^/]+)",
@@ -459,7 +545,7 @@ func resourceComputeGlobalForwardingRuleImport(d *schema.ResourceData, meta inte
}
// Replace import id for the resource id
- id, err := replaceVarsForId(d, config, "projects/{{project}}/global/forwardingRules/{{name}}")
+ id, err := replaceVars(d, config, "projects/{{project}}/global/forwardingRules/{{name}}")
if err != nil {
return nil, fmt.Errorf("Error constructing id: %s", err)
}
@@ -468,117 +554,194 @@ func resourceComputeGlobalForwardingRuleImport(d *schema.ResourceData, meta inte
return []*schema.ResourceData{d}, nil
}
-func expandComputeGlobalForwardingRuleMetadataFilterArray(o interface{}) []compute.ForwardingRuleMetadataFilter {
- if o == nil {
- return make([]compute.ForwardingRuleMetadataFilter, 0)
- }
+func flattenComputeGlobalForwardingRuleDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- objs := o.([]interface{})
- if len(objs) == 0 || objs[0] == nil {
- return make([]compute.ForwardingRuleMetadataFilter, 0)
- }
+func flattenComputeGlobalForwardingRuleIPAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- items := make([]compute.ForwardingRuleMetadataFilter, 0, len(objs))
- for _, item := range objs {
- i := expandComputeGlobalForwardingRuleMetadataFilter(item)
- items = append(items, *i)
- }
+func flattenComputeGlobalForwardingRuleIPProtocol(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- return items
+func flattenComputeGlobalForwardingRuleIpVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
}
-func expandComputeGlobalForwardingRuleMetadataFilter(o interface{}) *compute.ForwardingRuleMetadataFilter {
- if o == nil {
- return compute.EmptyForwardingRuleMetadataFilter
- }
+func flattenComputeGlobalForwardingRuleLoadBalancingScheme(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- obj := o.(map[string]interface{})
- return &compute.ForwardingRuleMetadataFilter{
- FilterLabel: expandComputeGlobalForwardingRuleMetadataFilterFilterLabelArray(obj["filter_labels"]),
- FilterMatchCriteria: compute.ForwardingRuleMetadataFilterFilterMatchCriteriaEnumRef(obj["filter_match_criteria"].(string)),
+func flattenComputeGlobalForwardingRuleMetadataFilters(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ if v == nil {
+ return v
+ }
+ l := v.([]interface{})
+ transformed := make([]interface{}, 0, len(l))
+ for _, raw := range l {
+ original := raw.(map[string]interface{})
+ if len(original) < 1 {
+ // Do not include empty json objects coming back from the api
+ continue
+ }
+ transformed = append(transformed, map[string]interface{}{
+ "filter_match_criteria": flattenComputeGlobalForwardingRuleMetadataFiltersFilterMatchCriteria(original["filterMatchCriteria"], d, config),
+ "filter_labels": flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabels(original["filterLabels"], d, config),
+ })
}
+ return transformed
+}
+func flattenComputeGlobalForwardingRuleMetadataFiltersFilterMatchCriteria(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
}
-func flattenComputeGlobalForwardingRuleMetadataFilterArray(objs []compute.ForwardingRuleMetadataFilter) []interface{} {
- if objs == nil {
- return nil
+func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ if v == nil {
+ return v
+ }
+ l := v.([]interface{})
+ transformed := make([]interface{}, 0, len(l))
+ for _, raw := range l {
+ original := raw.(map[string]interface{})
+ if len(original) < 1 {
+ // Do not include empty json objects coming back from the api
+ continue
+ }
+ transformed = append(transformed, map[string]interface{}{
+ "name": flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsName(original["name"], d, config),
+ "value": flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsValue(original["value"], d, config),
+ })
}
+ return transformed
+}
+func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsName(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- items := []interface{}{}
- for _, item := range objs {
- i := flattenComputeGlobalForwardingRuleMetadataFilter(&item)
- items = append(items, i)
- }
+func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsValue(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- return items
+func flattenComputeGlobalForwardingRuleName(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
}
-func flattenComputeGlobalForwardingRuleMetadataFilter(obj *compute.ForwardingRuleMetadataFilter) interface{} {
- if obj == nil || obj.Empty() {
- return nil
- }
- transformed := map[string]interface{}{
- "filter_labels": flattenComputeGlobalForwardingRuleMetadataFilterFilterLabelArray(obj.FilterLabel),
- "filter_match_criteria": obj.FilterMatchCriteria,
- }
+func flattenComputeGlobalForwardingRulePortRange(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- return transformed
+func flattenComputeGlobalForwardingRuleTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
+func flattenComputeGlobalForwardingRulePscConnectionId(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
}
-func expandComputeGlobalForwardingRuleMetadataFilterFilterLabelArray(o interface{}) []compute.ForwardingRuleMetadataFilterFilterLabel {
- if o == nil {
- return make([]compute.ForwardingRuleMetadataFilterFilterLabel, 0)
- }
- objs := o.([]interface{})
- if len(objs) == 0 || objs[0] == nil {
- return make([]compute.ForwardingRuleMetadataFilterFilterLabel, 0)
- }
+func flattenComputeGlobalForwardingRulePscConnectionStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} {
+ return v
+}
- items := make([]compute.ForwardingRuleMetadataFilterFilterLabel, 0, len(objs))
- for _, item := range objs {
- i := expandComputeGlobalForwardingRuleMetadataFilterFilterLabel(item)
- items = append(items, *i)
- }
+func expandComputeGlobalForwardingRuleDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
- return items
+func expandComputeGlobalForwardingRuleIPAddress(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
}
-func expandComputeGlobalForwardingRuleMetadataFilterFilterLabel(o interface{}) *compute.ForwardingRuleMetadataFilterFilterLabel {
- if o == nil {
- return compute.EmptyForwardingRuleMetadataFilterFilterLabel
- }
+func expandComputeGlobalForwardingRuleIPProtocol(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
- obj := o.(map[string]interface{})
- return &compute.ForwardingRuleMetadataFilterFilterLabel{
- Name: dcl.String(obj["name"].(string)),
- Value: dcl.String(obj["value"].(string)),
- }
+func expandComputeGlobalForwardingRuleIpVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
}
-func flattenComputeGlobalForwardingRuleMetadataFilterFilterLabelArray(objs []compute.ForwardingRuleMetadataFilterFilterLabel) []interface{} {
- if objs == nil {
- return nil
- }
+func expandComputeGlobalForwardingRuleLoadBalancingScheme(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
- items := []interface{}{}
- for _, item := range objs {
- i := flattenComputeGlobalForwardingRuleMetadataFilterFilterLabel(&item)
- items = append(items, i)
- }
+func expandComputeGlobalForwardingRuleMetadataFilters(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ l := v.([]interface{})
+ req := make([]interface{}, 0, len(l))
+ for _, raw := range l {
+ if raw == nil {
+ continue
+ }
+ original := raw.(map[string]interface{})
+ transformed := make(map[string]interface{})
+
+ transformedFilterMatchCriteria, err := expandComputeGlobalForwardingRuleMetadataFiltersFilterMatchCriteria(original["filter_match_criteria"], d, config)
+ if err != nil {
+ return nil, err
+ } else if val := reflect.ValueOf(transformedFilterMatchCriteria); val.IsValid() && !isEmptyValue(val) {
+ transformed["filterMatchCriteria"] = transformedFilterMatchCriteria
+ }
+
+ transformedFilterLabels, err := expandComputeGlobalForwardingRuleMetadataFiltersFilterLabels(original["filter_labels"], d, config)
+ if err != nil {
+ return nil, err
+ } else if val := reflect.ValueOf(transformedFilterLabels); val.IsValid() && !isEmptyValue(val) {
+ transformed["filterLabels"] = transformedFilterLabels
+ }
+
+ req = append(req, transformed)
+ }
+ return req, nil
+}
- return items
+func expandComputeGlobalForwardingRuleMetadataFiltersFilterMatchCriteria(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
}
-func flattenComputeGlobalForwardingRuleMetadataFilterFilterLabel(obj *compute.ForwardingRuleMetadataFilterFilterLabel) interface{} {
- if obj == nil || obj.Empty() {
- return nil
- }
- transformed := map[string]interface{}{
- "name": obj.Name,
- "value": obj.Value,
- }
+func expandComputeGlobalForwardingRuleMetadataFiltersFilterLabels(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ l := v.([]interface{})
+ req := make([]interface{}, 0, len(l))
+ for _, raw := range l {
+ if raw == nil {
+ continue
+ }
+ original := raw.(map[string]interface{})
+ transformed := make(map[string]interface{})
+
+ transformedName, err := expandComputeGlobalForwardingRuleMetadataFiltersFilterLabelsName(original["name"], d, config)
+ if err != nil {
+ return nil, err
+ } else if val := reflect.ValueOf(transformedName); val.IsValid() && !isEmptyValue(val) {
+ transformed["name"] = transformedName
+ }
+
+ transformedValue, err := expandComputeGlobalForwardingRuleMetadataFiltersFilterLabelsValue(original["value"], d, config)
+ if err != nil {
+ return nil, err
+ } else if val := reflect.ValueOf(transformedValue); val.IsValid() && !isEmptyValue(val) {
+ transformed["value"] = transformedValue
+ }
+
+ req = append(req, transformed)
+ }
+ return req, nil
+}
- return transformed
+func expandComputeGlobalForwardingRuleMetadataFiltersFilterLabelsName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeGlobalForwardingRuleMetadataFiltersFilterLabelsValue(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeGlobalForwardingRuleName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+
+func expandComputeGlobalForwardingRulePortRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
+}
+func expandComputeGlobalForwardingRuleTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
+ return v, nil
}
12:30 $ make terraform VERSION=ga OUTPUT_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google"
make mmv1
make[1]: Entering directory '/home/cata/magic-modules'
cd mmv1;\
bundle; \
bundle exec compiler -e terraform -o /home/cata/go/src/github.com/hashicorp/terraform-provider-google -v ga -a;
Using rake 13.0.6
Following files may not be writable, so sudo is needed:
/usr/bin
/usr/share/gems
/usr/share/gems/build_info
/usr/share/gems/cache
/usr/share/gems/doc
/usr/share/gems/extensions
/usr/share/gems/gems
/usr/share/gems/plugins
/usr/share/gems/specifications
Using concurrent-ruby 1.1.10
Using i18n 1.10.0
Using minitest 5.15.0
Using tzinfo 2.0.4
Using activesupport 7.0.3
Using public_suffix 4.0.7
Using addressable 2.8.0
Using ast 2.4.2
Using debug_inspector 1.1.0
Using binding_of_caller 1.0.0
Using bundler 2.2.22
Using diff-lcs 1.5.0
Using faraday-net_http 2.0.3
Using ruby2_keywords 0.0.5
Using faraday 2.3.0
Using metaclass 0.0.4
Using mocha 1.3.0
Using sawyer 0.9.1
Using octokit 4.23.0
Using parallel 1.22.1
Using parser 3.1.2.0
Using rainbow 3.1.1
Using regexp_parser 2.5.0
Using rexml 3.2.5
Using rspec-support 3.11.0
Using rspec-core 3.11.0
Using rspec-expectations 3.11.0
Using rspec-mocks 3.11.1
Using rspec 3.11.0
Using rubocop-ast 1.18.0
Using ruby-progressbar 1.11.0
Using unicode-display_width 2.1.0
Using rubocop 1.30.1
Bundle complete! 7 Gemfile dependencies, 34 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
I, [2022-06-08T11:30:37.733973 #20397] INFO -- : Generating MM output to '/home/cata/go/src/github.com/hashicorp/terraform-provider-google'
I, [2022-06-08T11:30:37.734179 #20397] INFO -- : Using ga version
I, [2022-06-08T11:30:37.816941 #20397] INFO -- : products/accessapproval: Compiling provider config
I, [2022-06-08T11:30:37.822009 #20397] INFO -- : products/accessapproval: Generating types: ALL
I, [2022-06-08T11:30:37.822062 #20397] INFO -- : Generating FolderSettings
I, [2022-06-08T11:30:38.745258 #20397] INFO -- : Generating ProjectSettings
I, [2022-06-08T11:30:38.854158 #20397] INFO -- : Generating OrganizationSettings
I, [2022-06-08T11:30:40.245249 #20397] INFO -- : products/accesscontextmanager: Compiling provider config
I, [2022-06-08T11:30:40.250309 #20397] INFO -- : products/accesscontextmanager: Generating types: ALL
I, [2022-06-08T11:30:40.250344 #20397] INFO -- : Generating AccessPolicy
I, [2022-06-08T11:30:40.341136 #20397] INFO -- : Generating AccessLevel
I, [2022-06-08T11:30:40.604719 #20397] INFO -- : Generating AccessLevels
I, [2022-06-08T11:30:40.867246 #20397] INFO -- : Generating AccessLevelCondition
I, [2022-06-08T11:30:41.577505 #20397] INFO -- : Generating ServicePerimeter
I, [2022-06-08T11:30:42.752656 #20397] INFO -- : Generating ServicePerimeters
I, [2022-06-08T11:30:43.406485 #20397] INFO -- : Generating ServicePerimeterResource
I, [2022-06-08T11:30:43.984256 #20397] INFO -- : Generating GcpUserAccessBinding
I, [2022-06-08T11:30:44.105631 #20397] INFO -- : products/activedirectory: Compiling provider config
I, [2022-06-08T11:30:44.110394 #20397] INFO -- : products/activedirectory: Generating types: ALL
I, [2022-06-08T11:30:44.110507 #20397] INFO -- : Generating Domain
I, [2022-06-08T11:30:44.232891 #20397] INFO -- : Generating DomainTrust
I, [2022-06-08T11:30:44.356435 #20397] INFO -- : products/apigateway does not have a 'ga' version, skipping
I, [2022-06-08T11:30:44.479462 #20397] INFO -- : products/apigee: Compiling provider config
I, [2022-06-08T11:30:44.486087 #20397] INFO -- : products/apigee: Generating types: ALL
I, [2022-06-08T11:30:44.486150 #20397] INFO -- : Generating Organization
I, [2022-06-08T11:30:45.250513 #20397] INFO -- : Generating Instance
I, [2022-06-08T11:30:46.083591 #20397] INFO -- : Generating Environment
I, [2022-06-08T11:30:46.842866 #20397] INFO -- : Generating Envgroup
I, [2022-06-08T11:30:46.921967 #20397] INFO -- : Generating InstanceAttachment
I, [2022-06-08T11:30:47.605290 #20397] INFO -- : Generating EnvgroupAttachment
I, [2022-06-08T11:30:47.661477 #20397] INFO -- : Generating EndpointAttachment
I, [2022-06-08T11:30:49.210391 #20397] INFO -- : products/appengine: Compiling provider config
I, [2022-06-08T11:30:49.215948 #20397] INFO -- : products/appengine: Generating types: ALL
I, [2022-06-08T11:30:49.215986 #20397] INFO -- : Generating DomainMapping
I, [2022-06-08T11:30:49.919062 #20397] INFO -- : Generating FirewallRule
I, [2022-06-08T11:30:50.577592 #20397] INFO -- : Excluding Service per API catalog
I, [2022-06-08T11:30:50.577645 #20397] INFO -- : Generating StandardAppVersion
I, [2022-06-08T11:30:52.580082 #20397] INFO -- : Generating FlexibleAppVersion
I, [2022-06-08T11:30:55.006198 #20397] INFO -- : Generating ApplicationUrlDispatchRules
I, [2022-06-08T11:30:56.519162 #20397] INFO -- : Generating ServiceSplitTraffic
I, [2022-06-08T11:30:57.180816 #20397] INFO -- : Generating ServiceNetworkSettings
I, [2022-06-08T11:30:57.825077 #20397] INFO -- : products/artifactregistry does not have a 'ga' version, skipping
I, [2022-06-08T11:30:58.874692 #20397] INFO -- : products/bigquery: Compiling provider config
I, [2022-06-08T11:30:58.879657 #20397] INFO -- : products/bigquery: Generating types: ALL
I, [2022-06-08T11:30:58.879691 #20397] INFO -- : Generating Dataset
I, [2022-06-08T11:30:59.754779 #20397] INFO -- : Generating DatasetAccess
I, [2022-06-08T11:31:00.561488 #20397] INFO -- : Generating Job
I, [2022-06-08T11:31:02.006782 #20397] INFO -- : Generating Table
I, [2022-06-08T11:31:02.054943 #20397] INFO -- : Generating Routine
I, [2022-06-08T11:31:03.023483 #20397] INFO -- : products/bigqueryconnection: Compiling provider config
I, [2022-06-08T11:31:03.027998 #20397] INFO -- : products/bigqueryconnection: Generating types: ALL
I, [2022-06-08T11:31:03.028043 #20397] INFO -- : Generating Connection
I, [2022-06-08T11:31:03.349095 #20397] INFO -- : products/bigquerydatatransfer: Compiling provider config
I, [2022-06-08T11:31:03.355412 #20397] INFO -- : products/bigquerydatatransfer: Generating types: ALL
I, [2022-06-08T11:31:03.355457 #20397] INFO -- : Generating Config
I, [2022-06-08T11:31:04.215497 #20397] INFO -- : products/bigqueryreservation: Compiling provider config
I, [2022-06-08T11:31:04.220957 #20397] INFO -- : products/bigqueryreservation: Generating types: ALL
I, [2022-06-08T11:31:04.220997 #20397] INFO -- : Generating Reservation
I, [2022-06-08T11:31:04.340898 #20397] INFO -- : products/bigtable: Compiling provider config
I, [2022-06-08T11:31:04.348222 #20397] INFO -- : products/bigtable: Generating types: ALL
I, [2022-06-08T11:31:04.348258 #20397] INFO -- : Generating AppProfile
I, [2022-06-08T11:31:05.649602 #20397] INFO -- : Excluding Instance per API catalog
I, [2022-06-08T11:31:05.729169 #20397] INFO -- : products/billingbudget: Compiling provider config
I, [2022-06-08T11:31:05.733941 #20397] INFO -- : products/billingbudget: Generating types: ALL
I, [2022-06-08T11:31:05.733983 #20397] INFO -- : Generating Budget
I, [2022-06-08T11:31:06.723944 #20397] INFO -- : products/binaryauthorization: Compiling provider config
I, [2022-06-08T11:31:06.728487 #20397] INFO -- : products/binaryauthorization: Generating types: ALL
I, [2022-06-08T11:31:06.728532 #20397] INFO -- : Generating Attestor
I, [2022-06-08T11:31:07.547848 #20397] INFO -- : Generating Policy
I, [2022-06-08T11:31:08.337669 #20397] INFO -- : products/certificatemanager: Compiling provider config
I, [2022-06-08T11:31:08.342425 #20397] INFO -- : products/certificatemanager: Generating types: ALL
I, [2022-06-08T11:31:08.342464 #20397] INFO -- : Generating DnsAuthorization
I, [2022-06-08T11:31:08.445024 #20397] INFO -- : Generating Certificate
I, [2022-06-08T11:31:08.634637 #20397] INFO -- : products/cgc: Compiling provider config
I, [2022-06-08T11:31:08.640581 #20397] INFO -- : products/cgc: Generating types: ALL
I, [2022-06-08T11:31:08.640625 #20397] INFO -- : Generating Snippet
I, [2022-06-08T11:31:08.791433 #20397] INFO -- : products/cloudasset: Compiling provider config
I, [2022-06-08T11:31:08.797182 #20397] INFO -- : products/cloudasset: Generating types: ALL
I, [2022-06-08T11:31:08.797220 #20397] INFO -- : Generating ProjectFeed
I, [2022-06-08T11:31:08.994393 #20397] INFO -- : Generating FolderFeed
I, [2022-06-08T11:31:09.787005 #20397] INFO -- : Generating OrganizationFeed
I, [2022-06-08T11:31:10.648549 #20397] INFO -- : products/cloudbilling: Skipped as no terraform.yaml file exists
I, [2022-06-08T11:31:11.267819 #20397] INFO -- : products/cloudbuild: Compiling provider config
I, [2022-06-08T11:31:11.273492 #20397] INFO -- : products/cloudbuild: Generating types: ALL
I, [2022-06-08T11:31:11.273527 #20397] INFO -- : Generating Trigger
I, [2022-06-08T11:31:12.963324 #20397] INFO -- : products/cloudfunctions: Compiling provider config
I, [2022-06-08T11:31:12.969588 #20397] INFO -- : products/cloudfunctions: Generating types: ALL
I, [2022-06-08T11:31:12.969642 #20397] INFO -- : Generating CloudFunction
I, [2022-06-08T11:31:13.074744 #20397] INFO -- : products/cloudfunctions2 does not have a 'ga' version, skipping
I, [2022-06-08T11:31:13.150838 #20397] INFO -- : products/cloudidentity: Compiling provider config
I, [2022-06-08T11:31:13.155147 #20397] INFO -- : products/cloudidentity: Generating types: ALL
I, [2022-06-08T11:31:13.155201 #20397] INFO -- : Generating Group
I, [2022-06-08T11:31:13.270769 #20397] INFO -- : Generating GroupMembership
I, [2022-06-08T11:31:14.165823 #20397] INFO -- : products/cloudiot: Compiling provider config
I, [2022-06-08T11:31:14.172259 #20397] INFO -- : products/cloudiot: Generating types: ALL
I, [2022-06-08T11:31:14.172302 #20397] INFO -- : Generating DeviceRegistry
I, [2022-06-08T11:31:14.893244 #20397] INFO -- : Generating Device
I, [2022-06-08T11:31:15.775179 #20397] INFO -- : products/cloudrun: Compiling provider config
I, [2022-06-08T11:31:15.780057 #20397] INFO -- : products/cloudrun: Generating types: ALL
I, [2022-06-08T11:31:15.780165 #20397] INFO -- : Generating DomainMapping
I, [2022-06-08T11:31:16.659932 #20397] INFO -- : Generating Service
I, [2022-06-08T11:31:18.189766 #20397] INFO -- : products/cloudscheduler: Compiling provider config
I, [2022-06-08T11:31:18.194820 #20397] INFO -- : products/cloudscheduler: Generating types: ALL
I, [2022-06-08T11:31:18.194878 #20397] INFO -- : Generating Job
I, [2022-06-08T11:31:19.281609 #20397] INFO -- : products/cloudtasks: Compiling provider config
I, [2022-06-08T11:31:19.288575 #20397] INFO -- : products/cloudtasks: Generating types: ALL
I, [2022-06-08T11:31:19.288627 #20397] INFO -- : Generating Queue
I, [2022-06-08T11:31:34.307672 #20397] INFO -- : products/compute: Compiling provider config
I, [2022-06-08T11:31:34.312475 #20397] INFO -- : products/compute: Generating types: ALL
I, [2022-06-08T11:31:34.312507 #20397] INFO -- : Generating Address
I, [2022-06-08T11:31:34.473865 #20397] INFO -- : Generating Autoscaler
I, [2022-06-08T11:31:34.789780 #20397] INFO -- : Generating BackendBucket
I, [2022-06-08T11:31:35.643880 #20397] INFO -- : Generating BackendBucketSignedUrlKey
I, [2022-06-08T11:31:36.288371 #20397] INFO -- : Generating BackendService
I, [2022-06-08T11:31:37.847035 #20397] INFO -- : Generating RegionBackendService
I, [2022-06-08T11:31:39.369489 #20397] INFO -- : Generating BackendServiceSignedUrlKey
I, [2022-06-08T11:31:39.995005 #20397] INFO -- : Excluding DiskType per API catalog
I, [2022-06-08T11:31:39.995072 #20397] INFO -- : Generating RegionDiskResourcePolicyAttachment
I, [2022-06-08T11:31:40.062646 #20397] INFO -- : Generating DiskResourcePolicyAttachment
I, [2022-06-08T11:31:40.125070 #20397] INFO -- : Generating Disk
I, [2022-06-08T11:31:41.151543 #20397] INFO -- : Generating Firewall
I, [2022-06-08T11:31:42.084585 #20397] INFO -- : Generating ForwardingRule
I, [2022-06-08T11:31:43.030995 #20397] INFO -- : Generating GlobalAddress
I, [2022-06-08T11:31:43.155793 #20397] INFO -- : Generating GlobalForwardingRule
I, [2022-06-08T11:31:43.368875 #20397] INFO -- : Generating HttpHealthCheck
I, [2022-06-08T11:31:43.513083 #20397] INFO -- : Generating HttpsHealthCheck
I, [2022-06-08T11:31:43.657094 #20397] INFO -- : Generating HealthCheck
I, [2022-06-08T11:31:44.852868 #20397] INFO -- : Excluding InstanceTemplate per API catalog
I, [2022-06-08T11:31:44.852911 #20397] INFO -- : Excluding License per API catalog
I, [2022-06-08T11:31:44.852937 #20397] INFO -- : Generating Image
I, [2022-06-08T11:31:45.092642 #20397] INFO -- : Generating Instance
I, [2022-06-08T11:31:45.145013 #20397] INFO -- : Excluding InstanceGroup per API catalog
I, [2022-06-08T11:31:45.145047 #20397] INFO -- : Excluding InstanceGroupManager per API catalog
I, [2022-06-08T11:31:45.145071 #20397] INFO -- : Generating InstanceGroupNamedPort
I, [2022-06-08T11:31:45.760007 #20397] INFO -- : Excluding RegionInstanceGroupManager per API catalog
I, [2022-06-08T11:31:45.760076 #20397] INFO -- : Generating InterconnectAttachment
I, [2022-06-08T11:31:45.992063 #20397] INFO -- : Excluding MachineImage per API version
I, [2022-06-08T11:31:45.992113 #20397] INFO -- : Excluding MachineType per API catalog
I, [2022-06-08T11:31:45.992142 #20397] INFO -- : Generating Network
I, [2022-06-08T11:31:46.109430 #20397] INFO -- : Generating NetworkEndpoint
I, [2022-06-08T11:31:46.762626 #20397] INFO -- : Generating NetworkEndpointGroup
I, [2022-06-08T11:31:46.906378 #20397] INFO -- : Generating GlobalNetworkEndpoint
I, [2022-06-08T11:31:47.503642 #20397] INFO -- : Generating GlobalNetworkEndpointGroup
I, [2022-06-08T11:31:47.589771 #20397] INFO -- : Generating RegionNetworkEndpointGroup
I, [2022-06-08T11:31:47.790488 #20397] INFO -- : Generating NodeGroup
I, [2022-06-08T11:31:48.603118 #20397] INFO -- : Generating NetworkPeeringRoutesConfig
I, [2022-06-08T11:31:49.233363 #20397] INFO -- : Generating NodeTemplate
I, [2022-06-08T11:31:49.418121 #20397] INFO -- : Excluding OrganizationSecurityPolicy per API version
I, [2022-06-08T11:31:49.418168 #20397] INFO -- : Excluding OrganizationSecurityPolicyAssociation per API version
I, [2022-06-08T11:31:49.418187 #20397] INFO -- : Excluding OrganizationSecurityPolicyRule per API version
I, [2022-06-08T11:31:49.418205 #20397] INFO -- : Generating PacketMirroring
I, [2022-06-08T11:31:49.638728 #20397] INFO -- : Generating PerInstanceConfig
I, [2022-06-08T11:31:50.308136 #20397] INFO -- : Generating RegionPerInstanceConfig
I, [2022-06-08T11:31:50.966274 #20397] INFO -- : Excluding ProjectInfo per API catalog
I, [2022-06-08T11:31:50.966310 #20397] INFO -- : Excluding Region per API catalog
I, [2022-06-08T11:31:50.966332 #20397] INFO -- : Generating RegionAutoscaler
I, [2022-06-08T11:31:51.289777 #20397] INFO -- : Excluding RegionDiskType per API catalog
I, [2022-06-08T11:31:51.289835 #20397] INFO -- : Generating RegionDisk
I, [2022-06-08T11:31:52.194405 #20397] INFO -- : Generating RegionUrlMap
I, [2022-06-08T11:31:53.987080 #20397] INFO -- : Generating RegionHealthCheck
I, [2022-06-08T11:31:54.547528 #20397] INFO -- : Generating ResourcePolicy
I, [2022-06-08T11:31:54.881920 #20397] INFO -- : Generating Route
I, [2022-06-08T11:31:55.598083 #20397] INFO -- : Generating Router
I, [2022-06-08T11:31:56.376613 #20397] INFO -- : Generating RouterNat
I, [2022-06-08T11:31:57.246593 #20397] INFO -- : Generating RouterBgpPeer
I, [2022-06-08T11:31:58.077552 #20397] INFO -- : Excluding SecurityPolicy per API catalog
I, [2022-06-08T11:31:58.077620 #20397] INFO -- : Generating Snapshot
I, [2022-06-08T11:31:58.913528 #20397] INFO -- : Generating SslCertificate
I, [2022-06-08T11:31:59.023776 #20397] INFO -- : Generating ManagedSslCertificate
I, [2022-06-08T11:31:59.143673 #20397] INFO -- : Generating RegionSslCertificate
I, [2022-06-08T11:31:59.259139 #20397] INFO -- : Generating Reservation
I, [2022-06-08T11:32:00.141788 #20397] INFO -- : Generating ServiceAttachment
I, [2022-06-08T11:32:00.324371 #20397] INFO -- : Generating SslPolicy
I, [2022-06-08T11:32:01.096772 #20397] INFO -- : Generating Subnetwork
I, [2022-06-08T11:32:02.388201 #20397] INFO -- : Generating TargetHttpProxy
I, [2022-06-08T11:32:02.488915 #20397] INFO -- : Generating TargetHttpsProxy
I, [2022-06-08T11:32:02.610306 #20397] INFO -- : Generating RegionTargetHttpProxy
I, [2022-06-08T11:32:02.714159 #20397] INFO -- : Generating RegionTargetHttpsProxy
I, [2022-06-08T11:32:02.817809 #20397] INFO -- : Generating TargetInstance
I, [2022-06-08T11:32:03.555504 #20397] INFO -- : Excluding TargetPool per API catalog
I, [2022-06-08T11:32:03.555597 #20397] INFO -- : Generating TargetSslProxy
I, [2022-06-08T11:32:03.681431 #20397] INFO -- : Generating TargetTcpProxy
I, [2022-06-08T11:32:03.802536 #20397] INFO -- : Generating VpnGateway
I, [2022-06-08T11:32:03.899378 #20397] INFO -- : Generating HaVpnGateway
I, [2022-06-08T11:32:04.018585 #20397] INFO -- : Generating ExternalVpnGateway
I, [2022-06-08T11:32:04.118749 #20397] INFO -- : Generating UrlMap
I, [2022-06-08T11:32:07.636058 #20397] INFO -- : Generating VpnTunnel
I, [2022-06-08T11:32:08.516875 #20397] INFO -- : Excluding Zone per API catalog
I, [2022-06-08T11:32:08.516938 #20397] INFO -- : Generating TargetGrpcProxy
I, [2022-06-08T11:32:08.632528 #20397] INFO -- : products/container: Skipped as no terraform.yaml file exists
I, [2022-06-08T11:32:08.737874 #20397] INFO -- : products/containeranalysis: Compiling provider config
I, [2022-06-08T11:32:08.744933 #20397] INFO -- : products/containeranalysis: Generating types: ALL
I, [2022-06-08T11:32:08.744974 #20397] INFO -- : Generating Note
I, [2022-06-08T11:32:09.456151 #20397] INFO -- : Generating Occurrence
I, [2022-06-08T11:32:10.431410 #20397] INFO -- : products/datacatalog: Compiling provider config
I, [2022-06-08T11:32:10.436589 #20397] INFO -- : products/datacatalog: Generating types: ALL
I, [2022-06-08T11:32:10.436636 #20397] INFO -- : Generating EntryGroup
I, [2022-06-08T11:32:11.275216 #20397] INFO -- : Generating Entry
I, [2022-06-08T11:32:12.256697 #20397] INFO -- : Generating TagTemplate
I, [2022-06-08T11:32:13.153467 #20397] INFO -- : Generating Tag
I, [2022-06-08T11:32:13.970365 #20397] INFO -- : Excluding Taxonomy per API version
I, [2022-06-08T11:32:13.970419 #20397] INFO -- : Excluding PolicyTag per API version
I, [2022-06-08T11:32:14.063801 #20397] INFO -- : products/datafusion: Compiling provider config
I, [2022-06-08T11:32:14.067534 #20397] INFO -- : products/datafusion: Generating types: ALL
I, [2022-06-08T11:32:14.067591 #20397] INFO -- : Generating Instance
I, [2022-06-08T11:32:14.533506 #20397] INFO -- : products/dataproc: Compiling provider config
I, [2022-06-08T11:32:14.538325 #20397] INFO -- : products/dataproc: Generating types: ALL
I, [2022-06-08T11:32:14.538361 #20397] INFO -- : Generating AutoscalingPolicy
I, [2022-06-08T11:32:14.735963 #20397] INFO -- : Excluding Cluster per API catalog
I, [2022-06-08T11:32:14.826268 #20397] INFO -- : products/datastore: Compiling provider config
I, [2022-06-08T11:32:14.830612 #20397] INFO -- : products/datastore: Generating types: ALL
I, [2022-06-08T11:32:14.830657 #20397] INFO -- : Generating Index
I, [2022-06-08T11:32:15.078622 #20397] INFO -- : products/deploymentmanager: Compiling provider config
I, [2022-06-08T11:32:15.084129 #20397] INFO -- : products/deploymentmanager: Generating types: ALL
I, [2022-06-08T11:32:15.084182 #20397] INFO -- : Generating Deployment
I, [2022-06-08T11:32:16.038331 #20397] INFO -- : products/dialogflow: Compiling provider config
I, [2022-06-08T11:32:16.044173 #20397] INFO -- : products/dialogflow: Generating types: ALL
I, [2022-06-08T11:32:16.044216 #20397] INFO -- : Generating Agent
I, [2022-06-08T11:32:16.188359 #20397] INFO -- : Generating Intent
I, [2022-06-08T11:32:17.004995 #20397] INFO -- : Generating EntityType
I, [2022-06-08T11:32:17.756982 #20397] INFO -- : Generating Fulfillment
I, [2022-06-08T11:32:18.428864 #20397] INFO -- : products/dialogflowcx: Compiling provider config
I, [2022-06-08T11:32:18.433152 #20397] INFO -- : products/dialogflowcx: Generating types: ALL
I, [2022-06-08T11:32:18.433185 #20397] INFO -- : Generating Agent
I, [2022-06-08T11:32:18.568395 #20397] INFO -- : Generating Intent
I, [2022-06-08T11:32:19.401971 #20397] INFO -- : Generating Flow
I, [2022-06-08T11:32:20.371583 #20397] INFO -- : Generating Version
I, [2022-06-08T11:32:21.128604 #20397] INFO -- : Generating Page
I, [2022-06-08T11:32:22.264843 #20397] INFO -- : Generating EntityType
I, [2022-06-08T11:32:23.054516 #20397] INFO -- : Generating Environment
I, [2022-06-08T11:32:24.826239 #20397] INFO -- : products/dlp: Compiling provider config
I, [2022-06-08T11:32:24.833867 #20397] INFO -- : products/dlp: Generating types: ALL
I, [2022-06-08T11:32:24.833905 #20397] INFO -- : Generating JobTrigger
I, [2022-06-08T11:32:25.293480 #20397] INFO -- : Generating InspectTemplate
I, [2022-06-08T11:32:25.847904 #20397] INFO -- : Generating StoredInfoType
I, [2022-06-08T11:32:26.114158 #20397] INFO -- : Generating DeidentifyTemplate
I, [2022-06-08T11:32:27.029458 #20397] INFO -- : products/dns: Compiling provider config
I, [2022-06-08T11:32:27.036918 #20397] INFO -- : products/dns: Generating types: ALL
I, [2022-06-08T11:32:27.036966 #20397] INFO -- : Generating ManagedZone
I, [2022-06-08T11:32:27.908089 #20397] INFO -- : Generating Policy
I, [2022-06-08T11:32:28.670736 #20397] INFO -- : Excluding Project per API catalog
I, [2022-06-08T11:32:28.670778 #20397] INFO -- : Excluding ResourceRecordSet per API catalog
I, [2022-06-08T11:32:28.670806 #20397] INFO -- : Excluding ResponsePolicy per API version
I, [2022-06-08T11:32:28.670823 #20397] INFO -- : Excluding ResponsePolicyRule per API version
I, [2022-06-08T11:32:28.753943 #20397] INFO -- : products/essentialcontacts: Compiling provider config
I, [2022-06-08T11:32:28.759648 #20397] INFO -- : products/essentialcontacts: Generating types: ALL
I, [2022-06-08T11:32:28.759692 #20397] INFO -- : Generating Contact
I, [2022-06-08T11:32:28.965551 #20397] INFO -- : products/filestore: Compiling provider config
I, [2022-06-08T11:32:28.971672 #20397] INFO -- : products/filestore: Generating types: ALL
I, [2022-06-08T11:32:28.971716 #20397] INFO -- : Generating Instance
I, [2022-06-08T11:32:29.894478 #20397] INFO -- : products/firebase does not have a 'ga' version, skipping
I, [2022-06-08T11:32:29.968728 #20397] INFO -- : products/firestore: Compiling provider config
I, [2022-06-08T11:32:29.975453 #20397] INFO -- : products/firestore: Generating types: ALL
I, [2022-06-08T11:32:29.975485 #20397] INFO -- : Generating Index
I, [2022-06-08T11:32:30.698478 #20397] INFO -- : Generating Document
I, [2022-06-08T11:32:31.622845 #20397] INFO -- : products/gameservices: Compiling provider config
I, [2022-06-08T11:32:31.627545 #20397] INFO -- : products/gameservices: Generating types: ALL
I, [2022-06-08T11:32:31.627616 #20397] INFO -- : Generating Realm
I, [2022-06-08T11:32:31.718663 #20397] INFO -- : Generating GameServerCluster
I, [2022-06-08T11:32:31.842339 #20397] INFO -- : Generating GameServerDeployment
I, [2022-06-08T11:32:31.923902 #20397] INFO -- : Generating GameServerConfig
I, [2022-06-08T11:32:32.122667 #20397] INFO -- : Generating GameServerDeploymentRollout
I, [2022-06-08T11:32:32.334706 #20397] INFO -- : products/gkehub: Compiling provider config
I, [2022-06-08T11:32:32.339228 #20397] INFO -- : products/gkehub: Generating types: ALL
I, [2022-06-08T11:32:32.339271 #20397] INFO -- : Generating Membership
I, [2022-06-08T11:32:32.646040 #20397] INFO -- : products/healthcare: Compiling provider config
I, [2022-06-08T11:32:32.651842 #20397] INFO -- : products/healthcare: Generating types: ALL
I, [2022-06-08T11:32:32.651926 #20397] INFO -- : Generating Dataset
I, [2022-06-08T11:32:32.745795 #20397] INFO -- : Generating DicomStore
I, [2022-06-08T11:32:32.848367 #20397] INFO -- : Generating FhirStore
I, [2022-06-08T11:32:33.062912 #20397] INFO -- : Generating Hl7V2Store
I, [2022-06-08T11:32:33.867735 #20397] INFO -- : Generating ConsentStore
I, [2022-06-08T11:32:34.005449 #20397] INFO -- : products/iam: Skipped as no terraform.yaml file exists
I, [2022-06-08T11:32:34.046016 #20397] INFO -- : products/iam2 does not have a 'ga' version, skipping
I, [2022-06-08T11:32:34.085549 #20397] INFO -- : products/iambeta does not have a 'ga' version, skipping
I, [2022-06-08T11:32:34.203874 #20397] INFO -- : products/iap: Compiling provider config
I, [2022-06-08T11:32:34.207343 #20397] INFO -- : products/iap: Generating types: ALL
I, [2022-06-08T11:32:34.207406 #20397] INFO -- : Generating Web
I, [2022-06-08T11:32:34.256223 #20397] INFO -- : Generating WebTypeCompute
I, [2022-06-08T11:32:34.300970 #20397] INFO -- : Generating WebTypeAppEngine
I, [2022-06-08T11:32:34.957186 #20397] INFO -- : Generating AppEngineVersion
I, [2022-06-08T11:32:34.999006 #20397] INFO -- : Generating AppEngineService
I, [2022-06-08T11:32:35.043844 #20397] INFO -- : Generating WebBackendService
I, [2022-06-08T11:32:35.086828 #20397] INFO -- : Generating TunnelInstance
I, [2022-06-08T11:32:35.135318 #20397] INFO -- : Generating Tunnel
I, [2022-06-08T11:32:35.188028 #20397] INFO -- : Generating Brand
I, [2022-06-08T11:32:35.911063 #20397] INFO -- : Generating Client
I, [2022-06-08T11:32:36.786445 #20397] INFO -- : products/identityplatform: Compiling provider config
I, [2022-06-08T11:32:36.792341 #20397] INFO -- : products/identityplatform: Generating types: ALL
I, [2022-06-08T11:32:36.792425 #20397] INFO -- : Generating DefaultSupportedIdpConfig
I, [2022-06-08T11:32:36.863481 #20397] INFO -- : Generating TenantDefaultSupportedIdpConfig
I, [2022-06-08T11:32:36.946505 #20397] INFO -- : Generating InboundSamlConfig
I, [2022-06-08T11:32:37.115781 #20397] INFO -- : Generating TenantInboundSamlConfig
I, [2022-06-08T11:32:37.308955 #20397] INFO -- : Generating OauthIdpConfig
I, [2022-06-08T11:32:37.409495 #20397] INFO -- : Generating TenantOauthIdpConfig
I, [2022-06-08T11:32:37.513033 #20397] INFO -- : Generating Tenant
I, [2022-06-08T11:32:37.750144 #20397] INFO -- : products/kms: Compiling provider config
I, [2022-06-08T11:32:37.754676 #20397] INFO -- : products/kms: Generating types: ALL
I, [2022-06-08T11:32:37.754731 #20397] INFO -- : Generating KeyRing
I, [2022-06-08T11:32:37.797712 #20397] INFO -- : Generating CryptoKey
I, [2022-06-08T11:32:38.519379 #20397] INFO -- : Generating KeyRingImportJob
I, [2022-06-08T11:32:39.251893 #20397] INFO -- : Generating SecretCiphertext
I, [2022-06-08T11:32:40.112548 #20397] INFO -- : products/logging: Compiling provider config
I, [2022-06-08T11:32:40.118843 #20397] INFO -- : products/logging: Generating types: ALL
I, [2022-06-08T11:32:40.118885 #20397] INFO -- : Generating Metric
I, [2022-06-08T11:32:40.952299 #20397] INFO -- : Excluding OrganizationLogSink per API catalog
I, [2022-06-08T11:32:40.952345 #20397] INFO -- : Excluding ProjectLogSink per API catalog
I, [2022-06-08T11:32:40.952361 #20397] INFO -- : Excluding FolderExclusion per API catalog
I, [2022-06-08T11:32:40.952375 #20397] INFO -- : Excluding ProjectExclusion per API catalog
I, [2022-06-08T11:32:40.952390 #20397] INFO -- : Excluding FolderLogSink per API catalog
I, [2022-06-08T11:32:41.157871 #20397] INFO -- : products/memcache: Compiling provider config
I, [2022-06-08T11:32:41.165175 #20397] INFO -- : products/memcache: Generating types: ALL
I, [2022-06-08T11:32:41.165255 #20397] INFO -- : Generating Instance
I, [2022-06-08T11:32:41.628039 #20397] INFO -- : products/metastore does not have a 'ga' version, skipping
I, [2022-06-08T11:32:41.743963 #20397] INFO -- : products/mlengine: Compiling provider config
I, [2022-06-08T11:32:41.748710 #20397] INFO -- : products/mlengine: Generating types: ALL
I, [2022-06-08T11:32:41.748748 #20397] INFO -- : Generating Model
I, [2022-06-08T11:32:41.877833 #20397] INFO -- : Excluding Version per API catalog
I, [2022-06-08T11:32:42.708144 #20397] INFO -- : products/monitoring: Compiling provider config
I, [2022-06-08T11:32:42.714461 #20397] INFO -- : products/monitoring: Generating types: ALL
I, [2022-06-08T11:32:42.714499 #20397] INFO -- : Generating AlertPolicy
I, [2022-06-08T11:32:43.811715 #20397] INFO -- : Generating Group
I, [2022-06-08T11:32:44.474402 #20397] INFO -- : Generating NotificationChannel
I, [2022-06-08T11:32:45.258049 #20397] INFO -- : Generating Service
I, [2022-06-08T11:32:45.358006 #20397] INFO -- : Generating Slo
I, [2022-06-08T11:32:46.514989 #20397] INFO -- : Generating UptimeCheckConfig
I, [2022-06-08T11:32:47.409200 #20397] INFO -- : Generating MetricDescriptor
I, [2022-06-08T11:32:47.684493 #20397] INFO -- : products/networkmanagement: Compiling provider config
I, [2022-06-08T11:32:47.688097 #20397] INFO -- : products/networkmanagement: Generating types: ALL
I, [2022-06-08T11:32:47.688146 #20397] INFO -- : Generating ConnectivityTest
I, [2022-06-08T11:32:48.605005 #20397] INFO -- : products/networkservices: Compiling provider config
I, [2022-06-08T11:32:48.611424 #20397] INFO -- : products/networkservices: Generating types: ALL
I, [2022-06-08T11:32:48.611464 #20397] INFO -- : Generating EdgeCacheKeyset
I, [2022-06-08T11:32:48.710778 #20397] INFO -- : Generating EdgeCacheOrigin
I, [2022-06-08T11:32:48.877650 #20397] INFO -- : Generating EdgeCacheService
I, [2022-06-08T11:32:50.491846 #20397] INFO -- : products/notebooks: Compiling provider config
I, [2022-06-08T11:32:50.500289 #20397] INFO -- : products/notebooks: Generating types: ALL
I, [2022-06-08T11:32:50.500324 #20397] INFO -- : Generating Environment
I, [2022-06-08T11:32:50.641778 #20397] INFO -- : Generating Instance
I, [2022-06-08T11:32:51.608063 #20397] INFO -- : Generating Runtime
I, [2022-06-08T11:32:52.868441 #20397] INFO -- : Generating Location
I, [2022-06-08T11:32:54.143461 #20397] INFO -- : products/osconfig: Compiling provider config
I, [2022-06-08T11:32:54.148444 #20397] INFO -- : products/osconfig: Generating types: ALL
I, [2022-06-08T11:32:54.148489 #20397] INFO -- : Generating PatchDeployment
I, [2022-06-08T11:32:55.198232 #20397] INFO -- : Excluding GuestPolicies per API version
I, [2022-06-08T11:32:55.289207 #20397] INFO -- : products/oslogin: Compiling provider config
I, [2022-06-08T11:32:55.295586 #20397] INFO -- : products/oslogin: Generating types: ALL
I, [2022-06-08T11:32:55.295642 #20397] INFO -- : Generating SSHPublicKey
I, [2022-06-08T11:32:57.120467 #20397] INFO -- : products/privateca: Compiling provider config
I, [2022-06-08T11:32:57.126792 #20397] INFO -- : products/privateca: Generating types: ALL
I, [2022-06-08T11:32:57.126840 #20397] INFO -- : Generating CertificateAuthority
I, [2022-06-08T11:32:59.183674 #20397] INFO -- : Generating Certificate
I, [2022-06-08T11:33:01.214026 #20397] INFO -- : Generating CaPool
I, [2022-06-08T11:33:01.692767 #20397] INFO -- : Generating CertificateTemplate
I, [2022-06-08T11:33:01.910185 #20397] INFO -- : products/pubsub: Compiling provider config
I, [2022-06-08T11:33:01.916208 #20397] INFO -- : products/pubsub: Generating types: ALL
I, [2022-06-08T11:33:01.916262 #20397] INFO -- : Generating Topic
I, [2022-06-08T11:33:02.083647 #20397] INFO -- : Generating Subscription
I, [2022-06-08T11:33:02.961938 #20397] INFO -- : Generating Schema
I, [2022-06-08T11:33:03.165149 #20397] INFO -- : products/pubsublite: Compiling provider config
I, [2022-06-08T11:33:03.170738 #20397] INFO -- : products/pubsublite: Generating types: ALL
I, [2022-06-08T11:33:03.170789 #20397] INFO -- : Generating Reservation
I, [2022-06-08T11:33:03.235539 #20397] INFO -- : Generating Topic
I, [2022-06-08T11:33:03.382396 #20397] INFO -- : Generating Subscription
I, [2022-06-08T11:33:04.414383 #20397] INFO -- : products/redis: Compiling provider config
I, [2022-06-08T11:33:04.418460 #20397] INFO -- : products/redis: Generating types: ALL
I, [2022-06-08T11:33:04.418505 #20397] INFO -- : Generating Instance
I, [2022-06-08T11:33:05.661881 #20397] INFO -- : products/resourcemanager: Compiling provider config
I, [2022-06-08T11:33:05.668311 #20397] INFO -- : products/resourcemanager: Generating types: ALL
I, [2022-06-08T11:33:05.668366 #20397] INFO -- : Excluding Project per API catalog
I, [2022-06-08T11:33:05.668392 #20397] INFO -- : Generating Lien
I, [2022-06-08T11:33:06.452772 #20397] INFO -- : Excluding Folder per API catalog
I, [2022-06-08T11:33:06.452813 #20397] INFO -- : Excluding Organization per API catalog
I, [2022-06-08T11:33:06.503628 #20397] INFO -- : products/runtimeconfig does not have a 'ga' version, skipping
I, [2022-06-08T11:33:06.682500 #20397] INFO -- : products/secretmanager: Compiling provider config
I, [2022-06-08T11:33:06.689540 #20397] INFO -- : products/secretmanager: Generating types: ALL
I, [2022-06-08T11:33:06.689618 #20397] INFO -- : Generating Secret
I, [2022-06-08T11:33:06.938811 #20397] INFO -- : Generating SecretVersion
I, [2022-06-08T11:33:07.799532 #20397] INFO -- : products/securitycenter: Compiling provider config
I, [2022-06-08T11:33:07.803667 #20397] INFO -- : products/securitycenter: Generating types: ALL
I, [2022-06-08T11:33:07.803718 #20397] INFO -- : Generating Source
I, [2022-06-08T11:33:07.858454 #20397] INFO -- : Generating NotificationConfig
I, [2022-06-08T11:33:08.044651 #20397] INFO -- : products/securityscanner does not have a 'ga' version, skipping
I, [2022-06-08T11:33:08.082015 #20397] INFO -- : products/servicedirectory does not have a 'ga' version, skipping
I, [2022-06-08T11:33:08.148821 #20397] INFO -- : products/servicemanagement: Compiling provider config
I, [2022-06-08T11:33:08.154695 #20397] INFO -- : products/servicemanagement: Generating types: ALL
I, [2022-06-08T11:33:08.154758 #20397] INFO -- : Generating Service
I, [2022-06-08T11:33:08.200736 #20397] INFO -- : Generating ServiceConsumers
I, [2022-06-08T11:33:08.335415 #20397] INFO -- : products/serviceusage: Compiling provider config
I, [2022-06-08T11:33:08.341983 #20397] INFO -- : products/serviceusage: Generating types: ALL
I, [2022-06-08T11:33:08.342034 #20397] INFO -- : Excluding AdminQuotaOverride per API catalog
I, [2022-06-08T11:33:08.342062 #20397] INFO -- : Excluding ConsumerQuotaOverride per API version
I, [2022-06-08T11:33:08.342077 #20397] INFO -- : Excluding Service per API catalog
I, [2022-06-08T11:33:09.080968 #20397] INFO -- : products/sourcerepo: Compiling provider config
I, [2022-06-08T11:33:09.086587 #20397] INFO -- : products/sourcerepo: Generating types: ALL
I, [2022-06-08T11:33:09.086663 #20397] INFO -- : Generating Repository
I, [2022-06-08T11:33:10.698249 #20397] INFO -- : products/spanner: Compiling provider config
I, [2022-06-08T11:33:10.705804 #20397] INFO -- : products/spanner: Generating types: ALL
I, [2022-06-08T11:33:10.705838 #20397] INFO -- : Excluding InstanceConfig per API catalog
I, [2022-06-08T11:33:10.705859 #20397] INFO -- : Generating Instance
I, [2022-06-08T11:33:11.449958 #20397] INFO -- : Generating Database
I, [2022-06-08T11:33:12.477666 #20397] INFO -- : products/sql: Compiling provider config
I, [2022-06-08T11:33:12.482780 #20397] INFO -- : products/sql: Generating types: ALL
I, [2022-06-08T11:33:12.482834 #20397] INFO -- : Excluding Instance per API catalog
I, [2022-06-08T11:33:12.482863 #20397] INFO -- : Generating Database
I, [2022-06-08T11:33:13.114713 #20397] INFO -- : Excluding User per API catalog
I, [2022-06-08T11:33:13.114754 #20397] INFO -- : Excluding SslCert per API catalog
I, [2022-06-08T11:33:13.114768 #20397] INFO -- : Excluding Flag per API catalog
I, [2022-06-08T11:33:13.114779 #20397] INFO -- : Excluding Tier per API catalog
I, [2022-06-08T11:33:13.114801 #20397] INFO -- : Generating SourceRepresentationInstance
I, [2022-06-08T11:33:14.273268 #20397] INFO -- : products/storage: Compiling provider config
I, [2022-06-08T11:33:14.278136 #20397] INFO -- : products/storage: Generating types: ALL
I, [2022-06-08T11:33:14.278173 #20397] INFO -- : Generating Bucket
I, [2022-06-08T11:33:14.320857 #20397] INFO -- : Generating BucketAccessControl
I, [2022-06-08T11:33:14.989352 #20397] INFO -- : Generating ObjectAccessControl
I, [2022-06-08T11:33:15.683839 #20397] INFO -- : Generating DefaultObjectAccessControl
I, [2022-06-08T11:33:16.365371 #20397] INFO -- : Excluding Object per API catalog
I, [2022-06-08T11:33:16.365421 #20397] INFO -- : Generating HmacKey
I, [2022-06-08T11:33:17.406506 #20397] INFO -- : products/tags: Compiling provider config
I, [2022-06-08T11:33:17.411339 #20397] INFO -- : products/tags: Generating types: ALL
I, [2022-06-08T11:33:17.411385 #20397] INFO -- : Generating TagKey
I, [2022-06-08T11:33:18.144084 #20397] INFO -- : Generating TagValue
I, [2022-06-08T11:33:18.784976 #20397] INFO -- : Generating TagBinding
I, [2022-06-08T11:33:19.650472 #20397] INFO -- : products/tpu: Compiling provider config
I, [2022-06-08T11:33:19.656203 #20397] INFO -- : products/tpu: Generating types: ALL
I, [2022-06-08T11:33:19.656250 #20397] INFO -- : Generating Node
I, [2022-06-08T11:33:20.595949 #20397] INFO -- : products/vertexai: Compiling provider config
I, [2022-06-08T11:33:20.601462 #20397] INFO -- : products/vertexai: Generating types: ALL
I, [2022-06-08T11:33:20.601517 #20397] INFO -- : Generating Dataset
I, [2022-06-08T11:33:20.708896 #20397] INFO -- : Excluding Featurestore per API version
I, [2022-06-08T11:33:20.708939 #20397] INFO -- : Excluding FeaturestoreEntitytype per API version
I, [2022-06-08T11:33:20.708954 #20397] INFO -- : Excluding MetadataStore per API version
I, [2022-06-08T11:33:20.819535 #20397] INFO -- : products/vpcaccess: Compiling provider config
I, [2022-06-08T11:33:20.825447 #20397] INFO -- : products/vpcaccess: Generating types: ALL
I, [2022-06-08T11:33:20.825533 #20397] INFO -- : Generating Connector
I, [2022-06-08T11:33:21.025977 #20397] INFO -- : products/workflows: Compiling provider config
I, [2022-06-08T11:33:21.030341 #20397] INFO -- : products/workflows: Generating types: ALL
I, [2022-06-08T11:33:21.030388 #20397] INFO -- : Generating Workflow
I, [2022-06-08T11:33:21.827051 #20397] INFO -- : Copying common files for terraform
I, [2022-06-08T11:33:22.251274 #20397] INFO -- : Compiling common files for terraform
make[1]: Leaving directory '/home/cata/magic-modules'
make tpgtools
make[1]: Entering directory '/home/cata/magic-modules'
make serialize
make[2]: Entering directory '/home/cata/magic-modules'
cd tpgtools;\
cp -f serialization.go.base serialization.go &&\
go run . --path "api" --overrides "overrides" --mode "serialization" > temp.serial &&\
mv -f temp.serial serialization.go
E0608 12:33:25.306890 35158 resource.go:778] skipping "beta_basic.tf.tmpl" due to no version match
E0608 12:33:25.325298 35158 resource.go:778] skipping "beta_basic.tf.tmpl" due to no version match
E0608 12:33:25.347063 35158 resource.go:778] skipping "beta_basic.tf.tmpl" due to no version match
E0608 12:33:25.358089 35158 resource.go:778] skipping "beta_basic.tf.tmpl" due to no version match
make[2]: Leaving directory '/home/cata/magic-modules'
cd tpgtools;\
go run . --output /home/cata/go/src/github.com/hashicorp/terraform-provider-google --version ga --path "api" --overrides "overrides"
E0608 12:33:27.372344 35370 resource.go:778] skipping "beta_basic.tf.tmpl" due to no version match
E0608 12:33:27.386587 35370 resource.go:778] skipping "beta_basic.tf.tmpl" due to no version match
E0608 12:33:27.412058 35370 resource.go:778] skipping "beta_basic.tf.tmpl" due to no version match
E0608 12:33:27.429461 35370 resource.go:778] skipping "beta_basic.tf.tmpl" due to no version match
google_cloudbuild_worker_pool no samples, skipping doc generation
google_compute_firewall_policy no samples, skipping doc generation
google_compute_firewall_policy_association no samples, skipping doc generation
google_compute_firewall_policy_rule no samples, skipping doc generation
google_compute_forwarding_rule no samples, skipping doc generation
google_compute_global_forwarding_rule no samples, skipping doc generation
google_dataproc_workflow_template no samples, skipping doc generation
google_gke_hub_feature no samples, skipping doc generation
google_gke_hub_feature_membership no samples, skipping doc generation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment