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

Add FSx File Gateway Support to Storage Gateway & Add FSx Association resource #20082

Merged
merged 54 commits into from
Jul 27, 2021

Conversation

drewmullen
Copy link
Collaborator

@drewmullen drewmullen commented Jul 6, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #19612

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSStorageGatewayFsxAssociateFileSystem_*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSStorageGatewayFsxAssociateFileSystem_* -timeout 180m
=== RUN   TestAccAWSStorageGatewayFsxAssociateFileSystem_basic
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_basic
=== RUN   TestAccAWSStorageGatewayFsxAssociateFileSystem_tags
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_tags
=== RUN   TestAccAWSStorageGatewayFsxAssociateFileSystem_cacheAttributes
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_cacheAttributes
=== RUN   TestAccAWSStorageGatewayFsxAssociateFileSystem_auditDestination
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_auditDestination
=== RUN   TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears
=== CONT  TestAccAWSStorageGatewayFsxAssociateFileSystem_basic
=== CONT  TestAccAWSStorageGatewayFsxAssociateFileSystem_auditDestination
=== CONT  TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears
=== CONT  TestAccAWSStorageGatewayFsxAssociateFileSystem_tags
=== CONT  TestAccAWSStorageGatewayFsxAssociateFileSystem_cacheAttributes
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_auditDestination (3556.09s)
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_tags (3632.12s)
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears (3632.13s)
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_basic (3805.76s)
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_cacheAttributes (3963.74s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	3966.765s
...

Big thanks to @AdamTylerLynch who wrote just as much of this as i did
also thanks to @gdavison, @ewbankkit, and @DrFaust92

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/fsx Issues and PRs that pertain to the fsx service. service/storagegateway Issues and PRs that pertain to the storagegateway service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. labels Jul 6, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @drewmullen 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@AdamTylerLynch
Copy link
Collaborator

I am also contributing this to this PR with Drew.

@drewmullen
Copy link
Collaborator Author

drewmullen commented Jul 6, 2021

does the acceptance test destroy phase work differently than a standard terraform destroy? We're seeing strange behavior where my local hcl can be destroyed fine but the acceptance tests fail during the destroy phase... i suspect the acceptance test destroy phase is not properly resolving dependencies

@AdamTylerLynch wrote some code for our acceptance tests print the hcl it assembles prior to building. We have successfully fully built & destroyed it using the hcl the exact acc test provides

Working with local terraform

when you run terraform destroy on my local hcl, the destroy phase appropriately waits for the new resource aws_storagegateway_fsx_associate_file_system to be fully destroyed before moving onto the next resources:

aws_storagegateway_fsx_associate_file_system.fsx: Destroying... [id=arn:aws:storagegateway:us-west-2:<>:fs-association/fsa-049C29FAF1C591B5B]
aws_storagegateway_fsx_associate_file_system.fsx: Still destroying... [id=arn:aws:storagegateway:us-west-2:878555...3:fs-association/fsa-049C29FAF1C591B5B, 10s elapsed]
aws_storagegateway_fsx_associate_file_system.fsx: Still destroying... [id=arn:aws:storagegateway:us-west-2:878555...3:fs-association/fsa-049C29FAF1C591B5B, 20s elapsed]
aws_storagegateway_fsx_associate_file_system.fsx: Still destroying... [id=arn:aws:storagegateway:us-west-2:878555...3:fs-association/fsa-049C29FAF1C591B5B, 30s elapsed]
aws_storagegateway_fsx_associate_file_system.fsx: Destruction complete after 31s
aws_storagegateway_gateway.test: Destroying... [id=arn:aws:storagegateway:us-west-2:<>:gateway/sgw-6917FF00]
aws_fsx_windows_file_system.test: Destroying... [id=fs-09a1098b1434b9543

Not working during acc test

using cloudtrail as an indicator, the acceptance tests do no appear to wait for the implicit dependency. notice that dissasociateFileSystem and deleteGateway are only about .3 seconds apart vs the 31s from my local hcl:
image

Error during acceptance test

        Error: error waiting for Storage Gateway FSx File System Association ("arn:aws:storagegateway:us-west-2:<>:fs-association/fsa-0DEC7BBFD223CB822") to be deleted: error reading Storage Gateway FSx File System: InvalidGatewayRequestException: The specified file system association was not found.
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "b33b5104-bf35-4878-9d34-a138fc0549aa"
          },
          Error_: {
            ErrorCode: "FileSystemAssociationNotFound"
          },
          Message_: "The specified file system association was not found."
        }

