-
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
Add mount_name to aws_fsx_lustre_file_system #14313
Add mount_name to aws_fsx_lustre_file_system #14313
Conversation
The |
@mtpdt can you rebase this branch and add the mentioned tests? |
Okay, will do |
ef6ee58
to
73a544e
Compare
@@ -403,6 +404,8 @@ func TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1(t *testing.T) { | |||
// per_unit_storage_throughput is only available with deployment_type=PERSISTENT_1, so we test both here. | |||
resource.TestCheckResourceAttr(resourceName, "per_unit_storage_throughput", "50"), | |||
resource.TestCheckResourceAttr(resourceName, "deployment_type", fsx.LustreDeploymentTypePersistent1), | |||
resource.TestMatchResourceAttr(resourceName, "mount_name", regexp.MustCompile(`^[a-z0-9]+fbmv$`)), |
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.
The mount names always have the suffix fbmv
, although that isn't documented publicly by AWS, so I don't know if we can consider that stable.
The other options are to just check that it's a lowercase alphanumeric string, or to check that it's not fsx
which is the default mount name for SCRATCH_1
deployment types.
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.
i ran the tests and the mount name didnt seem to be ending with fbmv
.
testing.go:684: Step 0 error: Check failed: Check 4/4 error: aws_fsx_lustre_file_system.test: Attribute 'mount_name' didn't match "^[a-z0-9]+fbmv$", got "mlvg5bmv"
it doesn't seem to have any logic, according to docs:
For the SCRATCH_1 deployment type, this value is always "fsx". For SCRATCH_2 and PERSISTENT_1 deployment types, this value is a string that is unique within an AWS Region.
Lets change this to be not equal fsx
as you proposed. i dont see any other way except just checking the value is set with no other validation.
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.
@DrFaust92 I implemented it as "just checking the value is set with no other validation".
I took a peek around the repository, and found the resource.TestCheckResourceAttrSet
used in a bunch of places, which seems expressly for this purpose (a resource that we don't know the value ahead of time). I did not find any resource.TestCheckResourceAttrDoesNotMatch
method in the resource
go library.
So I figured it would be better to follow the existing convention, and not duplicate complex resource-retrieval logic from github.com/hashicorp/terraform-plugin-sdk/helper/resource. We're not doing any transformation on the mount_name
retrieved from AWS, just passing it through, so ultimately I don't think an integration test that checks it's not equal to fsx
would do much.
Let me know what you think. I can put together a "not fsx
" integration test if you feel strongly.
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.
I think that just checking that the attribute is set is good enough
73a544e
to
255b1e3
Compare
255b1e3
to
6dcf684
Compare
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.
LGTM
--- PASS: TestAccAWSFsxLustreFileSystem_basic (689.59s)
--- PASS: TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1 (550.02s)
@DrFaust92 any next steps needed on my part, or can you merge this in? |
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.
LGTM.
Verified acceptance tests:
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSFsxLustreFileSystem_basic\|TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1\|TestAccAWSFsxLustreFileSystem_DeploymentTypeScratch2'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSFsxLustreFileSystem_basic\|TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1\|TestAccAWSFsxLustreFileSystem_DeploymentTypeScratch2 -timeout 120m
=== RUN TestAccAWSFsxLustreFileSystem_basic
=== PAUSE TestAccAWSFsxLustreFileSystem_basic
=== RUN TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1
=== PAUSE TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1
=== RUN TestAccAWSFsxLustreFileSystem_DeploymentTypeScratch2
=== PAUSE TestAccAWSFsxLustreFileSystem_DeploymentTypeScratch2
=== CONT TestAccAWSFsxLustreFileSystem_basic
=== CONT TestAccAWSFsxLustreFileSystem_DeploymentTypeScratch2
=== CONT TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1
--- PASS: TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1 (472.54s)
--- PASS: TestAccAWSFsxLustreFileSystem_basic (494.94s)
--- PASS: TestAccAWSFsxLustreFileSystem_DeploymentTypeScratch2 (597.53s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 597.591s
Hi @mtpdt 👋 |
6dcf684
to
4a9a886
Compare
4a9a886
to
0d36e0d
Compare
@breathingdust merge conflicts resolved. |
LGTM! 🚀 Thanks @mtpdt Verified Acceptance Tests in Commerical (us-west-2) make testacc TESTARGS='-run=TestAccAWSFsxLustreFileSystem_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSFsxLustreFileSystem_basic -timeout 120m
=== RUN TestAccAWSFsxLustreFileSystem_basic
=== PAUSE TestAccAWSFsxLustreFileSystem_basic
=== CONT TestAccAWSFsxLustreFileSystem_basic
--- PASS: TestAccAWSFsxLustreFileSystem_basic (570.35s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 572.771s |
This has been released in version 3.8.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 for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Relates #12181
Release note for CHANGELOG:
Output from acceptance testing: