Skip to content

Commit

Permalink
AZURE: generate output
Browse files Browse the repository at this point in the history
  • Loading branch information
zbioe committed Aug 21, 2022
1 parent d569565 commit cb0f976
Showing 1 changed file with 10 additions and 38 deletions.
48 changes: 10 additions & 38 deletions provision/azure/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,6 @@ in {
tags = azure.tags;
};

azurerm_network_security_group = attrsMap networks (name: {
${name} = with networks.${name}; {
inherit name location;
resource_group_name = group;
};
});

azurerm_virtual_network = attrsMap networks (name: {
${name} = with networks.${name}; {
inherit location name tags dns_servers;
Expand All @@ -167,9 +160,14 @@ in {
};
}));

# TODO:
# subnet_network_security_group_association =
# "\${ azurerm_network_security_group.${name}.id }";
azurerm_storage_container = attrsMap images (name:
with images.${name}; {
${name} = {
inherit name;
storage_account_name = "\${ azurerm_storage_account.${name}.name }";
container_access_type = "private";
};
});

azurerm_storage_account = attrsMap images (name: {
${name} = with images.${name};
Expand All @@ -190,15 +188,6 @@ in {
};
});

azurerm_storage_container = attrsMap images (name:
with images.${name}; {
${name} = {
inherit name;
storage_account_name = "\${ azurerm_storage_account.${name}.name }";
container_access_type = "private";
};
});

azurerm_storage_blob = attrsMap images (name:
with images.${name}; {
${name} = {
Expand All @@ -216,20 +205,6 @@ in {
};
});

# azurerm_managed_disk = attrsMap images (name:
# with images.${name}; {
# ${name} = {
# inherit name location tags;
# storage_account_id = "\${ azurerm_storage_account.${name}.id }";
# resource_group_name = "\${ azurerm_resource_group.${group}.name }";
# os_type = "Linux";
# storage_account_type = "Standard_LRS";
# create_option = "Import";
# source_uri = "\${ azurerm_storage_blob.${name}.id }";
# disk_size_gb = "2";
# };
# });

azurerm_image = attrsMap images (name:
with images.${name}; {
${name} = {
Expand Down Expand Up @@ -304,13 +279,10 @@ in {

output = attrsMap interfaces (name:
let
inherit (builtins) head;
repl = replicas.${name};
pub = "\${ azurerm_virtual_machine.${name} }";
priv = "\${ azurerm_virtual_machine.${name} }";
pub = "\${ azurerm_public_ip.${name}.ip_address }";
priv = "\${ azurerm_network_interface.${name}.private_ip_address }";
in {
${name} = {
sensitive = true;
value = with azure; {
inherit name;
ip = { inherit pub priv; };
Expand Down

0 comments on commit cb0f976

Please sign in to comment.