Skip to content

Commit

Permalink
azurerm_healthcare_dicom_service resource & data source - support f…
Browse files Browse the repository at this point in the history
…or new properties (#27375)

* add several properties for healthcareapi dicomservice

* Update healthcare_dicom_data_source.go

* fix issues addressed in review

* Update healthcare_dicom_data_source.go

* Update docs

* Update resource & data source & test

* fix: extend error message

* Update healthcare_dicom_resource_test.go

* Update healthcare_dicom_data_source.go

* Update healthcare_dicom_data_source.go

* fix: update url to URL for API Response

* Update healthcare_dicom_resource_test.go

* Update healthcare_dicom_resource.go

* Update healthcare_dicom_resource.go
  • Loading branch information
hqhqhqhqhqhqhqhqhqhqhq authored Jan 9, 2025
1 parent 8fe05cc commit 538b4f5
Show file tree
Hide file tree
Showing 5 changed files with 518 additions and 67 deletions.
86 changes: 86 additions & 0 deletions internal/services/healthcare/healthcare_dicom_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"time"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/identity"
Expand Down Expand Up @@ -54,6 +55,7 @@ func dataSourceHealthcareDicomService() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
Computed: true,
},

"audience": {
Type: pluginsdk.TypeList,
Computed: true,
Expand Down Expand Up @@ -86,6 +88,76 @@ func dataSourceHealthcareDicomService() *pluginsdk.Resource {
Computed: true,
},

"data_partitions_enabled": {
Type: pluginsdk.TypeBool,
Computed: true,
},

"cors": {
Type: pluginsdk.TypeList,
Computed: true,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"allowed_origins": {
Type: pluginsdk.TypeList,
Computed: true,
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
},
},

"allowed_headers": {
Type: pluginsdk.TypeList,
Computed: true,
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
},
},

"allowed_methods": {
Type: pluginsdk.TypeList,
Computed: true,
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
},
},

"max_age_in_seconds": {
Type: pluginsdk.TypeInt,
Computed: true,
},

"allow_credentials": {
Type: pluginsdk.TypeBool,
Computed: true,
},
},
},
},

"encryption_key_url": {
Type: pluginsdk.TypeString,
Computed: true,
},

"storage": {
Type: pluginsdk.TypeList,
Computed: true,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"file_system_name": {
Type: pluginsdk.TypeString,
Computed: true,
},

"storage_account_id": {
Type: pluginsdk.TypeString,
Computed: true,
},
},
},
},

"tags": commonschema.TagsDataSource(),
},
}
Expand Down Expand Up @@ -123,6 +195,20 @@ func dataSourceHealthcareApisDicomServiceRead(d *pluginsdk.ResourceData, meta in
d.Set("authentication", flattenDicomAuthentication(props.AuthenticationConfiguration))
d.Set("private_endpoint", flattenDicomServicePrivateEndpoint(props.PrivateEndpointConnections))
d.Set("service_url", props.ServiceURL)

d.Set("data_partitions_enabled", pointer.From(props.EnableDataPartitions))

d.Set("cors", flattenDicomServiceCorsConfiguration(props.CorsConfiguration))

if props.Encryption != nil && props.Encryption.CustomerManagedKeyEncryption != nil {
d.Set("encryption_key_url", pointer.From(props.Encryption.CustomerManagedKeyEncryption.KeyEncryptionKeyURL))
}

storage, err := flattenStorageConfiguration(props.StorageConfiguration)
if err != nil {
return fmt.Errorf("flattening `storage`: %+v", err)
}
d.Set("storage", storage)
}

i, err := identity.FlattenLegacySystemAndUserAssignedMap(m.Identity)
Expand Down
Loading

0 comments on commit 538b4f5

Please sign in to comment.