mattcowen / forefront-lz

A landing zone for secure deployments
Apache License 2.0
5 stars 1 forks source link

Error running terraform bootstrap deploy.sh #12

Closed gareththegeek closed 3 years ago

gareththegeek commented 3 years ago

│ Error: Missing required argument │ │ on main.tf line 51, in resource "azuread_application" "sc_keyvault_app": │ 51: resource "azuread_application" "sc_keyvault_app" { │ │ The argument "display_name" is required, but no definition was found. ╵ ╷ │ Error: Unsupported argument │ │ on main.tf line 52, in resource "azuread_application" "sc_keyvault_app": │ 52: name = var.sc_keyvault_sp_name │ │ An argument named "name" is not expected here.

Steps:

  1. From a linux prompt with terraform/azure cli etc installed
  2. Configure .env within bootstrap directory
  3. Execute bash ./bootstrap.sh
  4. Execute bash ./deploy.sh

gareth@DESKTOP-8V0L603:/mnt/c/dev/forefront-lz/bootstrapping$ terraform --version Terraform v1.0.10 on linux_amd64

  • provider registry.terraform.io/hashicorp/azuread v2.8.0
  • provider registry.terraform.io/hashicorp/azurerm v2.83.0
  • provider registry.terraform.io/hashicorp/random v3.1.0 gareth@DESKTOP-8V0L603:/mnt/c/dev/forefront-lz/bootstrapping$ az --version azure-cli 2.29.0 *

core 2.29.0 * telemetry 1.0.6

Extensions: aks-preview 0.5.34 azure-cli-ml 1.33.0 connectedk8s 1.2.0 k8s-configuration 1.1.1 k8sconfiguration 0.2.4

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\gwilliams.azure\cliextensions'

Python (Windows) 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 13:22:56) [MSC v.1928 32 bit (Intel)]

gareththegeek commented 3 years ago

Assuming this is a difference in tooling version somewhere.

Changed name = to display_name = on line 52 Now receive:

│ Error: Unsupported argument │ │ on main.tf line 72, in resource "azuread_application_password" "sc_keyvault_sp_password": │ 72: description = "TF generated password" │ │ An argument named "description" is not expected here.

gareththegeek commented 3 years ago

Change lines 59-73:

# resource "random_password" "password" {
#   length      = 16
#   special     = true
#   min_numeric = 1
#   min_special = 1
#   min_lower   = 1
#   min_upper   = 1
# }

resource "azuread_application_password" "sc_keyvault_sp_password" {
  application_object_id = azuread_application.sc_keyvault_app.id
  #value                 = random_password.password.result
  end_date              = "2040-01-01T00:00:00Z"
  #description           = "TF generated password"
}
gareththegeek commented 3 years ago

Related to #9