-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_dx_private_virtual_interface: Update resource to support MTU param #6141
Changes from 3 commits
5298e48
d549990
b5f9c82
cdecb24
4b3d2f0
c4593cc
636db33
257a94a
4cff326
0cf60ab
83b25df
bd5798b
1d75428
6f8738b
1e6b61a
77e465a
da69517
1a7b0d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,16 @@ func resourceAwsDxPrivateVirtualInterface() *schema.Resource { | |
Computed: true, | ||
ForceNew: true, | ||
}, | ||
"mtu": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
Computed: true, | ||
ForceNew: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}, | ||
"jumbo_frame_enabled": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick - In the documentation the feature is called Jumbo Frames. For consistency I suggest naming the attribute There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, I meant to have this match the API but I just spaced on it. This will be corrected in my next commit. |
||
Type: schema.TypeBool, | ||
Computed: true, | ||
}, | ||
"tags": tagsSchema(), | ||
}, | ||
|
||
|
@@ -111,6 +121,7 @@ func resourceAwsDxPrivateVirtualInterfaceCreate(d *schema.ResourceData, meta int | |
Vlan: aws.Int64(int64(d.Get("vlan").(int))), | ||
Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), | ||
AddressFamily: aws.String(d.Get("address_family").(string)), | ||
Mtu: aws.Int64(int64(d.Get("mtu").(int))), | ||
}, | ||
} | ||
if vgwOk && vgwIdRaw.(string) != "" { | ||
|
@@ -128,6 +139,9 @@ func resourceAwsDxPrivateVirtualInterfaceCreate(d *schema.ResourceData, meta int | |
if v, ok := d.GetOk("amazon_address"); ok && v.(string) != "" { | ||
req.NewPrivateVirtualInterface.AmazonAddress = aws.String(v.(string)) | ||
} | ||
if v, ok := d.GetOk("mtu"); ok && v.(int) != 0 { | ||
req.NewPrivateVirtualInterface.Mtu = aws.Int64(int64(v.(int))) | ||
} | ||
|
||
log.Printf("[DEBUG] Creating Direct Connect private virtual interface: %#v", req) | ||
resp, err := conn.CreatePrivateVirtualInterface(req) | ||
|
@@ -175,6 +189,8 @@ func resourceAwsDxPrivateVirtualInterfaceRead(d *schema.ResourceData, meta inter | |
d.Set("amazon_address", vif.AmazonAddress) | ||
d.Set("vpn_gateway_id", vif.VirtualGatewayId) | ||
d.Set("dx_gateway_id", vif.DirectConnectGatewayId) | ||
d.Set("mtu", vif.Mtu) | ||
d.Set("jumbo_frame_capable", vif.JumboFrameCapable) | ||
if err := getTagsDX(conn, d, d.Get("arn").(string)); err != nil { | ||
return err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See
ValidateFunc
comment: https://github.com/terraform-providers/terraform-provider-aws/pull/6142/files#r224971730.