--- FAIL: TestAccAWSStorageGatewayFsxAssociateFileSystem_basic (3017.61s)

@gdavison
Copy link
Contributor

gdavison commented Jul 7, 2021

Hi @drewmullen. By default, the acceptance testing framework calls out the terraform binary on your path. It's odd that it succeeds outside of the acceptance testing framework. Do the acceptance tests consistently fail and terraform consistently succeed?

Looking at the error message, my first guess would is that the FSx API can return several error codes when the resource is not found: you check for storagegateway.ErrCodeInvalidGatewayRequestException with the message "Cannot find resource" in FsxFileSystemStatus(). The error listed above looks like the code is storagegateway.ErrCodeInvalidGatewayRequestException, with the message "The specified file system association was not found", and has a nested error with the code FileSystemAssociationNotFound. While we sometimes rely on the error message, we've been told. by AWS Support that it's best not to rely on the wording. You might be able to call OrigErr() on the error to get the nested error.

If that doesn't address it, can you run the test with the environment variable TF_LOG=DEBUG, paste the output into a Gist, and then add a link to the Gist here? We can then look at the API requests and responses.

@drewmullen
Copy link
Collaborator Author

drewmullen commented Jul 8, 2021

@gdavison howdy - thanks for your attention and response :D

yes it works consistently outside acc tests which is what has really confused me (here is the hcl).

would a low effort, appropriate test be to remove the content of the error message in FsxFileSystemStatus?
if tfawserr.ErrMessageContains(err, storagegateway.ErrCodeInvalidGatewayRequestException, "") {
once i get this thing working then we can devise a better solution.


**edit

i tried this change and that worked! so the problem has to do with the Status error message capture.

i asked around internally and the storagegateway team is recommending not to rely on error message because its actually just changed from "The specified file system association" to "Cannot find resource: ". you can actually see the different errors if you use different versions of the aws cli.

i guess for now i should just add both errors using an or?

@gdavison
Copy link
Contributor

gdavison commented Jul 8, 2021

I think it might be worthwhile looking at the nested error using err.OrigErr() in this case (and probably in many cases where the provider checks the error message). I noticed in the error message that you posted that the nested error had the code FileSystemAssociationNotFound.

So instead of using

if tfawserr.ErrMessageContains(err, storagegateway.ErrCodeInvalidGatewayRequestException, "Cannot find resource") {
	return nil, FsxFileSystemStatusNotFound, nil
}

you could use something like

if tfawserr.ErrCodeEquals(err, storagegateway.ErrCodeInvalidGatewayRequestException) {
	var awsErr awserr.Error
	if errors.As(err, &awsErr) {
		nestedErr := awsErr.OrigErr()
		if nestedErr != nil && tfawserr.ErrCodeEquals(nestedErr, "FileSystemAssociationNotFound") {
			return nil, FsxFileSystemStatusNotFound, nil
		}
	}
}

It's a lot more verbose, but will check against the specific error we want. It's probably something we should also add to the tfawserr package.

@drewmullen
Copy link
Collaborator Author

drewmullen commented Jul 9, 2021

@gdavison thanks for the snippet. in my last 2 commits i swapped out ErrMessageContains for the one containing OrigError but im getting a similar error as before.

testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1

        Error: error waiting for Storage Gateway FSx File System Association ("arn:aws:storagegateway:us-west-2:<>:fs-association/fsa-08D347831A5AE0D03") to be deleted: error reading Storage Gateway FSx File System: InvalidGatewayRequestException: The specified file system association was not found.
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "09ee3f49-b86c-4369-983a-1f48843b13a9"
          },
          Error_: {
            ErrorCode: "FileSystemAssociationNotFound"
          },
          Message_: "The specified file system association was not found."
        }

--- FAIL: TestAccAWSStorageGatewayFsxAssociateFileSystem_basic (3343.79s)

