-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
new resource azurerm_stack_hci_network_interface
#26888
Conversation
…m into stackhci_network_interface
…m into stackhci_network_interface
…m into stackhci_network_interface
be19ff0
to
a9773d2
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.
Hi @teowa,
Thanks for this PR - I've taken a look through and left some minor comments inline. If we can fix those up, this should be good to go 👍
ForceNew: true, | ||
ValidateFunc: validation.StringMatch( | ||
regexp.MustCompile(`^[a-zA-Z0-9][\-\.\_a-zA-Z0-9]{0,78}[a-zA-Z0-9]$`), | ||
"name must be between 2 and 80 characters and can only contain alphanumberic characters, hyphen, dot and underline", |
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.
"name must be between 2 and 80 characters and can only contain alphanumberic characters, hyphen, dot and underline", | |
"name must be between 2 and 80 characters and can only contain alphanumberic characters, hyphens(-), periods(.) and underlines(_). It must begin and end with alphanumberic characters.", |
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.
updated
|
||
type StackHCINetworkInterfaceResource struct{} | ||
|
||
func TestAccStackHCINetworkInterface_dynamic(t *testing.T) { |
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.
why not name it basic
?
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.
updated
|
||
* `location` - (Required) The Azure Region where the Azure Stack HCI Network Interface should exist. Changing this forces a new resource to be created. | ||
|
||
* `custom_location_id` - (Required) The ID of Custom Location where the Azure Stack HCI Network Interface should exist. Changing this forces a new resource to be created. |
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.
* `custom_location_id` - (Required) The ID of Custom Location where the Azure Stack HCI Network Interface should exist. Changing this forces a new resource to be created. | |
* `custom_location_id` - (Required) The ID of the Custom Location where the Azure Stack HCI Network Interface should exist. Changing this forces a new resource to be created. |
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.
updated
|
||
* `id` - The resource ID of the Azure Stack HCI Network Interface. | ||
|
||
* `ip_configuration` - A `ip_configuration` as defined below. |
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.
* `ip_configuration` - A `ip_configuration` as defined below. | |
* `ip_configuration` - An `ip_configuration` as defined below. |
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.
updated
Hi @ms-zhenhua , thanks for reviewing. I have updated the code, please take another look. |
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.
Hi @teowa,
Thank you for your updates. LGTM~
|
||
* `mac_address` - (Optional) The MAC address of the Network Interface. Changing this forces a new resource to be created. | ||
|
||
-> **Note:** If `mac_address` is not specified, it will be assigned by the server. If you experience a diff you may need to add this to `ignore_changes`. |
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.
is there a reason we do not make this computed so the user doesn't have to ue ignore changes?
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.
From the contribute doc,
In order to solve this, (new) fields should no longer be marked as Optional + Computed - instead where a split Create and Update method is used (see above) users can lean on ignore_changes to ignore values from a field with a default value, should they wish to continue using the default value.
seems we are supposed to avoid optional+computed for new field.
…m into stackhci_network_interface
ForceNew: true, | ||
ValidateFunc: validation.StringMatch( | ||
regexp.MustCompile(`^[a-zA-Z0-9][\-\.\_a-zA-Z0-9]{0,78}[a-zA-Z0-9]$`), | ||
"name must be between 2 and 80 characters and can only contain alphanumberic characters, hyphens(-), periods(.) and underlines(_). It must begin and end with an alphanumberic character.", |
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.
Would something like this be more clear?
"name must be between 2 and 80 characters and can only contain alphanumberic characters, hyphens(-), periods(.) and underlines(_). It must begin and end with an alphanumberic character.", | |
"name must begin and end with an alphanumeric character, be between 2 and 80 characters in length and can only contain alphanumeric characters, hyphens, periods or underscores.", |
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.
@teowa, sorry I forgot to add the description to my review. I took a look a think this mostly LGTM. If we can get the validation function error message fixed up I think this would be GTG! 🚀
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.
Thanks for reviewing this, the code is updated, please kindly take another look.
…m into stackhci_network_interface
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.
Hi @teowa,
Thanks for pushing those changes! I have given the PR another look at this LGTM now! 🚀
@teowa, I see you have included a screen shot of the tests passing, as there are special steps to get these tests running on the TC server I will trust your attached screen shot as attestation that the tests actually pass. |
Community Note
Description
new resource
azurerm_stack_hci_network_interface
swagger: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/networkInterfaces.json
azure doc: https://learn.microsoft.com/en-us/azure-stack/hci/manage/create-network-interfaces?tabs=azurecli
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_stack_hci_network_interface
This is a (please select all that apply):
Related Issue(s)
Fixes #0000
Note
If this PR changes meaningfully during the course of review please update the title and description as required.