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

aws_datasync_location_smb addition #10381

Merged
merged 7 commits into from
Feb 5, 2020

Conversation

thatderek
Copy link
Contributor

@thatderek thatderek commented Oct 4, 2019

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #9868

Release note for CHANGELOG:

* **New Resource:** `aws_datasync_location_smb` [GH-10381]

Output from acceptance testing:

root@46bfb2c125b3:/go/src/github.com/terraform-providers/terraform-provider-aws# AWS_PROFILE=default  make testacc TEST=./aws TESTARGS='-run=TestAccAWSDataSyncLocationSmb'
\==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSDataSyncLocationSmb -timeout 120m
go: finding github.com/terraform-providers/terraform-provider-tls v2.1.1+incompatible
go: finding github.com/terraform-providers/terraform-provider-tls v2.1.1+incompatible
=== RUN   TestAccAWSDataSyncLocationSmb_basic
=== PAUSE TestAccAWSDataSyncLocationSmb_basic
=== RUN   TestAccAWSDataSyncLocationSmb_disappears
=== PAUSE TestAccAWSDataSyncLocationSmb_disappears
=== RUN   TestAccAWSDataSyncLocationSmb_Tags
=== PAUSE TestAccAWSDataSyncLocationSmb_Tags
=== CONT  TestAccAWSDataSyncLocationSmb_basic
=== CONT  TestAccAWSDataSyncLocationSmb_Tags
=== CONT  TestAccAWSDataSyncLocationSmb_disappears
--- PASS: TestAccAWSDataSyncLocationSmb_disappears (289.55s)
--- PASS: TestAccAWSDataSyncLocationSmb_basic (354.49s)
--- PASS: TestAccAWSDataSyncLocationSmb_Tags (448.62s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	448.666s

@ghost ghost added size/L Managed by automation to categorize the size of a PR. service/datasync Issues and PRs that pertain to the datasync service. provider Pertains to the provider itself, rather than any interaction with AWS. labels Oct 4, 2019
@thatderek thatderek force-pushed the r-aws_datasync_location_smb branch from 9fb54a8 to fd0c0e0 Compare October 9, 2019 07:10
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed size/L Managed by automation to categorize the size of a PR. labels Oct 9, 2019
@thatderek thatderek force-pushed the r-aws_datasync_location_smb branch from fc6097b to 1b3b516 Compare October 11, 2019 18:05
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. service/quicksight Issues and PRs that pertain to the quicksight service. and removed size/XL Managed by automation to categorize the size of a PR. labels Oct 11, 2019
@thatderek thatderek changed the title [WIP] aws_datasync_location_smb addition aws_datasync_location_smb addition Oct 11, 2019
@thatderek thatderek marked this pull request as ready for review October 11, 2019 18:10
@thatderek thatderek requested a review from a team October 11, 2019 18:10
 - Using go-sdk constants
 - Running, fixing and cleaning tests

Here's my current test output
``` bash
AWS_DEFAULT_REGION=us-east-1 AWS_PROFILE=default TF_ACC=1 go test ./aws -v -timeout 120m -parallel 20 -run='TestAccAWSQuickSightUser_'
```

> go: finding github.com/terraform-providers/terraform-provider-tls
> v2.1.1+incompatible
> go: finding github.com/terraform-providers/terraform-provider-tls
> v2.1.1+incompatible
> === RUN   TestAccAWSQuickSightUser_basic
> === PAUSE TestAccAWSQuickSightUser_basic
> === RUN   TestAccAWSQuickSightUser_withInvalidFormattedEmailStillWorks
> === PAUSE TestAccAWSQuickSightUser_withInvalidFormattedEmailStillWorks
> === RUN   TestAccAWSQuickSightUser_disappears
> === PAUSE TestAccAWSQuickSightUser_disappears
> === CONT  TestAccAWSQuickSightUser_basic
> === CONT  TestAccAWSQuickSightUser_disappears
> === CONT  TestAccAWSQuickSightUser_withInvalidFormattedEmailStillWorks
> --- PASS: TestAccAWSQuickSightUser_disappears (14.19s)
> --- PASS: TestAccAWSQuickSightUser_basic (25.44s)
> --- PASS: TestAccAWSQuickSightUser_withInvalidFormattedEmailStillWorks
> (26.08s)
> PASS
> ok  	github.com/terraform-providers/terraform-provider-aws/aws
> 26.109s

Note that the tests exposed that the `describe-user` QuickSight API does
not return the schema that is documented.

For example, when  I run it via the CLI I get

``` json
{
    "RequestId": "some-guid-looking-thing",
    "Status": 200,
    "User": {
        "Arn":
"arn:aws:quicksight:us-west-2:01234567890:user/default/some_user",
        "PrincipalId": "federated/iam/some_user",
        "Email": "[email protected]",
        "Active": true,
        "Role": "ADMIN",
        "UserName": "some_user"
    }
}
```

Notice that `IdentityType` is missing though documented!

This means that I had to remove it from attributes and remove the
importer :( since we can't reconcile that value.

If there's a way around this please let me know.

Also note that I couldn't use `acctest.RandomWithPrefix` because the
resultant username was not valid in QuickSight.
@thatderek thatderek force-pushed the r-aws_datasync_location_smb branch from 1b3b516 to 0710b23 Compare October 11, 2019 18:14
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/XXL Managed by automation to categorize the size of a PR. labels Oct 11, 2019
@thatderek thatderek force-pushed the r-aws_datasync_location_smb branch from 0710b23 to 50cec01 Compare October 11, 2019 18:28
@thatderek
Copy link
Contributor Author

Yep @ewbankkit I'll incorporate all the asks and get this back to you early next week hopefully.
ۜ(סּںסּَ` )/ۜ

@thatderek
Copy link
Contributor Author

Changes made @ewbankkit ╭(◔ ◡ ◔)/

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSDataSyncLocationSmb -timeout 120m
=== RUN   TestAccAWSDataSyncLocationSmb_basic
=== PAUSE TestAccAWSDataSyncLocationSmb_basic
=== RUN   TestAccAWSDataSyncLocationSmb_disappears
=== PAUSE TestAccAWSDataSyncLocationSmb_disappears
=== RUN   TestAccAWSDataSyncLocationSmb_Tags
=== PAUSE TestAccAWSDataSyncLocationSmb_Tags
=== CONT  TestAccAWSDataSyncLocationSmb_basic
=== CONT  TestAccAWSDataSyncLocationSmb_Tags
=== CONT  TestAccAWSDataSyncLocationSmb_disappears
--- PASS: TestAccAWSDataSyncLocationSmb_basic (295.18s)
--- PASS: TestAccAWSDataSyncLocationSmb_disappears (349.06s)
--- PASS: TestAccAWSDataSyncLocationSmb_Tags (355.09s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	355.140s
root@317f0c9d85f5:/go/src/github.com/terraform-providers/terraform-provider-aws# ```

@thatderek
Copy link
Contributor Author

thatderek commented Nov 20, 2019

@ewbankkit I dont understand why a file I didn't touch and against which make fmt does nothing is failing this test. 😢

the next day when i check in: okay now apparently the test is passing? 🤷‍♀️

@jonsherrard
Copy link

This looks great @thatderek thank you.

@ewbankkit
Copy link
Contributor

Validated:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSDataSyncLocationSmb_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSDataSyncLocationSmb_ -timeout 120m
=== RUN   TestAccAWSDataSyncLocationSmb_basic
=== PAUSE TestAccAWSDataSyncLocationSmb_basic
=== RUN   TestAccAWSDataSyncLocationSmb_disappears
=== PAUSE TestAccAWSDataSyncLocationSmb_disappears
=== RUN   TestAccAWSDataSyncLocationSmb_Tags
=== PAUSE TestAccAWSDataSyncLocationSmb_Tags
=== CONT  TestAccAWSDataSyncLocationSmb_basic
=== CONT  TestAccAWSDataSyncLocationSmb_Tags
=== CONT  TestAccAWSDataSyncLocationSmb_disappears
--- PASS: TestAccAWSDataSyncLocationSmb_disappears (280.58s)
--- PASS: TestAccAWSDataSyncLocationSmb_basic (283.50s)
--- PASS: TestAccAWSDataSyncLocationSmb_Tags (314.16s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	314.206s

@thatderek
Copy link
Contributor Author

Ya, I don't know what was up; maybe tests were being worked on but it was failing for a day about a week ago. Anyhow, looks like everything is up and working and ready.

If there are more revisions needed, lmk; otherwise I think this is ready for merge.

@riwiki
Copy link

riwiki commented Jan 28, 2020

Hey guys, is there anything else that needs help? Cause we would love to use this feature.

@khateeb15
Copy link

can this get progressed pleeeeeeease!!

@jonsherrard
Copy link

Would like to add offer of help if necessary along with @riwiki. This’d be a gamechanger for those of us trying to move some legacy systems forward.

@bflad bflad added new-resource Introduces a new resource. and removed service/quicksight Issues and PRs that pertain to the quicksight service. labels Jan 29, 2020
@bflad bflad self-assigned this Jan 29, 2020
@bflad bflad self-requested a review January 29, 2020 13:17
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hi @thatderek 👋 Thank you for submitting this, overall it looks great. A few little things and this should be good to go. Please reach out if you have any questions or do not have time to implement the feedback items. 😄

aws/resource_aws_datasync_location_smb.go Show resolved Hide resolved
aws/resource_aws_datasync_location_smb.go Show resolved Hide resolved
aws/resource_aws_datasync_location_smb.go Show resolved Hide resolved
aws/resource_aws_datasync_location_smb.go Show resolved Hide resolved
Manages an AWS DataSync SMB Location
---

# Resource: aws_datasync_location_SMB
Copy link
Contributor

Choose a reason for hiding this comment

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

😎

Suggested change
# Resource: aws_datasync_location_SMB
# Resource: aws_datasync_location_smb


* `agent_arns` - (Required) A list of DataSync Agent ARNs with which this location will be associated.
* `domain` - (Optional) The name of the Windows domain the SMB server belongs to.
* `mount_options` - (Optional) The mount options used by DataSync to access the SMB Server. Can be `AUTOMATIC`, `SMB2`, or `SMB3`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This values should be specified below with the version argument

Suggested change
* `mount_options` - (Optional) The mount options used by DataSync to access the SMB Server. Can be `AUTOMATIC`, `SMB2`, or `SMB3`.
* `mount_options` - (Optional) Configuration block containing mount options used by DataSync to access the SMB Server. Documented below.


### mount_options Argument Reference

The following arguments are supported inside the `on_prem_config` configuration block:
Copy link
Contributor

Choose a reason for hiding this comment

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

😎

Suggested change
The following arguments are supported inside the `on_prem_config` configuration block:
The following arguments are supported inside the `mount_options` configuration block:


The following arguments are supported inside the `on_prem_config` configuration block:

* `version` - (Optional) The specific SMB version that you want DataSync to use mounting your SMB share. Default: `AUTOMATIC`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `version` - (Optional) The specific SMB version that you want DataSync to use mounting your SMB share. Default: `AUTOMATIC`
* `version` - (Optional) The specific SMB version that you want DataSync to use for mounting your SMB share. valid values: `AUTOMATIC`, `SMB2`, and `SMB3`. Default: `AUTOMATIC`


## Import

`aws_datasync_location_smb` can be imported by using the DataSync Task Amazon Resource Name (ARN), e.g.
Copy link
Contributor

Choose a reason for hiding this comment

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

😎

Suggested change
`aws_datasync_location_smb` can be imported by using the DataSync Task Amazon Resource Name (ARN), e.g.
`aws_datasync_location_smb` can be imported by using the Amazon Resource Name (ARN), e.g.

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Jan 29, 2020
@thatderek
Copy link
Contributor Author

Yep @bflad this was among my first commits to anything Go or hashicorp related so a bunch of the things I've learned in other things that got to master already I need to fix in this. Looking over the changes, I don't think there is anything I disagree with; but I'm travelling today (to a HUG actually) so I dont know if I'll get to it before the week's out or potentially early next week. If someone else wanted to make the fixes, that's fine by me, otherwise expect to see another commit in the next few days.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Jan 29, 2020
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Jan 29, 2020
khateeb15 added a commit to khateeb15/terraform-provider-aws that referenced this pull request Feb 1, 2020
@khateeb15
Copy link

I'm happy to do the changes suggested by @bflad if someone can point me on how to add change to the base branch in @thatderek's fork which I don't have access to.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Feb 1, 2020
@thatderek thatderek requested a review from bflad February 3, 2020 23:52
@bflad bflad added this to the v2.48.0 milestone Feb 5, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Thanks for those updates, @thatderek, looks good 🚀

Output from acceptance testing:

--- PASS: TestAccAWSDataSyncLocationSmb_basic (222.14s)
--- PASS: TestAccAWSDataSyncLocationSmb_Tags (226.58s)
--- PASS: TestAccAWSDataSyncLocationSmb_disappears (240.60s)

@bflad bflad merged commit a0b0404 into hashicorp:master Feb 5, 2020
bflad added a commit that referenced this pull request Feb 5, 2020
@ghost
Copy link

ghost commented Feb 7, 2020

This has been released in version 2.48.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!

@ghost
Copy link

ghost commented Mar 27, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 27, 2020
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. provider Pertains to the provider itself, rather than any interaction with AWS. service/datasync Issues and PRs that pertain to the datasync 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.

AWS DataSync SMB locations
7 participants