Skip to content

Commit

Permalink
chore: updating azurerm to v3 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
alannix-lw authored Jan 20, 2023
1 parent 44dea77 commit 430e750
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ It configures a Diagnostic Setting that puts logs in an storage account, from wh
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | ~> 2.28 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | ~> 3.0 |
| <a name="requirement_lacework"></a> [lacework](#requirement\_lacework) | ~> 1.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.1 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | ~> 2.28 |
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | ~> 3.0 |
| <a name="provider_lacework"></a> [lacework](#provider\_lacework) | ~> 1.0 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.1 |
| <a name="provider_time"></a> [time](#provider\_time) | n/a |
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.2-dev
2.0.0-dev
2 changes: 1 addition & 1 deletion examples/custom-activity-log/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ provider "lacework" {}
module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 1.0"
version = "~> 2.0"
application_name = "my-custom-application-name"
lacework_integration_name = "custom name"
prefix = "customprefix"
Expand Down
2 changes: 1 addition & 1 deletion examples/default-activity-log/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ provider "lacework" {}
module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 1.0"
version = "~> 2.0"
}
```

Expand Down
2 changes: 1 addition & 1 deletion examples/existing-storage-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ provider "lacework" {}
module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 1.0"
version = "~> 2.0"
use_existing_storage_account = true
storage_account_name = "storageaccountname"
Expand Down
10 changes: 9 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ resource "azurerm_eventgrid_event_subscription" "lacework" {

# create Diag Settings on all subscriptions requested by user, centralizing logs in single storage
resource "azurerm_monitor_diagnostic_setting" "lacework" {
count = length(local.subscription_ids)

name = "${var.prefix}-${var.diagnostic_settings_name}-${random_id.uniq.hex}"
count = length(local.subscription_ids)
target_resource_id = "/subscriptions/${local.subscription_ids[count.index]}"
storage_account_id = local.storage_account_id

Expand Down Expand Up @@ -129,6 +130,13 @@ resource "azurerm_monitor_diagnostic_setting" "lacework" {
category = "ServiceHealth"
enabled = false
}

# Currently required for https://github.com/hashicorp/terraform-provider-azurerm/issues/8131
lifecycle {
ignore_changes = [
log_analytics_destination_type
]
}
}

# we take the current AZ CLI context subscription as the placeholder for the centralized storage account
Expand Down
6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ variable "application_password" {
}
variable "diagnostic_settings_name" {
type = string
default = "lacework_activity_logs"
default = "activity-logs"
description = "The name of the subscription's Diagnostic Setting for Activity Logs"
}
variable "lacework_integration_name" {
Expand Down Expand Up @@ -62,8 +62,8 @@ variable "subscription_ids" {
default = []
}
variable "tags" {
type = map(string)
default = {}
type = map(string)
default = {}
description = "Key-value map of Tag names and Tag values"
}
variable "use_existing_ad_application" {
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_version = ">= 0.14"

required_providers {
azurerm = "~> 2.28"
azurerm = "~> 3.0"
random = ">= 2.1"
lacework = {
source = "lacework/lacework"
Expand Down

0 comments on commit 430e750

Please sign in to comment.