-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
F/aws fsx windows file system: Support Support updating throughput_capacity and Storage_Capacity #15582
Merged
breathingdust
merged 6 commits into
hashicorp:master
from
nikhil-goenka:f/aws_fsx_windows_file_system
Nov 23, 2020
Merged
F/aws fsx windows file system: Support Support updating throughput_capacity and Storage_Capacity #15582
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
65b5679
f/aws_fsx_windows_file_system: allow updating storage and throughout …
nikhil-goenka 2a3c5f5
f/aws_fsx_windows_file_system: allow updating storage and throughout …
nikhil-goenka 0a553bd
f/aws_fsx_windows_file_system: allow updating storage and throughout …
nikhil-goenka 4a27537
f/aws_fsx_windows_file_system: allow updating storage and throughout …
nikhil-goenka 124d79a
f/aws_fsx_windows_file_system: allow updating storage and throughout …
nikhil-goenka 1ee938b
f/aws_fsx_windows_file_system: allow updating storage and throughout …
nikhil-goenka 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,26 @@ func refreshFsxFileSystemLifecycle(conn *fsx.FSx, id string) resource.StateRefre | |
} | ||
} | ||
|
||
func refreshFsxFileSystemLifecycleOptimizing(conn *fsx.FSx, id string) resource.StateRefreshFunc { | ||
return func() (interface{}, string, error) { | ||
filesystem, err := describeFsxFileSystem(conn, id) | ||
|
||
if isAWSErr(err, fsx.ErrCodeFileSystemNotFound, "") { | ||
return nil, "", nil | ||
} | ||
|
||
if err != nil { | ||
return nil, "", err | ||
} | ||
|
||
if filesystem == nil { | ||
return nil, "", nil | ||
} | ||
|
||
return filesystem, aws.StringValue(filesystem.AdministrativeActions[0].Status), nil | ||
} | ||
} | ||
|
||
func waitForFsxFileSystemCreation(conn *fsx.FSx, id string, timeout time.Duration) error { | ||
stateConf := &resource.StateChangeConf{ | ||
Pending: []string{fsx.FileSystemLifecycleCreating}, | ||
|
@@ -89,3 +109,20 @@ func waitForFsxFileSystemUpdate(conn *fsx.FSx, id string, timeout time.Duration) | |
|
||
return err | ||
} | ||
|
||
func waitForFsxFileSystemUpdateOptimizing(conn *fsx.FSx, id string, timeout time.Duration) error { | ||
stateConf := &resource.StateChangeConf{ | ||
Pending: []string{fsx.StatusInProgress}, | ||
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. Seems like FSx also uses a |
||
Target: []string{ | ||
fsx.StatusCompleted, | ||
fsx.StatusUpdatedOptimizing, | ||
}, | ||
Refresh: refreshFsxFileSystemLifecycleOptimizing(conn, id), | ||
Timeout: timeout, | ||
Delay: 30 * time.Second, | ||
} | ||
|
||
_, err := stateConf.WaitForState() | ||
|
||
return err | ||
} |
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
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.
This line is missing a length check on
AdministrativeActions
, which can cause a panic. Created followup issue: #16440