From b5d07828a0dcc5c73fa2f59cebe726a71f9b245c Mon Sep 17 00:00:00 2001 From: Raffael Eloi Date: Sat, 15 Jun 2024 18:00:16 -0300 Subject: [PATCH] refactor code structure --- main.tf | 25 ------------------------- provider.tf | 3 +++ resource_group.tf | 3 +++ service_plan.tf | 7 +++++++ storage_account.tf | 7 +++++++ 5 files changed, 20 insertions(+), 25 deletions(-) create mode 100644 provider.tf create mode 100644 resource_group.tf create mode 100644 service_plan.tf create mode 100644 storage_account.tf diff --git a/main.tf b/main.tf index 6f4a740..dfcdabc 100644 --- a/main.tf +++ b/main.tf @@ -1,28 +1,3 @@ -provider "azurerm" { - features {} -} - -data "azurerm_resource_group" "resourcegroup" { - name = "RaffaLab" -} - -resource "azurerm_storage_account" "storageAccount" { - name = "storagemailnotifiersa" - resource_group_name = data.azurerm_resource_group.resourcegroup.name - location = data.azurerm_resource_group.resourcegroup.location - account_tier = "Standard" - account_replication_type = "RAGRS" -} - -resource "azurerm_service_plan" "serviceplan" { - name = "StorageMailNotifierSP" - resource_group_name = data.azurerm_resource_group.resourcegroup.name - location = data.azurerm_resource_group.resourcegroup.location - os_type = "Linux" - sku_name = "Y1" -} - - resource "azurerm_linux_function_app" "function" { name = "storageMailNotifierFn" resource_group_name = data.azurerm_resource_group.resourcegroup.name diff --git a/provider.tf b/provider.tf new file mode 100644 index 0000000..615cb43 --- /dev/null +++ b/provider.tf @@ -0,0 +1,3 @@ +provider "azurerm" { + features {} +} \ No newline at end of file diff --git a/resource_group.tf b/resource_group.tf new file mode 100644 index 0000000..192c2c9 --- /dev/null +++ b/resource_group.tf @@ -0,0 +1,3 @@ +data "azurerm_resource_group" "resourcegroup" { + name = "RaffaLab" +} \ No newline at end of file diff --git a/service_plan.tf b/service_plan.tf new file mode 100644 index 0000000..f07b4d8 --- /dev/null +++ b/service_plan.tf @@ -0,0 +1,7 @@ +resource "azurerm_service_plan" "serviceplan" { + name = "StorageMailNotifierSP" + resource_group_name = data.azurerm_resource_group.resourcegroup.name + location = data.azurerm_resource_group.resourcegroup.location + os_type = "Linux" + sku_name = "Y1" +} \ No newline at end of file diff --git a/storage_account.tf b/storage_account.tf new file mode 100644 index 0000000..1da5f43 --- /dev/null +++ b/storage_account.tf @@ -0,0 +1,7 @@ +resource "azurerm_storage_account" "storageAccount" { + name = "storagemailnotifiersa" + resource_group_name = data.azurerm_resource_group.resourcegroup.name + location = data.azurerm_resource_group.resourcegroup.location + account_tier = "Standard" + account_replication_type = "RAGRS" +} \ No newline at end of file