-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20234 from sylr/improve-storagegateway-smb-file-s…
…hare aws_storagegateway_smb_file_share: Add `bucket_region`, `oplocks_enabled` and `vpc_endpoint_dns_name` arguments
- Loading branch information
Showing
9 changed files
with
488 additions
and
270 deletions.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
resource/aws_storagegateway_smb_file_share: Add `bucket_region`, `oplocks_enabled` and `vpc_endpoint_dns_name` arguments | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package storagegateway | ||
|
||
const ( | ||
AuthenticationActiveDirectory = "ActiveDirectory" | ||
AuthenticationGuestAccess = "GuestAccess" | ||
) | ||
|
||
func Authentication_Values() []string { | ||
return []string{ | ||
AuthenticationActiveDirectory, | ||
AuthenticationGuestAccess, | ||
} | ||
} | ||
|
||
const ( | ||
DefaultStorageClassS3IntelligentTiering = "S3_INTELLIGENT_TIERING" | ||
DefaultStorageClassS3OneZoneIA = "S3_ONEZONE_IA" | ||
DefaultStorageClassS3Standard = "S3_STANDARD" | ||
DefaultStorageClassS3StandardIA = "S3_STANDARD_IA" | ||
) | ||
|
||
func DefaultStorageClass_Values() []string { | ||
return []string{ | ||
DefaultStorageClassS3IntelligentTiering, | ||
DefaultStorageClassS3OneZoneIA, | ||
DefaultStorageClassS3Standard, | ||
DefaultStorageClassS3StandardIA, | ||
} | ||
} | ||
|
||
const ( | ||
FileShareStatusAvailable = "AVAILABLE" | ||
FileShareStatusCreating = "CREATING" | ||
FileShareStatusDeleting = "DELETING" | ||
FileShareStatusForceDeleting = "FORCE_DELETING" | ||
FileShareStatusUpdating = "UPDATING" | ||
) |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package storagegateway | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/service/storagegateway" | ||
) | ||
|
||
const ( | ||
OperationErrCodeFileShareNotFound = "FileShareNotFound" | ||
) | ||
|
||
// OperationErrorCode returns the operation error code from the specified error: | ||
// * err is of type awserr.Error and represents a storagegateway.InternalServerError or storagegateway.InvalidGatewayRequestException | ||
// * Error_ is not nil | ||
// See https://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#APIErrorResponses for details. | ||
func OperationErrorCode(err error) string { | ||
if inner := (*storagegateway.InternalServerError)(nil); errors.As(err, &inner) && inner.Error_ != nil { | ||
return aws.StringValue(inner.Error_.ErrorCode) | ||
} | ||
|
||
if inner := (*storagegateway.InvalidGatewayRequestException)(nil); errors.As(err, &inner) && inner.Error_ != nil { | ||
return aws.StringValue(inner.Error_.ErrorCode) | ||
} | ||
|
||
return "" | ||
} |
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.