diff --git a/modules/azurerm/Cost-Anomaly-Alert/cost_anomaly_alert.tf b/modules/azurerm/Cost-Anomaly-Alert/cost_anomaly_alert.tf new file mode 100644 index 00000000..aff5605b --- /dev/null +++ b/modules/azurerm/Cost-Anomaly-Alert/cost_anomaly_alert.tf @@ -0,0 +1,26 @@ +# ------------------------------------------------------------------------------------- +# +# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# -------------------------------------------------------------------------------------- + +resource "azurerm_cost_anomaly_alert" "cost_anomaly_alert" { + name = join("-", [var.cost_anomaly_alert_abbreviation, var.alert_name]) + display_name = var.display_name + email_subject = var.email_subject + email_addresses = var.email_addresses +} diff --git a/modules/azurerm/Cost-Anomaly-Alert/variables.tf b/modules/azurerm/Cost-Anomaly-Alert/variables.tf new file mode 100644 index 00000000..58fe4ebd --- /dev/null +++ b/modules/azurerm/Cost-Anomaly-Alert/variables.tf @@ -0,0 +1,45 @@ +# ------------------------------------------------------------------------------------- +# +# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# -------------------------------------------------------------------------------------- + +variable "cost_anomaly_alert_abbreviation" { + description = "Abbreviation for the cost anomaly alert" + type = string + default = "caa" +} + +variable "alert_name" { + description = "Name of the cost anomaly alert" + type = string +} + +variable "display_name" { + description = "Display name of the cost anomaly alert" + type = string +} + +variable "email_subject" { + description = "Email subject of the cost anomaly alert" + type = string +} + +variable "email_addresses" { + description = "Email addresses of the cost anomaly alert" + type = list(string) +} diff --git a/modules/azurerm/Cost-Anomaly-Alert/versions.tf b/modules/azurerm/Cost-Anomaly-Alert/versions.tf new file mode 100644 index 00000000..699b2491 --- /dev/null +++ b/modules/azurerm/Cost-Anomaly-Alert/versions.tf @@ -0,0 +1,29 @@ +# ------------------------------------------------------------------------------------- +# +# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# -------------------------------------------------------------------------------------- + +terraform { + required_version = ">= 0.13" + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = ">= 3.52.0" + } + } +}