i also swapped out the checks in 3 other places where the previous code looks like this:

if isAWSErr(err, storagegateway.ErrCodeInvalidGatewayRequestException, "The specified fsx file system was not found.") {
	log.Printf("[WARN] Storage Gateway FSx File System Association %q not found, removing from state", d.Id())
	d.SetId("")
	return nil
}

@AdamTylerLynch
Copy link
Collaborator

ErrCodeInvalidGatewayRequestException

@gdavison OrigErr() is always nil for Storage Gateway(see attached).

Screen Shot 2021-07-09 at 12 11 05 PM

@gdavison
Copy link
Contributor

Ah, I see. The InvalidGatewayRequestException contains a nested error but doesn't expose it using err.OrigErr(), you instead access it directly using err.Error_. I'm not sure I agree that "OrigErr always returns nil, satisfies awserr.Error interface." is an accurate statement… 😂

I think the approach you've taken of casting the error to a storagegateway.InvalidGatewayRequestException is good, and once everything is working, we could encapsulate the logic in a function.

@drewmullen drewmullen force-pushed the add_aws_storagegateway_fsx branch 3 times, most recently from 41077c9 to 5c57e94 Compare July 13, 2021 19:36
@gdavison gdavison self-assigned this Jul 13, 2021
@drewmullen drewmullen changed the title DRAFT: Add FSx File Gateway Support to Storage Gateway & Add FSx Association resource Add FSx File Gateway Support to Storage Gateway & Add FSx Association resource Jul 14, 2021
@AdamTylerLynch
Copy link
Collaborator

