Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Updated datatype for mtu" #4643

Merged
merged 4 commits into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7348,7 +7348,7 @@ objects:
name: 'description'
description: |
An optional description of this resource.
- !ruby/object:Api::Type::Integer
- !ruby/object:Api::Type::String
name: 'mtu'
description: |
Maximum Transmission Unit (MTU), in bytes, of packets passing through
Expand Down
3 changes: 2 additions & 1 deletion mmv1/products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1109,10 +1109,10 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "interconnect_attachment_basic"
primary_resource_id: "on_prem"
skip_test: true
vars:
interconnect_attachment_name: "on-prem-attachment"
router_name: "router"
network_name: "network"
properties:
id: !ruby/object:Overrides::Terraform::PropertyOverride
exclude: true
Expand All @@ -1137,6 +1137,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
edgeAvailabilityDomain: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
mtu: !ruby/object:Overrides::Terraform::PropertyOverride
custom_flatten: templates/terraform/custom_flatten/float64_to_int_to_string.go.erb
default_from_api: true
custom_code: !ruby/object:Provider::Terraform::CustomCode
constants: templates/terraform/constants/interconnect_attachment.go.erb
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
func flatten<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d *schema.ResourceData, config *Config) interface{} {
ScottSuarez marked this conversation as resolved.
Show resolved Hide resolved
// Handles int given in float64 format
if floatVal, ok := v.(float64); ok {
return fmt.Sprintf("%d", int(floatVal))
}
return v
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
resource "google_compute_interconnect_attachment" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['interconnect_attachment_name'] %>"
interconnect = "my-interconnect-id"
router = google_compute_router.foobar.id
mtu = 1500
name = "<%= ctx[:vars]['interconnect_attachment_name'] %>"
edge_availability_domain = "AVAILABILITY_DOMAIN_1"
type = "PARTNER"
router = google_compute_router.foobar.id
mtu = 1500
}

resource "google_compute_router" "foobar" {
name = "<%= ctx[:vars]['router_name'] %>"
network = google_compute_network.foobar.name
bgp {
asn = 16550
}
}

resource "google_compute_network" "foobar" {
name = "<%= ctx[:vars]['network_name'] %>"
auto_create_subnetworks = false
}