Skip to content

New Resource: azurerm_qumulo_file_system#28704

Merged
katbyte merged 21 commits intohashicorp:mainfrom
teowa:qumulo_file_system
Jun 3, 2025
Merged

New Resource: azurerm_qumulo_file_system#28704
katbyte merged 21 commits intohashicorp:mainfrom
teowa:qumulo_file_system

Conversation

@teowa
Copy link
Collaborator

@teowa teowa commented Feb 6, 2025

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

supersede #22911 , which had been reviewed but was blocked by upstream API
New Resource: azurerm_qumulo_file_system

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevent documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

NOTE: service team asks to run the acctest in canary region, for example, "eastasia", "centralus2euap"

image

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • New Resource: azurerm_qumulo_file_system [GH-00000]

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #0000

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@teowa teowa marked this pull request as ready for review February 13, 2025 09:03
@teowa
Copy link
Collaborator Author

teowa commented Feb 17, 2025

image

Copy link
Collaborator

@ms-zhenhua ms-zhenhua left a comment

Choose a reason for hiding this comment

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

Hi @teowa ,

Thanks for this PR - I've taken a look through and left some comments inline. If we can fix those up, this should be good to go 👍

Comment on lines +23 to +26
var (
_ sdk.Resource = FileSystemResource{}
_ sdk.ResourceWithUpdate = FileSystemResource{}
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
var (
_ sdk.Resource = FileSystemResource{}
_ sdk.ResourceWithUpdate = FileSystemResource{}
)
var _ sdk.ResourceWithUpdate = FileSystemResource{}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

admin_password = ")^X#ZX#JRyIY}t9"
availability_zone = "1"
delegated_subnet_id = azurerm_subnet.example.id
marketplace_plan_id = "qumulo-on-azure-v1%%gmz7xq9ge3py%%P1M"
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is marketplace_plan_id set such a strange value? Is there any documents guiding users to set this property?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed, the plan_id value is not limited to azure-native-qumulo-v3. Contact Azure Qumulo support for other possible values.

ValidateFunc: commonids.ValidateSubnetID,
},

"user_email_address": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"user_email_address": {
"email": {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

Sensitive: true,
},

"marketplace_plan_id": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"marketplace_plan_id": {
"plan_id": {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated


resp, err := clients.Qumulo.FileSystemsClient.Get(ctx, *id)
if err != nil {
return nil, fmt.Errorf("reading %s: %+v", *id, err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return nil, fmt.Errorf("reading %s: %+v", *id, err)
return nil, fmt.Errorf("retrieving %s: %+v", *id, err)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

return nil, fmt.Errorf("reading %s: %+v", *id, err)
}

return utils.Bool(resp.Model != nil), nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return utils.Bool(resp.Model != nil), nil
return pointer.To(resp.Model != nil), nil

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

func FileSystemName(v interface{}, k string) (warnings []string, errors []error) {
value := v.(string)
if matched := regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9-]{0,13}[a-zA-Z0-9]$`).Match([]byte(value)); !matched {
errors = append(errors, fmt.Errorf("%q must be between 2 and 15 characters in length, must not begin or end with a hyphen and may only contain alphanumeric characters and hyphens", k))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
errors = append(errors, fmt.Errorf("%q must be between 2 and 15 characters in length, must not begin or end with a hyphen and may only contain alphanumeric characters and hyphens", k))
errors = append(errors, fmt.Errorf("`%q` must be between 2 and 15 characters in length, must not begin or end with a hyphen and may only contain alphanumeric characters and hyphens", k))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

layout: "azurerm"
page_title: "Azure Resource Manager: azurerm_qumulo_file_system"
description: |-
Manages a Azure Native Qumulo Scalable File System.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Manages a Azure Native Qumulo Scalable File System.
Manages an Azure Native Qumulo Scalable File System.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed


# azurerm_qumulo_file_system

Manages a Azure Native Qumulo Scalable File System.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Manages a Azure Native Qumulo Scalable File System.
Manages an Azure Native Qumulo Scalable File System.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@teowa
Copy link
Collaborator Author

teowa commented Apr 18, 2025

Hi @stephybun , thanks for reviewing this. Please kindly take another look.
image

Comment on lines +81 to +95
"offer_id": {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
// the value can be "qumulo-saas-mpp"
ValidateFunc: validation.StringIsNotEmpty,
},

"plan_id": {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
// the value includes but is not limitted to ["azure-native-qumulo-v3"]
ValidateFunc: validation.StringIsNotEmpty,
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should use the hardcoded values you had before as defaults here?

This comment was marked as resolved.

Copy link
Member

Choose a reason for hiding this comment

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

According to the swagger publisher_id shouldn't be a required property but is marked as such in the schema here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added default to the publisher_id

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

default also added to offer_id and plan_id.

@teowa
Copy link
Collaborator Author

teowa commented Apr 23, 2025

Hi @katbyte , thanks for reviewing this! I have added inline reply, please kindly take another look.

Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
// the value includes but is not limitted to ["azure-native-qumulo-v3"]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// the value includes but is not limitted to ["azure-native-qumulo-v3"]
// the value includes but is not limited to ["azure-native-qumulo-v3"]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@teowa
Copy link
Collaborator Author

teowa commented May 9, 2025

Hi @stephybun @katbyte , thanks for reviewing! I have updated the code as in the review comment, could you please take another look? Thanks!

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @teowa - this looks good except for one minor comment about validation. once thats address & passing tests shared this is g2g

Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringIsNotEmpty,
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we validate the email address, should be able to use the net/mail package mail.ParseAddress(email)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

@teowa
Copy link
Collaborator Author

teowa commented May 27, 2025

Hi @katbyte , I am unable to test this online because the test subscription does not allow for Azure Marketplace payment.

testcase.go:173: Step 1/3 error: Error running apply: exit status 1
        Error: creating File System (Subscription: "*******"
        Resource Group Name: "acctestrg-qumulo-9wm0p"
        File System Name: "acctest-9wm0p"): performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with error: ResourceCreationValidateFailed: MarketplaceValidation, MarketplaceValidation, SaaS Purchase Payment Check Failed as validationResponse was {"isEligible":false,"errorMessage":"Cannot complete purchase as your enrollment for this subscription doesn't allow purchase of marketplace products. Your Azure enrollment administrator can enable purchase of paid marketplace products. for details, see https://go.microsoft.com/fwlink/?linkid=2297238. Correlation Id: '40a4d251-b0fc-4cdb-90fe-242db685cf1e'."}, failed for resoruce id /subscriptions/*******/resourcegroups/acctestrg-qumulo-9wm0p/providers/Qumulo.Storage/fileSystems/acctest-9wm0p, resource name acctest-9wm0p

The test can pass in my local:
image

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

LGTM 🏖️

@katbyte katbyte merged commit 6c0417f into hashicorp:main Jun 3, 2025
35 checks passed
katbyte added a commit that referenced this pull request Jun 3, 2025
@github-actions github-actions bot added this to the v4.32.0 milestone Jun 3, 2025
wyattfry pushed a commit that referenced this pull request Jun 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2025

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 contributions.
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 Jul 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants