-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added temporarily resources and provider configuration to main.tf to …
…se if it deploys
- Loading branch information
Jon Andre
committed
Feb 11, 2025
1 parent
ee04af9
commit 12581b3
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| terraform { | ||
| required_providers { | ||
| openstack = { | ||
| source = "terraform-provider-openstack/openstack" | ||
| version = "3.0.0" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # Configure the OpenStack Provider | ||
| provider "openstack" { | ||
| cloud = "openstack" | ||
| } | ||
|
|
||
| module "capev2" { | ||
| source = "../modules/capev2" | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Define required providers | ||
| terraform { | ||
| required_providers { | ||
| openstack = { | ||
| source = "terraform-provider-openstack/openstack" | ||
| version = "3.0.0" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # | ||
| resource "openstack_networking_network_v2" "test_network_1" { | ||
| name = "test_network_1" | ||
| admin_state_up = "true" | ||
| } | ||
|
|
||
| resource "openstack_networking_subnet_v2" "test_subnet_1" { | ||
| name = "test_subnet_1" | ||
| network_id = openstack_networking_network_v2.test_network_1.id | ||
| cidr = "192.168.199.0/24" | ||
| ip_version = 4 | ||
| } | ||
|
|
||
| resource "openstack_networking_secgroup_v2" "test_secgroup_1" { | ||
| name = "test_secgroup_1" | ||
| description = "a security group" | ||
| } | ||
|
|
||
| resource "openstack_networking_secgroup_rule_v2" "test_secgroup_rule_1" { | ||
| direction = "ingress" | ||
| ethertype = "IPv4" | ||
| protocol = "tcp" | ||
| port_range_min = 22 | ||
| port_range_max = 22 | ||
| remote_ip_prefix = "0.0.0.0/0" | ||
| security_group_id = openstack_networking_secgroup_v2.test_secgroup_1.id | ||
| } | ||
|
|
||
| resource "openstack_networking_port_v2" "test_port_1" { | ||
| name = "test_port_1" | ||
| network_id = openstack_networking_network_v2.test_network_1.id | ||
| admin_state_up = "true" | ||
| security_group_ids = [openstack_networking_secgroup_v2.test_secgroup_1.id] | ||
|
|
||
| fixed_ip { | ||
| subnet_id = openstack_networking_subnet_v2.test_subnet_1.id | ||
| ip_address = "192.168.199.10" | ||
| } | ||
| } | ||
|
|
||
| resource "openstack_compute_instance_v2" "test_instance_1" { | ||
| name = "test_instance_1" | ||
| image_name = "Ubuntu Server 20.04 LTS (Focal Fossa) amd64" | ||
| flavor_name = "gx3.4c2r" | ||
| security_groups = [openstack_networking_secgroup_v2.test_secgroup_1.name] | ||
|
|
||
| network { | ||
| port = openstack_networking_port_v2.test_port_1.id | ||
| } | ||
| } |
Empty file.