Skip to content

Commit

Permalink
deprecate log_analytics_workspace_name
Browse files Browse the repository at this point in the history
Signed-off-by: ziyeqf <[email protected]>
  • Loading branch information
ziyeqf committed Sep 18, 2023
1 parent a8aef80 commit dda6cb5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ type ContainerAppEnvironmentDataSourceModel struct {
Name string `tfschema:"name"`
ResourceGroup string `tfschema:"resource_group_name"`

Location string `tfschema:"location"`
LogAnalyticsWorkspaceName string `tfschema:"log_analytics_workspace_name"`
InfrastructureSubnetId string `tfschema:"infrastructure_subnet_id"`
InternalLoadBalancerEnabled bool `tfschema:"internal_load_balancer_enabled"`
Tags map[string]interface{} `tfschema:"tags"`
Location string `tfschema:"location"`
LogAnalyticsWorkspaceName string `tfschema:"log_analytics_workspace_name"`
LogAnalyticsWorkspaceCostumerId string `tfschema:"log_analytics_workspace_costumer_id"`
InfrastructureSubnetId string `tfschema:"infrastructure_subnet_id"`
InternalLoadBalancerEnabled bool `tfschema:"internal_load_balancer_enabled"`
Tags map[string]interface{} `tfschema:"tags"`

DefaultDomain string `tfschema:"default_domain"`
DockerBridgeCidr string `tfschema:"docker_bridge_cidr"`
Expand Down Expand Up @@ -65,7 +66,15 @@ func (r ContainerAppEnvironmentDataSource) Attributes() map[string]*pluginsdk.Sc
return map[string]*pluginsdk.Schema{
"location": commonschema.LocationComputed(),

"log_analytics_workspace_costumer_id": {
Type: pluginsdk.TypeString,
Computed: true,
Description: "The Customer ID of the Log Analytics Workspace this Container Apps Managed Environment is linked to.",
},

// TODO Remove in 4.0
"log_analytics_workspace_name": {
Deprecated: "`log_analytics_workspace_name` will be removed in favour of the property `log_analytics_workspace_costumer_id` in version 4.0 of the AzureRM Provider.",
Type: pluginsdk.TypeString,
Computed: true,
Description: "The name of the Log Analytics Workspace this Container Apps Managed Environment is linked to.",
Expand Down Expand Up @@ -156,6 +165,7 @@ func (r ContainerAppEnvironmentDataSource) Read() sdk.ResourceFunc {

if appsLogs := props.AppLogsConfiguration; appsLogs != nil && appsLogs.LogAnalyticsConfiguration != nil {
environment.LogAnalyticsWorkspaceName = pointer.From(appsLogs.LogAnalyticsConfiguration.CustomerId)
environment.LogAnalyticsWorkspaceCostumerId = pointer.From(appsLogs.LogAnalyticsConfiguration.CustomerId)
}

environment.StaticIP = pointer.From(props.StaticIP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func TestAccContainerAppEnvironmentDataSource_basic(t *testing.T) {
Config: r.basic(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).Key("log_analytics_workspace_name").IsSet(),
check.That(data.ResourceName).Key("log_analytics_workspace_customer_id").IsSet(),
check.That(data.ResourceName).Key("location").IsSet(),
check.That(data.ResourceName).Key("internal_load_balancer_enabled").HasValue("true"),
),
Expand Down
4 changes: 4 additions & 0 deletions website/docs/d/container_app_environment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ In addition to the Arguments listed above - the following Attributes are exporte

* `log_analytics_workspace_name` - The name of the Log Analytics Workspace this Container Apps Managed Environment is linked to.

~> **NOTE:** `log_analytics_workspace_name` will be removed in favour of the property `log_analytics_workspace_costumer_id` in version 4.0 of the AzureRM Provider.

* `log_analytics_workspace_customer_id` - The customer id of the Log Analytics Workspace this Container Apps Managed Environment is linked to.

* `platform_reserved_cidr` - The IP range, in CIDR notation, that is reserved for environment infrastructure IP addresses.

~> **NOTE:** This will only be populated for Environments that have `internal_load_balancer_enabled` set to true.
Expand Down

0 comments on commit dda6cb5

Please sign in to comment.