danbarr / terraform-azurerm-nocode-webserver

Terraform module for a no-code enabled web server in Azure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terraform module azurerm-nocode-webserver

Provisions an Azure resource group and VNet containing a webserver VM and sample HashiCafe website, using a base image registered in HCP Packer.

Enabled for Terraform Cloud no-code provisioning.

Prerequisites

For no-code provisioning, Azure credentials must be supplied to the workspace via environment variables (e.g. ARM_TENANT_ID, ARM_SUBSCRIPTION_ID, ARM_CLIENT_ID, and ARM_CLIENT_SECRET for a service principal). It is recommended to attach these via a project.

Also requires environment variables containing an HCP service principal credential (HCP_CLIENT_ID and HCP_CLIENT_SECRET). It is recommende to attach these globally or to projects where no-code workspaces will be provisioned.

Requirements

Name Version
terraform >= 1.2
azurerm ~> 3.0
hcp ~> 0.82
null ~> 3.1
random ~> 3.4

Providers

Name Version
azurerm ~> 3.0
hcp ~> 0.82
null ~> 3.1
random ~> 3.4

Modules

No modules.

Resources

Name Type
azurerm_linux_virtual_machine.hashiapp resource
azurerm_network_interface.hashiapp-nic resource
azurerm_network_interface_security_group_association.hashiapp-nic-sg-assoc resource
azurerm_network_security_group.hashiapp-sg resource
azurerm_public_ip.hashiapp-pip resource
azurerm_resource_group.myresourcegroup resource
azurerm_subnet.subnet resource
azurerm_virtual_network.vnet resource
null_resource.configure-web-app resource
random_integer.product resource
hcp_packer_artifact.ubuntu-webserver data source

Inputs

Name Description Type Default Required
address_space The address space that is used by the virtual network. You can supply more than one address space. Changing this forces a new resource to be created. string "10.0.0.0/16" no
admin_password Administrator password for OS. string "Password123!" no
admin_username Administrator user name for OS. string "hashicorp" no
department Value for the department tag. string "WebDev" no
env Value for the environment tag. string n/a yes
hashi_products n/a
list(object({
name = string
color = string
image_file = string
}))
[
{
"color": "#dc477d",
"image_file": "hashicafe_art_consul.png",
"name": "Consul"
},
{
"color": "#ffffff",
"image_file": "hashicafe_art_hcp.png",
"name": "HCP"
},
{
"color": "#60dea9",
"image_file": "hashicafe_art_nomad.png",
"name": "Nomad"
},
{
"color": "#63d0ff",
"image_file": "hashicafe_art_packer.png",
"name": "Packer"
},
{
"color": "#844fba",
"image_file": "hashicafe_art_terraform.png",
"name": "Terraform"
},
{
"color": "#2e71e5",
"image_file": "hashicafe_art_vagrant.png",
"name": "Vagrant"
},
{
"color": "#ffec6e",
"image_file": "hashicafe_art_vault.png",
"name": "Vault"
}
]
no
location The region where the virtual network is created. string n/a yes
packer_bucket HCP Packer image bucket name. string "ubuntu22-nginx" no
packer_channel HCP Packer image channel. string "production" no
prefix This prefix will be included in the name of most resources. string n/a yes
subnet_prefix The address prefix to use for the subnet. string "10.0.10.0/24" no
vm_size Specifies the size of the virtual machine. string "Standard_B2s" no

Outputs

Name Description
base_image n/a
hashiapp_url n/a
product The product which was randomly selected.

About

Terraform module for a no-code enabled web server in Azure

License:MIT License


Languages

Language:HCL 79.2%Language:HTML 20.8%