In my earlier post, I shared an example of deploying UpCloud infrastructure using Terraform from scratch. In this post, I want to share how to deploy the infrastructure using available Terraform modules to speed up the set-up process, especially for common use cases like preparing a web server.
For instance, our need is to deploy a website with some conditions as follows.
- The website can be accessed through HTTPS. If the request is HTTP, it will be redirected to HTTPS.
-
There are 2 domains,
web1.yourdomain.comandweb2.yourdomain.com. But, users should be redirected to "web2" if they are visiting "web1".
There are 4 main modules that we need to set up the environment.
- Private network. It allows the load balancer to connect with the server and pass the traffic.
- Server. It is used to host the website.
- Load balancer. It includes backend and frontend configuration.
- Dynamic certificate. It is required to allow an HTTPS connection.
Before we configure the main modules. We should set some variables used in the configuration in the variables.tf file. Then, we create a terraform.tfvars file that contains the values for those variables.
# variables.tf
variable "upcloud_username" {
description = "UpCloud username"
type = string
}
variable "upcloud_password" {
description = "UpCloud password"
type = string
}
variable "zone" {
description = "UpCloud zone"
type = string
default = "sg-sin1"
}
variable "public_keys" {
description = "List of public keys for server access"
type = list(string)
}
# terraform.tfvars
upcloud_username = "xxx"
upcloud_password = "xxx"
zone = "sg-sin1"
public_keys = [
"ssh-ed25519 AAAAxxx",
"ssh-ed25519 AAAAxxx"
]
Firstly, we set up the private network as the code below.
# main.tf
provider "upcloud" {
username = var.upcloud_username
password = var.upcloud_password
}
module "private_network" {
source = "lukibsubekti/network-private/upcloud"
version = "1.0.2"
router_name = "my-router"
network_name = "my-network"
zone = var.zone
network = {
subnet = "10.0.10.0/24"
is_dhcp = true
family = "IPv4"
is_dhcp_default_route = false
gateway_address = "10.0.10.1"
}
}
Next, we set up the web server. In this example, we just run an Nginx server which will host a default HTML page on port 80. The login method uses public keys.
# main.tf
module "web_server" {
source = "lukibsubekti/web-server/upcloud"
version = "1.0.1"
zone = var.zone
hostname = "my-web-server"
plan = "DEV-1xCPU-2GB"
os = "ubuntu-22.04"
private_network = {
network_id = module.private_network.network_id
ip_address = "10.0.10.123"
}
login = {
send_password = "none"
keys = var.public_keys
}
user_data = <<-EOF
#!/bin/bash
sudo apt-get update
sudo apt-get install -y nginx
EOF
}
Now, we configure the load balancer. We define a single backend server and several frontend rules to direct or serve requests based on conditions we set.
# main.tf
locals {
web1 = "web1.yourdomain.com"
web2 = "web2.yourdomain.com"
}
module "loadbalancer" {
source = "lukibsubekti/loadbalancer-static/upcloud"
version = "1.0.2"
zone = var.zone
name = "my-loadbalancer"
private_network = {
name = "private-net"
id = module.private_network.network_id
}
backends = {
"my-website" = [
{
ip = module.web_server.networks.private.ip_address
port = 80
}
]
}
frontends = {
"my-http" = {
mode = "http"
port = 80
default_backend = "my-website"
}
"my-https" = {
mode = "http"
port = 443
default_backend = "my-website"
}
}
rules = {
# redirect HTTP traffic to HTTPS
"my-rule1" = {
frontend = "my-http"
priority = 100
matching_condition = "or"
matchers = {
request_header = [
{
method = "starts"
name = "Host"
value = local.web1
ignore_case = true
},
{
method = "starts"
name = "Host"
value = local.web2
ignore_case = true
}
]
}
actions = {
http_redirect = {
scheme = "https"
}
set_forwarded_headers = {
active = true
}
}
}
# redirect HTTPS traffic from web1 to web2
"my-rule2" = {
frontend = "my-https"
priority = 90
matchers = {
request_header = [
{
method = "starts"
name = "Host"
value = local.web1
ignore_case = true
}
]
}
actions = {
http_redirect = {
location = "https://${local.web2}"
}
set_forwarded_headers = {
active = true
}
}
}
# handle HTTPS traffic for web2
"my-rule3" = {
frontend = "my-https"
priority = 80
matchers = {
request_header = [
{
method = "starts"
name = "Host"
value = local.web2
ignore_case = true
}
]
}
actions = {
use_backend = {
backend_name = "my-website"
}
set_forwarded_headers = {
active = true
}
}
}
}
}
We also need to output some values including the server IP address and the load balancer DNS name. We set it in output.tf file.
# output.tf
output "server_networks" {
value = module.web_server.networks
description = "Server networks"
}
output "loadbalancer_networks" {
value = module.loadbalancer.networks_map
description = "Load balancer networks"
}
Before we can configure the dynamic certificate, we should apply the current configuration to get the load balancer DNS name which will be added to our DNS record. It is necessary so that the certificate can be verified and generated by the certificate provider.
Initialize the module and apply the configuration.
terraform init
terraform apply
![]() |
| The server IP address |
![]() |
| The public DNS name of the load balancer |
![]() |
| Updated DNS record for our domain |
After the DNS record is updated. We can apply the dynamic certificate configuration.
# main.tf
module "certs" {
source = "lukibsubekti/certs-dynamic/upcloud"
version = "1.0.0"
name = "my-certs"
hostnames = [
local.web1,
local.web2
]
frontend_id = module.loadbalancer.frontends_map["my-https"].id
}
Reinitialize the module and apply the updated configuration.
terraform init
terraform apply
![]() |
| The certificate is verified |
Lastly, we can verify the result by visiting http://web1.yourdomain.com that will be redirected to https://web2.yourdomain.com.






Everyone knows Matty Boy as the guy who laughs the loudest at his own jokes, but somehow, that’s what makes them funny. His energy is contagious.
ReplyDeleteBorn from a passion for clean lines and confident energy, Kroen represents a new generation of fashion that values both comfort and identity.
ReplyDeleteHMDD collects and organizes experimental data from scientific publications, making it easier to explore verified miRNA–disease associations. This helps bridge the gap between molecular biology and clinical research.
ReplyDeleteFondée il y a plusieurs décennies, Davril a commencé comme un petit atelier familial. Au fil des ans, la marque a su évoluer tout en conservant ses méthodes traditionnelles de fabrication. Aujourd’hui, Davril est présente dans de nombreux pays et continue d’innover dans le domaine de la chaussure haut de gamme.
ReplyDeleteThe design philosophy behind Akimbo hoodies revolves around versatility and self-expression. Unlike standard hoodies, Akimbo pieces often incorporate oversized fits, asymmetric cuts, and unexpected details like contrasting panels, zippers, or graphic prints. This approach allows wearers to make a statement while remaining comfortable, aligning with the modern trend of functional fashion that’s also visually striking.
ReplyDeleteIn Islamic cosmology, the Seven Heavens are described as seven layers above the earthly realm, each inhabited by angels and sacred beings. The Qur’an mentions these heavens as part of God’s creation, with each level having unique characteristics. Similarly, in Judaic tradition, references to seven heavens appear in mystical texts such as the Talmud and Kabbalah, portraying ascending levels of spiritual experience.
ReplyDeleteTheir mission is to offer luxury fragrances that blend traditional Arabian scents with modern appeal, making them accessible to a global audience.
ReplyDeleteOne of the defining characteristics of Chrome Hearts hoodies is their use of high-quality fabrics. Most hoodies are crafted from heavyweight cotton or cotton-blend materials, ensuring durability, comfort, and a luxurious feel.
ReplyDeleteAt the core of every Pokémon Center is the Pokémon Healing Machine, typically operated by the nurses, most famously Nurse Joy.
ReplyDeleteMr. Winston exhibited a fascination with the metaphysical. Growing up surrounded by books on philosophy, religion, and ancient wisdom, he quickly developed an intuition for mystical traditions across cultures.
ReplyDeleteNo visit to London is complete without seeing its famous landmarks. The historic Tower of London, the majestic Buckingham Palace, and the striking Big Ben clock tower are essential stops. Modern icons like The Shard and the London Eye offer panoramic views of the city, combining historical significance with contemporary architecture. These landmarks are not just tourist attractions—they reflect the city’s rich cultural heritage and dynamic evolution.
ReplyDeleteThe black hue lends the piece versatility, allowing it to pair seamlessly with a range of outfits—from distressed jeans to tailored trousers. Its aesthetic is simultaneously raw and refined, appealing to those who seek an edge in everyday fashion.
ReplyDeleteNazwa „Stone Island” ‒ kamienna wyspa ‒ zostaÅ‚a zaczerpniÄ™ta przez Ostiego od literatury Josepha Conrada, której motywy – morza, statków, żywiołów morskich – mocno wpÅ‚ynęły na estetykÄ™ marki.
ReplyDeleteBeyond just a visual motif, the spider imagery symbolizes connection, creativity, and the interwoven nature of culture, music, and community.
ReplyDeleteComme des Garçons began to gain a strong cult following in Japan, especially among young consumers who were drawn to its deconstructed, monochrome, and sometimes “anti-fashion” aesthetic.
ReplyDeleteMurakami has extended his artistic vision into the realm of fashion through various collaborations and his own clothing lines, creating an intersection between art and wearability.
ReplyDeleteHonestly, the quality of Trapstar pieces has surprised me—in a good way. I thought it might be just hype at first, but the materials, stitching, and fit are actually on point. I bought one of their jackets last winter, and it's still in top condition after tons of wear. Definitely worth the investment if you care about durability and style.
ReplyDeleteHonestly, I like some of the designs, but the price point can be a bit much. I understand the exclusivity aspect and the brand value that Kanye brings, but it feels like a stretch to pay over $100 for a basic tee with a logo. That said, the resell value is wild, so it’s hard to argue with the hype.
ReplyDeleteI love how the God Speed Hoodie merges comfort and creativity. The fabric is soft and warm, ideal for any season, while the artwork and logo placement feel intentional and meaningful.
ReplyDeleteKapital’s aesthetic is definitely not for everyone, but that’s what makes it special. It’s rebellious, raw, and unapologetically different.
ReplyDeleteHonestly, I never thought a hat could be this versatile until I tried the Lover Boy Hat. Whether you’re dressing up for a casual day out or aiming for a more polished look, this hat fits seamlessly into so many different styles.
ReplyDeleteTrapstar hoodies are more than just fashion they represent a movement and culture. The designs are bold yet minimal, and that iconic "It's a Secret" branding just hits different.
ReplyDeleteWhat makes Civil Regime stand out to me is the emotion behind their collections. The mix of luxury fashion elements with underground street culture gives their clothes a very distinct personality. You can tell there’s thought behind every design, and that’s why their fans connect with the brand on a deeper level.
ReplyDeleteLattafa has quickly risen to become synonymous with luxury, elegance, and affordability. Based in the United Arab Emirates, Lattafa Perfumes has carved a niche for itself by offering high-quality, long-lasting fragrances that rival some of the most expensive designer brands
ReplyDeleteIn the realm of underground hip-hop, few labels have carved out a niche as distinctive and dedicated as G59 Records (short for GREY59). Co-founded by the New Orleans-based rap duo $uicideboy$, the label has become a cultural force in both music and fashion.
ReplyDeleteTakashi Murakami, the acclaimed Japanese contemporary artist, has captivated the world not only with his vibrant, anime-inspired artworks but also with his foray into fashion. Known for blending traditional Japanese art techniques with bold pop culture imagery, Murakami has become a major force in the fashion world, pushing the boundaries of wearable art.
ReplyDeleteIn a world increasingly shaped by fast fashion and mass production, Ensemble Vrunk emerges as a radical departure — a movement that challenges conventions and embraces bold, eclectic aesthetics. Combining the disciplines of fashion, art, and sustainability, Ensemble Vrunk has quickly carved a niche for itself in the modern sartorial landscape.
ReplyDeleteThe Sp5der Store is now a go-to destination for fans of bold fashion statements, mixing high-end streetwear aesthetics with underground influence.
ReplyDeleteEme Studios is a contemporary streetwear brand based in Madrid, Spain, known for fusing minimal aesthetics with deeper conceptual messages. Founded in 2018, the brand positions itself as more than just fashion: it strives to create wearable art that tells stories, challenges norms, and builds a community around values.
ReplyDeleteCough syrups typically contain two active ingredients: dextromethorphan (DXM), a cough suppressant, and promethazine with codeine, an opioid, in some prescription formulations. When used as directed, these ingredients can effectively reduce coughing and aid sleep. However, in high doses, both can produce psychoactive effects.
ReplyDeleteIn the modern streetwear scene, few brands have generated as much mystique and buzz as Corteiz (often stylized as CRTZ or misspelled as “Cortiez”). What began as a small, underground label has grown into a cultural phenomenon
ReplyDeleteIn the rapidly evolving world of fashion, few brands have created as much buzz and loyal following in such a short span as Corteiz (often stylized as “Crtz”). Emerging from the streets of London, this underground label has grown into a cultural force, thanks to its authenticity, exclusivity, and a strong connection with youth culture.
ReplyDeleteKanye West, a name synonymous with innovation and controversy in both music and fashion, has consistently pushed the boundaries of style. Among his many iconic fashion pieces, the Kanye West pullover has emerged as a quiet yet powerful symbol of modern streetwear.
ReplyDeleteGreat post on winter styling. Even though shorts aren’t typical for cold weather, Denim Tears shorts work amazingly with tights, long hoodies, or oversized jackets. They’re trending everywhere right now and there are some Christmas sale deals that cut the price quite nicely. Definitely worth a look!
ReplyDeleteWhat I love most about Zenana clothing is how well it blends comfort with style. Their relaxed fits and neutral shades look great layered for winter outfits. The Christmas sale lets you grab popular pieces at much lower prices. Anyone wanting warm and cozy apparel should definitely check Zenana clothing right now.
ReplyDeleteChristmas is the perfect time to elevate your outfits, and reps clothing gives you premium-style looks without the high price. I recently checked some stores and was impressed by the craftsmanship, especially on hoodies and jackets.
ReplyDeleteThanks for sharing these food safety ideas! With everyone cooking bigger meals for Christmas, knowing how long ground beef in refrigerator stays fresh is super helpful. I usually keep it for 1–2 days max before cooking or freezing. It makes meal planning smoother and safer. Also, if anyone needs quality beef for the holidays, check the seasonal sales—prices are great!
ReplyDeleteDenim Tears has become one of the few brands that mixes art and fashion so naturally. Their hoodies are not only fashionable but also meaningful, especially for people who value heritage. During the Christmas holiday sales, these pieces tend to sell out quickly. You should explore the new arrivals on Denim Tears Hoodies Christmas Sale to get the best deals.
ReplyDeleteGreat post! I’ve been trying to update my wardrobe for the festive season, and Broken Planet has become my go-to. Their hoodies especially look amazing for Christmas gatherings—warm, stylish, and surprisingly affordable.
ReplyDeleteThanks for sharing this! I’m fully relying on online shopping this Christmas because most websites are offering special deals, gift bundles, and free delivery. It’s so convenient to compare prices and styles from different stores without moving from my couch.
ReplyDeleteGreat post! I’ve been searching for brands with real value and the Sisters and Seekers Christmas holidays sale caught my attention. Their silhouettes feel clean but still expressive, especially the knitwear pieces. Ideal for gifting or upgrading your closet before the new year. Highly recommend browsing their deals.
ReplyDeleteI love how Pokémon hoodies bring nostalgia and comfort together. The designs are clean and not overly loud. I noticed several stores offering Christmas holiday sales where you can score the latest Pikachu and Charizard prints at great prices. Totally recommend exploring the Pokémon hoodie category before stocks run out.
ReplyDeleteI recently discovered Kapital Clothing, and with Christmas near, their collection feels extra special. From cozy jackets to detailed denim, everything looks handmade with love. If you're into stylish and meaningful holiday outfits, Kapital is worth exploring.
ReplyDeleteThanks for sharing these fashion insights. During Christmas I try to shop from brands that blend comfort and sustainability, and 7 Heavens is doing that beautifully. Their Christmas Sale is offering great value on hoodies, joggers, and winter streetwear. I grabbed two outfits for gifting and the fit was perfect.
ReplyDeleteI’ve been reading great reviews about Lattafa and finally tried one during the Christmas promotion—it exceeded expectations. The fragrance lasts all day without being overwhelming. For anyone looking for a premium gift on a budget, Lattafa perfumes are a must-browse this holiday.
ReplyDeleteThanks for sharing this! Trapstar has become one of my go-to brands for Christmas shopping because of its bold streetwear designs. The holiday collections feature warm hoodies, puffer jackets, and tracksuits that make perfect gifts.
ReplyDeleteGreat insights! I’ve been browsing the Takashi Murakami Shop lately, especially with Christmas around the corner. The vibrant flowers and characters make perfect creative gifts. It’s refreshing to see designer art becoming part of holiday celebrations. Highly recommend checking their seasonal drops.
ReplyDeleteThe chrome heart hoodie is a strong fashion statement and the Christmas holiday sale makes it more affordable The fabric feels premium and fits comfortably It is a great choice for gifting
ReplyDeleteust wanted to share my experience—Godspeed Clothing has some really clean holiday-friendly streetwear pieces. I picked up a hoodie for the Christmas holidays and the fit was on point. The brand is getting popular fast
ReplyDeleteI recently tried the Mr Winston hoodie and the quality surprised me. The interior fleece is soft enough for colder months but still breathable for daily wear. Christmas discounts make the pricing even more appealing, especially for people looking to upgrade their wardrobe. If you’re thinking about gifting something practical yet premium, this hoodie could be a great pick.
ReplyDeleteStone Island zawsze kojarzyło mi się z odważnym designem, ale dopiero ostatnio odkryłem ich zimową jakość. Ocieplane kurtki i swetry z termoregulacją sprawdzają się przy niskich temperaturach. Świąteczne wyprzedaże to doskonały moment, aby zainwestować w coś trwałego. Polecam porównać modele w różnych sklepach, bo różnice cen mogą być naprawdę duże.
ReplyDeleteThanks for sharing these fashion insights! I’ve recently seen a lot of buzz around Corteiz Clothing and how it combines comfort with bold style. Their hoodies and tracksuits seem ideal for Christmas gifting, especially with the colder weather. Has anyone tried ordering from them during the holidays?
ReplyDeleteIf you’re thinking about gifts this season, the Essentials Hoodie is safe and trendy. Many customers love how breathable yet warm the cotton-blend fabric is. The Christmas sale discounts are solid, so you get premium quality at a more friendly price. A must-have wardrobe staple this season.
ReplyDeleteGreat insights! With Christmas around the corner, fashion lovers like me are focusing on brands that offer both comfort and luxury. Alchemai clothing stands out with its impressive winter wear. Their hoodies and jackets look like ideal Christmas gifts. Anyone planning a wardrobe upgrade must explore Alchemai clothing — stylish, practical, and holiday-ready!
ReplyDeleteI’ve tested a lot of winter hoodies, and this one stays comfortable for long hours. The oversized silhouette gives great movement. Christmas holiday offers make the Essentials Hoodie more accessible than usual. Grab one before sizes sell out.
ReplyDeleteIf you’re searching for a unique winter scent, you should explore Lattafa perfumy collections. The aromatic blend creates a signature aura that stands out at parties and gatherings. Christmas sales make them even more affordable, so it’s an ideal moment to gift yourself or someone special. Visit the Lattafa Perfumy Holiday Sale for exclusive offers.
ReplyDeleteBardzo ciekawy wpis! Jeśli ktoś szuka wyjątkowego pomysłu na świąteczny podarunek, to ubrania Trapstar są strzałem w dziesiątkę. Marka znana jest z jakości i charakterystycznych projektów, które idealnie wpisują się w klimat zimowych stylówek.
ReplyDeleteIf you love modern streetwear, the Eric Emanuel brand is a must-see. Their basketball shorts are made with a flawless blend of fit, durability, and style. The best part is that the Christmas sale is offering some sweet discounts right now. Eric Emanuel Official Store is worth a visit.
ReplyDeleteWith Christmas Holidays approaching, I’ve been checking out clothing brands that offer both style and affordability, and Asaali seems to fit perfectly. Their unique designs stand out, especially for those wanting something fresh for holiday gatherings.
ReplyDeleteThe Christmas season is all about warm, trendy clothing, and the Pink Palm Puff Store really stands out this year. Their collection feels unique and gives off a premium vibe. I’m planning to grab a few pieces for holiday parties!
ReplyDelete