diff --git a/.gitignore b/.gitignore index fd5fc45..4d576d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,9 @@ -# Local .terraform directories -**/.terraform/* - -# .tfstate files -*.tfstate -*.tfstate.* -.terraform -.terraform.lock.hcl -.terraform.tfstate.lock.info - -**/.idea -**/*.iml - -# Go mod and sum files -go.mod -go.sum +# Local .terraform directories +**/.terraform/* + +# .tfstate files +*.tfstate +*.tfstate.* +.terraform +.terraform.lock.hcl +.terraform.tfstate.lock.info diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl new file mode 100644 index 0000000..b53ad45 --- /dev/null +++ b/.terraform.lock.hcl @@ -0,0 +1,21 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/azurerm" { + version = "3.75.0" + hashes = [ + "h1:HAHEVV+sFAZoNolQgysdkDyPf/U5rDA/4FCYigaK/aA=", + "zh:0d881d7b499367400ced6e315e32a1948d823309c5677a16056367001a8785ce", + "zh:384acba136f1b347cac7831bb4e0396a370f6664e1c1242fce42a6fc55b9db8a", + "zh:409a01af5d873e4ac7e62cfd8c9a27638a719394ccf6a8de89ac4a1049275c20", + "zh:547eab553ea24cc9079fd80093c1611d036df089385bb4a38c5db21f6126e75e", + "zh:714a1fc3d1485deec10f4a49be556997f8ea0cc717db78fa0613f5bee728fcd7", + "zh:90d197c03a3bad2a8cfa7fc2396dc1601bf08be9368d399d58ec51654201c6fb", + "zh:9587b44249147b0e9d7619568cf46de126ec947ca5c56a1d740d8142b89919c2", + "zh:9d910ae66496833d4f85a4fe6b24649f74a1624f1502f63e9ff8201f29c0c1d1", + "zh:9f355767fc7f5ab769a60b46e42f9498f33ee95c3833b7d95c7f7c69fe101564", + "zh:d11d91da699d8c62f873cdea72bc26ab40cde4f18bc88ab6583ea836fee26ecd", + "zh:e0f9d50274f54acc2c5e300537d96a5aa03be650cfb66249a14ed45375014c77", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..8ed2949 --- /dev/null +++ b/main.tf @@ -0,0 +1,25 @@ +provider "azurerm" { + features {} + + client_id = var.client_id + client_secret = var.client_secret + subscription_id = var.subscription_id + tenant_id = var.tenant_id +} + +data "azurerm_resource_group" "existing" { + name = "experiment32" +} + +resource "azurerm_api_management" "example" { + name = "my-api-management" + location = data.azurerm_resource_group.existing.location + resource_group_name = "experiment32" + publisher_name = "My Company" + publisher_email = "contact@company.com" + sku_name = "Developer_1" + + identity { + type = "SystemAssigned" + } +} diff --git a/terraform.tfstate b/terraform.tfstate new file mode 100644 index 0000000..c054359 --- /dev/null +++ b/terraform.tfstate @@ -0,0 +1,17 @@ +{ + "version": 4, + "terraform_version": "1.4.6", + "serial": 1, + "lineage": "e01cd7b0-7802-c464-5743-41db12f8ea73", + "outputs": {}, + "resources": [ + { + "mode": "managed", + "type": "azurerm_api_management", + "name": "example", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [] + } + ], + "check_results": null +} diff --git a/terraform.tfvars b/terraform.tfvars new file mode 100644 index 0000000..3707f24 --- /dev/null +++ b/terraform.tfvars @@ -0,0 +1,4 @@ +client_secret="sek8Q~dDXuChQRvBdqigMjcaiLgP6dRzgFn55bNx" +client_id="c1cd6156-8e0b-4ed1-b2fa-d3e7fae3919a" +tenant_id="1e8647b3-1bcf-4d17-9721-28853cbe413f" +subscription_id="77b45418-7fb5-4763-bc5c-fa8dccc10889" \ No newline at end of file diff --git a/variables.tf b/variables.tf new file mode 100644 index 0000000..feede0e --- /dev/null +++ b/variables.tf @@ -0,0 +1,15 @@ +variable "client_id" { + description = "Azure client ID" +} + +variable "client_secret" { + description = "Azure client secret" +} + +variable "subscription_id" { + description = "Azure subscription ID" +} + +variable "tenant_id" { + description = "Azure tenant ID" +}