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

new resource azurerm_elastic_san_volume_group #24166

Merged
merged 9 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ func (r ElasticSANVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema
ValidateFunc: validate.ElasticSanVolumnGroupName,
},

"san_id": {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: volumegroups.ValidateElasticSanID,
},
"san_id": commonschema.ResourceIDReferenceRequiredForceNew(volumegroups.ElasticSanId{}),
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
"san_id": commonschema.ResourceIDReferenceRequiredForceNew(volumegroups.ElasticSanId{}),
"elastic_san_id": commonschema.ResourceIDReferenceRequiredForceNew(volumegroups.ElasticSanId{}),


"encryption_type": {
Type: pluginsdk.TypeString,
Expand Down Expand Up @@ -140,7 +135,7 @@ func (r ElasticSANVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
// None is not exposed
// None is not exposed, Iscsi is only allowed protocolType to connect to volume group
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
// None is not exposed, Iscsi is only allowed protocolType to connect to volume group
// None is not a valid value and service team will consider removing it in future versions.

string(volumegroups.StorageTargetTypeIscsi),
}, false),
Default: string(volumegroups.StorageTargetTypeIscsi),
Expand Down Expand Up @@ -268,7 +263,7 @@ func (r ElasticSANVolumeGroupResource) Read() sdk.ResourceFunc {
schema.EncryptionType = string(pointer.From(model.Properties.Encryption))
schema.NetworkRule = FlattenVolumeGroupNetworkRules(model.Properties.NetworkAcls)

if model.Properties.ProtocolType != nil && *model.Properties.ProtocolType != volumegroups.StorageTargetTypeNone {
if model.Properties.ProtocolType != nil {
schema.ProtocolType = string(pointer.From(model.Properties.ProtocolType))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ resource "azurerm_user_assigned_identity" "test" {
resource "azurerm_elastic_san_volume_group" "test" {
name = "acctestesvg-${var.random_string}"
san_id = azurerm_elastic_san.test.id

identity {
type = "UserAssigned"
identity_ids = [azurerm_user_assigned_identity.test.id]
Expand All @@ -236,6 +237,7 @@ provider "azurerm" {
resource "azurerm_elastic_san_volume_group" "test" {
name = "acctestesvg-${var.random_string}"
san_id = azurerm_elastic_san.test.id

identity {
type = "SystemAssigned"
}
Expand Down Expand Up @@ -303,6 +305,7 @@ resource "azurerm_key_vault_key" "test" {
resource "azurerm_elastic_san_volume_group" "test" {
name = "acctestesvg-${var.random_string}"
san_id = azurerm_elastic_san.test.id

identity {
type = "SystemAssigned"
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/elastic_san_volume_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ The following arguments are supported:

* `network_rule` - (Optional) One or more `network_rule` blocks as defined below.

* `protocol_type` - (Optional) Specifies the type of the storage target. The only possible value is `Iscsi`. Defaults to `Iscsi`.
* `protocol_type` - (Optional) Specifies the type of the storage target. The only possible values are `Iscsi`. Defaults to `Iscsi`.
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
* `protocol_type` - (Optional) Specifies the type of the storage target. The only possible values are `Iscsi`. Defaults to `Iscsi`.
* `protocol_type` - (Optional) Specifies the type of the storage target. The only possible value is `Iscsi`. Defaults to `Iscsi`.


---

Expand Down
Loading