Thinking about setting up my infrastructure using an IaC approach. Need some guidance.
Hi Community,
I have a quick query: I'm in the process of setting up some Linode VMs and I'm aiming to configure them within a dedicated VPC.
Initially, I chose Terraform and began setting everything up. However, I discovered that I cannot create a Linode VM within a specific VPC using Terraform. So, I reverted to Ansible, but I couldn't find a solution for the same objective.
Am I overlooking something in the Terraform documentation or in Ansible? How have you guys addressed similar challenges?
Thanks!
1 Reply
✓ Best Answer
Although it doesn't appear that VPC metadata has yet been added to our Linode Ansible Collection, I was able to find VPC arguments detailed in HashiCorp's Linode Library linked below:
- Docs overview - Linode Registry | Terraform Registry
- linode_instance | Terraform Registry
- linode_vpc_subnet | Terraform Registry
Based on the syntax provided in that Terraform guide, you can add VPC interfaces to your Linodes as-such:
interface {
purpose = "vpc"
subnet_id = 123
ipv4 {
vpc = "10.0.4.250"
}
}