-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
35 lines (31 loc) · 767 Bytes
/
main.tf
File metadata and controls
35 lines (31 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
terraform {
required_version = ">= 0.14.0"
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 1.35.0"
}
}
}
# Configure the OpenStack Provider
provider "openstack" {
user_name = ${USERNAME_OS}
tenant_name = ${PROJECTNAME_OS}
password = ${PASSWORD_OS}
auth_url = ${URL_OS}
region = "RegionOne"
}
# Create a web server
resource "openstack_compute_instance_v2" "test-server" {
name = "centos-server"
image_id = "092e2045-3df3-45e9-b8fb-189885d17b10"
flavor_id = "84e73156-3adb-4d33-aafb-b6e1988b1baf"
key_pair = "node-david"
security_groups = ["sg01"]
metadata = {
this = "that"
}
network {
name = "net-int0"
}
}