Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resource "azurerm_virtual_machine_scale_set" "sf_scale_set_app" {
- count = "${var.is_sf_cluster_required}"
- name = "app"
- location = "${var.location}"
- resource_group_name = "${azurerm_resource_group.fusion.name}"
- automatic_os_upgrade = true
- upgrade_policy_mode = "Automatic"
- health_probe_id = "${azurerm_lb_probe.sf_lb_probe_gateway_app.id}"
- sku {
- name = "${var.sf_scale_set_app_config["name"]}"
- tier = "${var.sf_scale_set_app_config["tier"]}"
- capacity = "${var.sf_scale_set_app_config["capacity"]}"
- }
- storage_profile_image_reference {
- publisher = "Canonical"
- offer = "UbuntuServer"
- sku = "16.04"
- version = "6.0.12"
- }
- storage_profile_os_disk {
- name = ""
- caching = "ReadWrite"
- create_option = "FromImage"
- managed_disk_type = "Standard_LRS"
- }
- os_profile_secrets = [
- {
- source_vault_id = "${var.sf_vault_id}"
- vault_certificates = [
- {
- certificate_url = "${var.sf_vault_url}"
- certificate_store = "My"
- },
- ]
- },
- ]
- storage_profile_data_disk {
- lun = 0
- caching = "ReadWrite"
- create_option = "Empty"
- disk_size_gb = 40
- }
- os_profile {
- computer_name_prefix = "app"
- admin_username = "someuser"
- custom_data = "${data.template_file.cloud_init_config_app.rendered}"
- }
- os_profile_linux_config {
- disable_password_authentication = true
- ssh_keys {
- path = "/home/someuser/.ssh/authorized_keys"
- key_data = "${file("sshkeys/someuser.pub")}"
- }
- }
- network_profile {
- name = "sf-vm-net-profile-${terraform.workspace}"
- primary = true
- ip_configuration {
- name = "sf-ip-config-app-${terraform.workspace}"
- primary = true
- subnet_id = "${azurerm_subnet.sf_vnet_subnet.id}"
- load_balancer_backend_address_pool_ids = ["${azurerm_lb_backend_address_pool.sf_lb_be_app.id}"]
- load_balancer_inbound_nat_rules_ids = ["${element(azurerm_lb_nat_pool.sf_nat_app.*.id, count.index)}"]
- }
- }
- extension {
- name = "sf-scale-set-extension-${terraform.workspace}"
- publisher = "Microsoft.Azure.ServiceFabric"
- type = "ServiceFabricLinuxNode"
- type_handler_version = "1.0"
- settings = "{ "certificate": { "thumbprint": "${var.cert_thumbprint}", "x509StoreName": "My" } , "clusterEndpoint": "${azurerm_service_fabric_cluster.sf_service.cluster_endpoint}", "nodeTypeRef": "app", "durabilityLevel": "${var.sf_reliability}","nicPrefixOverride": "${azurerm_subnet.sf_vnet_subnet.address_prefix}","enableParallelJobs": "true"}"
- protected_settings = "{"StorageAccountKey1": "${azurerm_storage_account.sf_storage.primary_access_key}", "StorageAccountKey2": "${azurerm_storage_account.sf_storage.secondary_access_key}"}"
- }
- data "template_file" "cloud_init_config_app" {
- count = "${var.is_sf_cluster_required}"
- template = "${file("customscripts/cloud_init.sh")}"
- vars {
- azure_tenant_id = "771c9c47-7f24-44dc-958e-34f8713a8394"
- azure_client_id = "${var.client_id}"
- azure_client_secret = "${var.client_secret}"
- }
- }
- resource "azurerm_storage_account" "sf_storage" {
- count = "${var.is_sf_cluster_required}"
- name = "${replace(replace(lower(terraform.workspace), "-", ""), " ", "")}-sf-diag-${substr(random_id.server.hex,0,4)}"
- resource_group_name = "${azurerm_resource_group.fusion.name}"
- location = "${azurerm_resource_group.fusion.location}"
- account_tier = "Standard"
- account_kind = "StorageV2"
- account_replication_type = "LRS"
- }
- ------------------------------------------------------------------------
- Error: Error running plan: 2 error(s) occurred:
- * azurerm_virtual_machine_scale_set.sf_scale_set_app: 1 error(s) occurred:
- * azurerm_virtual_machine_scale_set.sf_scale_set_app: Resource 'azurerm_storage_account.sf_storage' not found for variable 'azurerm_storage_account.sf_storage.primary_access_key'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement