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

azurerm_monitor_data_collection_endpoint - adding attribute immutable_id #26380

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -49,6 +49,11 @@ func (d DataCollectionEndpointDataSource) Attributes() map[string]*pluginsdk.Sch
Computed: true,
},

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

"location": commonschema.LocationComputed(),

"logs_ingestion_endpoint": {
Expand Down Expand Up @@ -96,7 +101,7 @@ func (d DataCollectionEndpointDataSource) Read() sdk.ResourceFunc {
}

var enablePublicNetWorkAccess bool
var description, kind, location, configurationAccessEndpoint, logsIngestionEndpoint string
var description, kind, location, configurationAccessEndpoint, logsIngestionEndpoint, immutableId string
var tag map[string]interface{}
if model := resp.Model; model != nil {
kind = flattenDataCollectionEndpointKind(model.Kind)
Expand All @@ -115,6 +120,10 @@ func (d DataCollectionEndpointDataSource) Read() sdk.ResourceFunc {
if prop.LogsIngestion != nil && prop.LogsIngestion.Endpoint != nil {
logsIngestionEndpoint = *prop.LogsIngestion.Endpoint
}

if prop.ImmutableId != nil {
immutableId = *prop.ImmutableId
}
}
}

Expand All @@ -124,6 +133,7 @@ func (d DataCollectionEndpointDataSource) Read() sdk.ResourceFunc {
ConfigurationAccessEndpoint: configurationAccessEndpoint,
Description: description,
Kind: kind,
ImmutableId: immutableId,
Location: location,
LogsIngestionEndpoint: logsIngestionEndpoint,
Name: id.DataCollectionEndpointName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestAccMonitorDataCollectionEndpointDataSource_complete(t *testing.T) {
check.That(data.ResourceName).Key("public_network_access_enabled").HasValue("false"),
check.That(data.ResourceName).Key("configuration_access_endpoint").Exists(),
check.That(data.ResourceName).Key("logs_ingestion_endpoint").Exists(),
check.That(data.ResourceName).Key("immutable_id").Exists(),
),
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
type DataCollectionEndpoint struct {
ConfigurationAccessEndpoint string `tfschema:"configuration_access_endpoint"`
Description string `tfschema:"description"`
ImmutableId string `tfschema:"immutable_id"`
Kind string `tfschema:"kind"`
Name string `tfschema:"name"`
Location string `tfschema:"location"`
Expand Down Expand Up @@ -75,6 +76,11 @@ func (r DataCollectionEndpointResource) Attributes() map[string]*pluginsdk.Schem
Computed: true,
},

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

"logs_ingestion_endpoint": {
Type: pluginsdk.TypeString,
Computed: true,
Expand Down Expand Up @@ -160,7 +166,7 @@ func (r DataCollectionEndpointResource) Read() sdk.ResourceFunc {
return fmt.Errorf("retrieving %s: %+v", *id, err)
}
var enablePublicNetWorkAccess bool
var description, kind, location, configurationAccessEndpoint, logsIngestionEndpoint string
var description, kind, location, configurationAccessEndpoint, logsIngestionEndpoint, immutableId string
var tag map[string]interface{}
if model := resp.Model; model != nil {
kind = flattenDataCollectionEndpointKind(model.Kind)
Expand All @@ -179,13 +185,18 @@ func (r DataCollectionEndpointResource) Read() sdk.ResourceFunc {
if prop.LogsIngestion != nil && prop.LogsIngestion.Endpoint != nil {
logsIngestionEndpoint = *prop.LogsIngestion.Endpoint
}

if prop.ImmutableId != nil {
immutableId = *prop.ImmutableId
}
}
}

return metadata.Encode(&DataCollectionEndpoint{
ConfigurationAccessEndpoint: configurationAccessEndpoint,
Description: description,
Kind: kind,
ImmutableId: immutableId,
Location: location,
LogsIngestionEndpoint: logsIngestionEndpoint,
Name: id.DataCollectionEndpointName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ output "endpoint_id" {

* `description` - Specifies a description for the Data Collection Endpoint.

* `immutable_id` - The immutable ID of the Data Collection Endpoint.

* `kind` - The kind of the Data Collection Endpoint. Possible values are `Linux` and `Windows`.

* `location` - The Azure Region where the Data Collection Endpoint should exist.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ In addition to the Arguments listed above - the following Attributes are exporte

* `configuration_access_endpoint` - The endpoint used for accessing configuration, e.g., `https://mydce-abcd.eastus-1.control.monitor.azure.com`.

* `immutable_id` - The immutable ID of the Data Collection Endpoint.

* `logs_ingestion_endpoint` - The endpoint used for ingesting logs, e.g., `https://mydce-abcd.eastus-1.ingest.monitor.azure.com`.

## Timeouts
Expand Down
Loading