UNCLASSIFIED

Skip to content
Snippets Groups Projects
Commit 1c1960e9 authored by kmc-home's avatar kmc-home
Browse files

update terraform

parent 945c6fa0
No related merge requests found
cd /root/
wget https://releases.hashicorp.com/terraform/1.10.5/terraform_1.10.5_linux_amd64.zip
unzip terraform_1.10.5_linux_amd64.zip
rm terraform_1.10.5_linux_amd64.zip
mv terraform /bin/terraform
unalias terraform
alias terraform='/bin/terraform'
cd /root/woac-infra-demo/ranges/terraform/terraform-test
terraform --version
echo "FOLLOW THE INSTRUCTIONS IN THE terraform.md FILE!!!"
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/terraform-provider-openstack/openstack" {
version = "3.0.0"
constraints = "3.0.0"
hashes = [
"h1:sxq+0vFl4SfV9dlut5liwaH4FejyNIf4ClAjRgowxv8=",
"zh:01718f229597b34ed430236a230a407dacd6289543556d33910e151462e8cb8a",
"zh:2424c5347d35fe0de778d1c40dbe8d9b1278309c4d65cce31709e6fcbec139df",
"zh:2a785f9efd6d8c979031803dd78411a583bc0d9a572ddf5fb9e539cbbfc1ce43",
"zh:8ab18c7eb1fd04b34be75fcecfc461888bd37ff017973f46745abeabd21b3fda",
"zh:98e805318292b58d9692bfe6d3d82e0db0f8044e588a38b239309221198aa92d",
"zh:9a99c9801f96dc69e7c76c5ddc0e2800b77a333becacae530d7a3acd18855347",
"zh:c5aa6690c094be211d2700d7ea44ffe937763e4dd566506c87eb99d6d8330b52",
"zh:d06fc3a148a49aab059a1f08ceadbfe1a5c82c7b80b960169987603dddaaaf58",
"zh:d079da24a9f2cc0d6fec9616e7ebe994245a3d98da629f012069c26d650edb05",
"zh:d1d2b63dba9045a4ff3869c65ddcaf2703d993254b58b2a0230d067f5c036de2",
"zh:d2b9d09c47e7eca08091da825cdf0982dc30089ee401888ce8704b79c7636e95",
"zh:dd6be78f98772bfc1ebf022fc36e5d68ef0f165f9e87476430d4e0dc3f1cc57f",
"zh:e7743c11dd0c83a5c1905f04ffd490b4471941218b4c841b760223fcf416affd",
"zh:f234aefac77f4e9a2b05877a00d322ee165009713d79a8d8e19039c6c6f7cf1b",
]
}
......@@ -7,19 +7,6 @@ terraform {
}
}
provider "openstack" {
# Configuration options
auth_url = "https://vta.cybbh.space:5000"
}
# data "openstack_networking_network_v2" "this" {
# name = "public"
# }
# resource "openstack_networking_router_v2" "external_router" {
# name = "router_${var.prefix}"
# external_network_id = data.openstack_networking_network_v2.this.id
# }
resource "openstack_networking_network_v2" "net" {
name = "net_test"
}
\ No newline at end of file
......@@ -61,13 +61,20 @@ terraform destroy
- State tracks resource relationships
- Destroy removes managed resources
## Terraform Configuration Basics
### Provider Configuration
```hcl
provider "aws" {
region = "us-west-2"
terraform {
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "3.0.0"
}
}
}
```
......@@ -192,40 +199,11 @@ module "web_server" {
## Practice Exercises
### Basic Infrastructure
Create a configuration that:
- Provisions a VPC
- Creates public and private subnets
- Deploys an EC2 instance
- Implements security groups
### Module Development
Create a reusable module for:
- Network infrastructure
- Standard security groups
- Common instance types
- Output relevant information
### Multi-Environment Setup
Implement:
- Workspace-based environments
- Environment-specific variables
- Shared base configuration
- Proper state separation
### Remote State
### Challenge 1
Create a single file terraform representation of our stu-ops.yaml heat template
For resource documentation see [here](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs)
Configure:
- Remote state storage
- State locking
- Access controls
- Backup procedures
### Challenge 2
Remember to document your configurations and use proper variable structures!
\ No newline at end of file
For additional practice (which utilizes docker) follow the tutorial [here](https://developer.hashicorp.com/terraform/tutorials/docker-get-started/infrastructure-as-code)
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment