-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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: dedicated_host_group (compute) #5048
Conversation
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 the PR @magodo, i've left some comments inline to address before merge
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required) The name of the dedicated host group. | ||
|
||
* `resource_group_name` - (Required) The name of the resource group. | ||
|
||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - Resource Id | ||
|
||
* `location` - Resource location | ||
|
||
* `hosts` - A list of references to all dedicated `host`s in the dedicated host group. The definition of `host` is defined below. | ||
|
||
* `platform_fault_domain_count` - Number of fault domains that the host group can span. | ||
|
||
* `type` - Resource type | ||
|
||
* `zones` - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. | ||
|
||
* `tags` - Resource tags | ||
|
||
|
||
--- | ||
|
||
The `host` block contains the following: | ||
|
||
* `id` - Resource Id |
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.
Could we flush out the docs here to be more consistent with the rest of the provider?
* `id` - Resource Id | ||
|
||
* `type` - Resource type |
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.
Could we use full sentences here?
|
||
The `host` block contains the following: | ||
|
||
* `id` - Resource Id |
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.
And here?
func testAccAzureRMDedicatedHostGroup_complete(rInt int, location string, rName string) string { | ||
return fmt.Sprintf(` | ||
resource "azurerm_resource_group" "test" { | ||
name = "acctestRG-%d" |
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 = "acctestRG-%d" | |
name = "acctestRG-compute-%d" |
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
ValidateFunc: validate.NoEmptyStrings, |
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.
Could we properly validate this with regex?
if err := d.Set("hosts", flattenArmDedicatedHostGroupSubResourceReadOnly(dedicatedHostGroupProperties.Hosts)); err != nil { | ||
return fmt.Errorf("Error setting `hosts`: %+v", err) | ||
} | ||
d.Set("platform_fault_domain_count", int(*dedicatedHostGroupProperties.PlatformFaultDomainCount)) |
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.
we don't need to deref and convert for top level properties
d.Set("platform_fault_domain_count", int(*dedicatedHostGroupProperties.PlatformFaultDomainCount)) | |
d.Set("platform_fault_domain_count", dedicatedHostGroupProperties.PlatformFaultDomainCount) |
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 is that? I assume a schema.TypeInt
corresponds to int
, not int32
.
d.Set("platform_fault_domain_count", int(*dedicatedHostGroupProperties.PlatformFaultDomainCount)) | ||
} | ||
d.Set("type", resp.Type) | ||
if resp.Zones != nil { |
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 the flatten function does this check?
} | ||
d.Set("type", resp.Type) | ||
if resp.Zones != nil { | ||
d.Set("zones", utils.FlattenStringSlice(resp.Zones)) |
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.
Could we check for an error here?
@@ -0,0 +1,61 @@ | |||
--- |
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.
Could we add this to the index.erb
@@ -0,0 +1,70 @@ | |||
--- |
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.
Could we add this file to the index.erb
@katbyte, this PR is filed before the refactor you've made. Now I think I'd better to reflect the refactoring to this resource with your comment applied and raise another PR. |
Replaced by #5307 |
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. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Add new resource
dedicated_host_group
, which belongs to Compute Provider.Please refer to this link for more info.