-
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
Merged
bflad
merged 18 commits into
hashicorp:master
from
slapula:dx-private-virtual-interface-mtu
Oct 30, 2018
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5298e48
resource/aws_dx_private_virtual_interface: Update resource to support…
slapula d549990
fixing mtu int handling
slapula b5f9c82
exporting value of jumbo frames param
slapula cdecb24
adding acc test for mtu
slapula 4b3d2f0
correcting exported value name
slapula c4593cc
setting default for mtu
slapula 636db33
validating mtu input & adding expanding vif update function
slapula 257a94a
adding acc test for updating mtu
slapula 4cff326
'IntInSlice' -> 'validateIntegerInSlice'.
ewbankkit 0cf60ab
Add Update timeout to r/aws_dx_private_virtual_interface.
ewbankkit 83b25df
Merge branch 'master' into slapula-dx-private-virtual-interface-mtu
ewbankkit bd5798b
pulling in ewbankkit changes
slapula 1d75428
forgot a missing file from previous commit
slapula 6f8738b
Merge branch 'master' into dx-private-virtual-interface-mtu
slapula 1e6b61a
fixing merge conflict
slapula 77e465a
removing conflict cruft
slapula da69517
changing 1 to true
slapula 1a7b0d0
Merge branch 'master' into dx-private-virtual-interface-mtu
bflad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,11 +84,22 @@ func resourceAwsDxPrivateVirtualInterface() *schema.Resource { | |
Computed: true, | ||
ForceNew: true, | ||
}, | ||
"mtu": { | ||
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. See |
||
Type: schema.TypeInt, | ||
Default: 1500, | ||
Optional: true, | ||
ValidateFunc: validateIntegerInSlice([]int{1500, 9001}), | ||
}, | ||
"jumbo_frame_capable": { | ||
Type: schema.TypeBool, | ||
Computed: true, | ||
}, | ||
"tags": tagsSchema(), | ||
}, | ||
|
||
Timeouts: &schema.ResourceTimeout{ | ||
Create: schema.DefaultTimeout(10 * time.Minute), | ||
Update: schema.DefaultTimeout(10 * time.Minute), | ||
Delete: schema.DefaultTimeout(10 * time.Minute), | ||
}, | ||
} | ||
|
@@ -111,6 +122,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) != "" { | ||
|
@@ -145,7 +157,7 @@ func resourceAwsDxPrivateVirtualInterfaceCreate(d *schema.ResourceData, meta int | |
}.String() | ||
d.Set("arn", arn) | ||
|
||
if err := dxPrivateVirtualInterfaceWaitUntilAvailable(d, conn); err != nil { | ||
if err := dxPrivateVirtualInterfaceWaitUntilAvailable(conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { | ||
return err | ||
} | ||
|
||
|
@@ -175,6 +187,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 | ||
} | ||
|
@@ -187,6 +201,10 @@ func resourceAwsDxPrivateVirtualInterfaceUpdate(d *schema.ResourceData, meta int | |
return err | ||
} | ||
|
||
if err := dxPrivateVirtualInterfaceWaitUntilAvailable(meta.(*AWSClient).dxconn, d.Id(), d.Timeout(schema.TimeoutUpdate)); err != nil { | ||
return err | ||
} | ||
|
||
return resourceAwsDxPrivateVirtualInterfaceRead(d, meta) | ||
} | ||
|
||
|
@@ -207,10 +225,11 @@ func resourceAwsDxPrivateVirtualInterfaceImport(d *schema.ResourceData, meta int | |
return []*schema.ResourceData{d}, nil | ||
} | ||
|
||
func dxPrivateVirtualInterfaceWaitUntilAvailable(d *schema.ResourceData, conn *directconnect.DirectConnect) error { | ||
func dxPrivateVirtualInterfaceWaitUntilAvailable(conn *directconnect.DirectConnect, vifId string, timeout time.Duration) error { | ||
return dxVirtualInterfaceWaitUntilAvailable( | ||
d, | ||
conn, | ||
vifId, | ||
timeout, | ||
[]string{ | ||
directconnect.VirtualInterfaceStatePending, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
😍