-
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
azurerm_arc_machine
- support identity
and tags
properties
#27987
Conversation
if resp.Model == nil { | ||
return fmt.Errorf("retrieving %s: `model` was nil", *id) | ||
} | ||
existing := resp.Model |
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.
Minor, but for consistency can we please call this
existing := resp.Model | |
payload := resp.Model |
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
func (r ArcMachineResource) identity(data acceptance.TestData) string { | ||
return fmt.Sprintf(` | ||
%s | ||
|
||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
resource "azurerm_arc_machine" "test" { | ||
name = "acctest-hcm-%d" | ||
resource_group_name = azurerm_resource_group.test.name | ||
location = azurerm_resource_group.test.location | ||
kind = "SCVMM" | ||
|
||
identity { | ||
type = "SystemAssigned" | ||
} | ||
} | ||
`, r.template(data), data.RandomInteger) | ||
} | ||
|
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.
Given only one identity type is available here, we can omit this specific identity
config and rely on the complete
config to test identity
func (r ArcMachineResource) identity(data acceptance.TestData) string { | |
return fmt.Sprintf(` | |
%s | |
provider "azurerm" { | |
features {} | |
} | |
resource "azurerm_arc_machine" "test" { | |
name = "acctest-hcm-%d" | |
resource_group_name = azurerm_resource_group.test.name | |
location = azurerm_resource_group.test.location | |
kind = "SCVMM" | |
identity { | |
type = "SystemAssigned" | |
} | |
} | |
`, r.template(data), data.RandomInteger) | |
} |
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.
removed
func TestAccArcMachineResource_identity(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_arc_machine", "test") | ||
r := ArcMachineResource{} | ||
|
||
data.ResourceSequentialTest(t, r, []acceptance.TestStep{ | ||
{ | ||
Config: r.identity(data), | ||
Check: acceptance.ComposeTestCheckFunc( | ||
check.That(data.ResourceName).ExistsInAzure(r), | ||
), | ||
}, | ||
data.ImportStep(), | ||
}) | ||
} |
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.
func TestAccArcMachineResource_identity(t *testing.T) { | |
data := acceptance.BuildTestData(t, "azurerm_arc_machine", "test") | |
r := ArcMachineResource{} | |
data.ResourceSequentialTest(t, r, []acceptance.TestStep{ | |
{ | |
Config: r.identity(data), | |
Check: acceptance.ComposeTestCheckFunc( | |
check.That(data.ResourceName).ExistsInAzure(r), | |
), | |
}, | |
data.ImportStep(), | |
}) | |
} | |
func TestAccArcMachineResource_complete(t *testing.T) { | |
data := acceptance.BuildTestData(t, "azurerm_arc_machine", "test") | |
r := ArcMachineResource{} | |
data.ResourceSequentialTest(t, r, []acceptance.TestStep{ | |
{ | |
Config: r.complete(data), | |
Check: acceptance.ComposeTestCheckFunc( | |
check.That(data.ResourceName).ExistsInAzure(r), | |
), | |
}, | |
data.ImportStep(), | |
}) | |
} |
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.
removed
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 @teowa LGTM 💯
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. |
Community Note
Description
swagger:https://github.com/Azure/azure-rest-api-specs/blob/20f765ef6dfb1b649a69b808bc0053e3e91150f1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/HybridCompute.json#L2314
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_arc_machine
- support foridentity
andtags
propertiesThis 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.