make testacc TESTARGS='-run=TestAccAWSStorageGatewayFsxAssociateFileSystem'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSStorageGatewayFsxAssociateFileSystem -timeout 180m
=== RUN TestAccAWSStorageGatewayFsxAssociateFileSystem_basic
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_basic
=== RUN TestAccAWSStorageGatewayFsxAssociateFileSystem_tags
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_tags
=== RUN TestAccAWSStorageGatewayFsxAssociateFileSystem_cacheAttributes
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_cacheAttributes
=== RUN TestAccAWSStorageGatewayFsxAssociateFileSystem_auditDestination
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_auditDestination
=== RUN TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears
=== RUN TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears_storageGateway
=== PAUSE TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears_storageGateway
=== CONT TestAccAWSStorageGatewayFsxAssociateFileSystem_basic
=== CONT TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears
=== CONT TestAccAWSStorageGatewayFsxAssociateFileSystem_auditDestination
=== CONT TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears_storageGateway
=== CONT TestAccAWSStorageGatewayFsxAssociateFileSystem_cacheAttributes
=== CONT TestAccAWSStorageGatewayFsxAssociateFileSystem_tags
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_cacheAttributes (3259.71s)
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_tags (3264.40s)
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_basic (3465.64s)
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_auditDestination (3610.74s)
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears_storageGateway (3802.13s)
--- PASS: TestAccAWSStorageGatewayFsxAssociateFileSystem_disappears (3891.25s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 3893.077s

@drewmullen
Copy link
Collaborator Author

make testacc TESTARGS='-run=TestAccAWSStorageGatewayFileSystemAssociation'

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSStorageGatewayFileSystemAssociation -timeout 180m
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_basic
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_basic
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_tags
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_tags
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_cacheAttributes
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_cacheAttributes
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_auditDestination
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_auditDestination
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_disappears
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_disappears
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_disappears_storageGateway
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_disappears_storageGateway
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_disappears_fsxFileSystem
    resource_aws_storagegateway_fsx_associate_file_system_test.go:242: A bug in the service API has been reported. Deleting the FSx file system before the association prevents association from being deleted.
--- SKIP: TestAccAWSStorageGatewayFileSystemAssociation_disappears_fsxFileSystem (0.00s)
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_basic
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_disappears
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_cacheAttributes
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_disappears_storageGateway
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_auditDestination
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_tags
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_basic (3161.37s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_disappears_storageGateway (3260.30s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_tags (3276.78s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_auditDestination (3437.32s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_disappears (3866.32s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_cacheAttributes (4339.58s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4342.451s

@drewmullen
Copy link
Collaborator Author

drewmullen commented Jul 21, 2021

not sure how clear my comments back to you are after i click "resolve" but so you see it:

#20082 (comment)

yes this is definitely a bug. I reported a bug internally last week. My intent is to do a follow-on PR when the issue is fixed. Unfortunately the issue tracker is not exposed externally. if theres something else i can do to show clarity for yall, please let me know.

@drewmullen drewmullen requested a review from gdavison July 21, 2021 18:13
@AdamTylerLynch
Copy link
Collaborator

make testacc TESTARGS='-run=TestAccAWSStorageGatewayGateway'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSStorageGatewayGateway -timeout 180m
=== RUN TestAccAWSStorageGatewayGateway_GatewayType_Cached
=== PAUSE TestAccAWSStorageGatewayGateway_GatewayType_Cached
=== RUN TestAccAWSStorageGatewayGateway_GatewayType_FileFsxSmb
=== PAUSE TestAccAWSStorageGatewayGateway_GatewayType_FileFsxSmb
=== RUN TestAccAWSStorageGatewayGateway_GatewayType_FileS3
=== PAUSE TestAccAWSStorageGatewayGateway_GatewayType_FileS3
=== RUN TestAccAWSStorageGatewayGateway_GatewayType_Stored
=== PAUSE TestAccAWSStorageGatewayGateway_GatewayType_Stored
=== RUN TestAccAWSStorageGatewayGateway_GatewayType_Vtl
=== PAUSE TestAccAWSStorageGatewayGateway_GatewayType_Vtl
=== RUN TestAccAWSStorageGatewayGateway_tags
=== PAUSE TestAccAWSStorageGatewayGateway_tags
=== RUN TestAccAWSStorageGatewayGateway_GatewayName
=== PAUSE TestAccAWSStorageGatewayGateway_GatewayName
=== RUN TestAccAWSStorageGatewayGateway_CloudWatchLogs
=== PAUSE TestAccAWSStorageGatewayGateway_CloudWatchLogs
=== RUN TestAccAWSStorageGatewayGateway_GatewayTimezone
=== PAUSE TestAccAWSStorageGatewayGateway_GatewayTimezone
=== RUN TestAccAWSStorageGatewayGateway_GatewayVpcEndpoint
=== PAUSE TestAccAWSStorageGatewayGateway_GatewayVpcEndpoint
=== RUN TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings
=== PAUSE TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings
=== RUN TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings_timeout
=== PAUSE TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings_timeout
=== RUN TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings
=== PAUSE TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings
=== RUN TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings_timeout
=== PAUSE TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings_timeout
=== RUN TestAccAWSStorageGatewayGateway_SmbGuestPassword
=== PAUSE TestAccAWSStorageGatewayGateway_SmbGuestPassword
=== RUN TestAccAWSStorageGatewayGateway_SMBSecurityStrategy
=== PAUSE TestAccAWSStorageGatewayGateway_SMBSecurityStrategy
=== RUN TestAccAWSStorageGatewayGateway_SMBVisibility
=== PAUSE TestAccAWSStorageGatewayGateway_SMBVisibility
=== RUN TestAccAWSStorageGatewayGateway_disappears
=== PAUSE TestAccAWSStorageGatewayGateway_disappears
=== RUN TestAccAWSStorageGatewayGateway_bandwidthUpload
=== PAUSE TestAccAWSStorageGatewayGateway_bandwidthUpload
=== RUN TestAccAWSStorageGatewayGateway_bandwidthDownload
=== PAUSE TestAccAWSStorageGatewayGateway_bandwidthDownload
=== RUN TestAccAWSStorageGatewayGateway_bandwidthAll
=== PAUSE TestAccAWSStorageGatewayGateway_bandwidthAll
=== CONT TestAccAWSStorageGatewayGateway_GatewayType_Cached
=== CONT TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings_timeout
=== CONT TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings
=== CONT TestAccAWSStorageGatewayGateway_GatewayTimezone
=== CONT TestAccAWSStorageGatewayGateway_CloudWatchLogs
=== CONT TestAccAWSStorageGatewayGateway_tags
=== CONT TestAccAWSStorageGatewayGateway_GatewayVpcEndpoint
=== CONT TestAccAWSStorageGatewayGateway_GatewayType_FileS3
=== CONT TestAccAWSStorageGatewayGateway_GatewayType_FileFsxSmb
=== CONT TestAccAWSStorageGatewayGateway_GatewayType_Vtl
=== CONT TestAccAWSStorageGatewayGateway_SmbGuestPassword
=== CONT TestAccAWSStorageGatewayGateway_SMBVisibility
=== CONT TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings
=== CONT TestAccAWSStorageGatewayGateway_SMBSecurityStrategy
=== CONT TestAccAWSStorageGatewayGateway_bandwidthAll
=== CONT TestAccAWSStorageGatewayGateway_GatewayType_Stored
=== CONT TestAccAWSStorageGatewayGateway_bandwidthDownload
=== CONT TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings_timeout
=== CONT TestAccAWSStorageGatewayGateway_disappears
=== CONT TestAccAWSStorageGatewayGateway_GatewayName
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_FileFsxSmb (257.39s)
=== CONT TestAccAWSStorageGatewayGateway_bandwidthUpload
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_Stored (257.62s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_Vtl (267.40s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_Cached (268.91s)
--- PASS: TestAccAWSStorageGatewayGateway_disappears (278.06s)
--- PASS: TestAccAWSStorageGatewayGateway_CloudWatchLogs (319.66s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_FileS3 (319.90s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayName (361.81s)
--- PASS: TestAccAWSStorageGatewayGateway_bandwidthAll (362.63s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayTimezone (365.27s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayVpcEndpoint (367.35s)
--- PASS: TestAccAWSStorageGatewayGateway_SMBSecurityStrategy (367.98s)
--- PASS: TestAccAWSStorageGatewayGateway_tags (370.64s)
--- PASS: TestAccAWSStorageGatewayGateway_bandwidthDownload (372.70s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbGuestPassword (385.81s)
--- PASS: TestAccAWSStorageGatewayGateway_SMBVisibility (415.35s)
--- PASS: TestAccAWSStorageGatewayGateway_bandwidthUpload (327.22s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings (976.84s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings_timeout (995.11s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings_timeout (1975.68s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings (2107.10s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 2109.003s

Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking good. We're down to a few nitpicky details. The resource and test files will need to be renamed as well, since they're causing a linter to fail.

@drewmullen
Copy link
Collaborator Author

good catch on the file names! sorry about that! changes are pushed, running tests again then hopefully we're good? 😅

@drewmullen
Copy link
Collaborator Author

make testacc TESTARGS='-run=TestAccAWSStorageGatewayFileSystemAssociation'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSStorageGatewayFileSystemAssociation -timeout 180m
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_basic
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_basic
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_tags
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_tags
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_cacheAttributes
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_cacheAttributes
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_auditDestination
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_auditDestination
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_disappears
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_disappears
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_disappears_storageGateway
=== PAUSE TestAccAWSStorageGatewayFileSystemAssociation_disappears_storageGateway
=== RUN   TestAccAWSStorageGatewayFileSystemAssociation_disappears_fsxFileSystem
    resource_aws_storagegateway_file_system_association_test.go:237: A bug in the service API has been reported. Deleting the FSx file system before the association prevents association from being deleted.
--- SKIP: TestAccAWSStorageGatewayFileSystemAssociation_disappears_fsxFileSystem (0.00s)
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_basic
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_disappears
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_disappears_storageGateway
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_cacheAttributes
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_tags
=== CONT  TestAccAWSStorageGatewayFileSystemAssociation_auditDestination
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_disappears_storageGateway (3236.43s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_tags (3333.23s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_basic (3431.40s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_cacheAttributes (3535.00s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_auditDestination (3636.71s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_disappears (3784.97s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	3787.803s

@drewmullen drewmullen requested a review from gdavison July 23, 2021 17:07
@github-actions github-actions bot added service/fsx Issues and PRs that pertain to the fsx service. and removed service/fsx Issues and PRs that pertain to the fsx service. labels Jul 27, 2021
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🚀

I've made a couple tweaks to log messages and function names

Acceptance test results

--- SKIP: TestAccAWSStorageGatewayFileSystemAssociation_disappears_fsxFileSystem (0.00s)
--- SKIP: TestAccAWSStorageGatewayCachedIscsiVolume_SourceVolumeArn (0.00s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_FileS3 (254.46s)
--- PASS: TestAccAWSStorageGatewayCachedIscsiVolume_kms (255.46s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_Cached (259.00s)
--- PASS: TestAccAWSStorageGatewayCachedIscsiVolume_basic (261.17s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_FileFsxSmb (264.33s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_Vtl (264.84s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayType_Stored (276.46s)
--- PASS: TestAccAWSStorageGatewayCachedIscsiVolume_Tags (312.54s)
--- PASS: TestAccAWSStorageGatewayCache_FileGateway (314.24s)
--- PASS: TestAccAWSStorageGatewayGateway_tags (320.93s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayName (327.29s)
--- PASS: TestAccAWSStorageGatewayCache_TapeAndVolumeGateway (369.48s)
--- PASS: TestAccAWSStorageGatewayCachedIscsiVolume_SnapshotId (378.16s)
--- PASS: TestAccAWSStorageGatewayCachedIscsiVolume_disappears (381.42s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayTimezone (223.71s)
--- PASS: TestAccAWSStorageGatewayGateway_CloudWatchLogs (234.43s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbGuestPassword (225.98s)
--- PASS: TestAccAWSStorageGatewayGateway_disappears (232.39s)
--- PASS: TestAccAWSStorageGatewayGateway_SMBVisibility (263.25s)
--- PASS: TestAccAWSStorageGatewayGateway_GatewayVpcEndpoint (329.29s)
--- PASS: TestAccAWSStorageGatewayGateway_SMBSecurityStrategy (275.87s)
--- PASS: TestAccAWSStorageGatewayGateway_bandwidthUpload (233.43s)
--- PASS: TestAccAWSStorageGatewayGateway_bandwidthDownload (230.60s)
--- PASS: TestAccAWSStorageGatewayGateway_bandwidthAll (229.99s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_Authentication_GuestAccess (283.46s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_Tags (274.24s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_FileShareName (282.89s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_notificationPolicy (354.39s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_DefaultStorageClass (334.89s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_accessBasedEnumeration (382.83s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_GuessMIMETypeEnabled (327.23s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_OpLocksEnabled (327.01s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_KMSEncrypted (226.58s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings_timeout (889.82s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_ObjectACL (285.87s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_ReadOnly (284.55s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings (956.27s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_RequesterPays (323.90s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_KMSKeyArn (389.15s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_audit (335.20s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_Authentication_ActiveDirectory (896.18s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_cacheAttributes (382.51s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_disappears (227.09s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_caseSensitivity (384.64s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_InvalidUserList (1159.15s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_ValidUserList (1036.29s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_smb_acl (1056.29s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings_timeout (1916.68s)
--- PASS: TestAccAWSStorageGatewaySmbFileShare_AdminUserList (1036.00s)
--- PASS: TestAccAWSStorageGatewayGateway_SmbMicrosoftActiveDirectorySettings (2110.29s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_disappears_storageGateway (3397.29s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_tags (3484.10s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_disappears (3723.21s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_auditDestination (3768.46s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_cacheAttributes (4042.87s)
--- PASS: TestAccAWSStorageGatewayFileSystemAssociation_basic (3472.83s)

@gdavison gdavison merged commit ff90bee into hashicorp:main Jul 27, 2021
@github-actions github-actions bot added this to the v3.52.0 milestone Jul 27, 2021
@github-actions
Copy link

This functionality has been released in v3.52.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2021
@drewmullen drewmullen deleted the add_aws_storagegateway_fsx branch October 26, 2023 20:14
@justinretzolk justinretzolk added the partner Contribution from a partner. label May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. partner Contribution from a partner. provider Pertains to the provider itself, rather than any interaction with AWS. service/fsx Issues and PRs that pertain to the fsx service. service/storagegateway Issues and PRs that pertain to the storagegateway service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add FSX File Gateway Support to the Storage Gateway Resource
5 participants