From 7204c84c36c2a988ea2bd91b154f0f7ba94b9320 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 5 Mar 2024 18:33:26 +0100 Subject: [PATCH] Add outputs to timescaledb. --- .../d4s-preprod/timescaledb/outputs.tf | 12 + .../d4s-preprod/timescaledb/terraform.tfstate | 475 +++++++++++++++++- .../timescaledb/timescaledb-outputs.tf | 11 + .../modules/timescaledb/timescaledb.tf | 4 +- 4 files changed, 491 insertions(+), 11 deletions(-) create mode 100644 openstack-tf/d4s-preprod/timescaledb/outputs.tf create mode 100644 openstack-tf/modules/timescaledb/timescaledb-outputs.tf diff --git a/openstack-tf/d4s-preprod/timescaledb/outputs.tf b/openstack-tf/d4s-preprod/timescaledb/outputs.tf new file mode 100644 index 0000000..141add5 --- /dev/null +++ b/openstack-tf/d4s-preprod/timescaledb/outputs.tf @@ -0,0 +1,12 @@ +output "timescaledb_net" { + value = module.timescaledb.timescaledb_net +} + +output "timescaledb_subnet" { + value = module.timescaledb.timescaledb_subnet +} + +output "timescaledb_servers" { + value = module.timescaledb.timescaledb_servers + sensitive = true +} diff --git a/openstack-tf/d4s-preprod/timescaledb/terraform.tfstate b/openstack-tf/d4s-preprod/timescaledb/terraform.tfstate index 8fde847..5e31d9a 100644 --- a/openstack-tf/d4s-preprod/timescaledb/terraform.tfstate +++ b/openstack-tf/d4s-preprod/timescaledb/terraform.tfstate @@ -1,9 +1,465 @@ { "version": 4, "terraform_version": "1.6.6", - "serial": 11, + "serial": 12, "lineage": "a3102b02-5995-18d7-63a6-2b852bd6b8bc", - "outputs": {}, + "outputs": { + "timescaledb_net": { + "value": { + "admin_state_up": true, + "all_tags": [], + "availability_zone_hints": [], + "description": "Network used by the Timescaledb cluster and to access the service", + "dns_domain": "cloud-pre.d4science.org.", + "external": false, + "id": "435ac20a-8bd9-4e49-a86b-69bdfcd6967b", + "mtu": 8942, + "name": "timescaledb-net", + "port_security_enabled": true, + "qos_policy_id": "", + "region": "isti_area_pi_1", + "segments": [], + "shared": false, + "tags": [], + "tenant_id": "6fdc02e2827b405dad99f34698659742", + "timeouts": null, + "transparent_vlan": false, + "value_specs": null + }, + "type": [ + "object", + { + "admin_state_up": "bool", + "all_tags": [ + "set", + "string" + ], + "availability_zone_hints": [ + "set", + "string" + ], + "description": "string", + "dns_domain": "string", + "external": "bool", + "id": "string", + "mtu": "number", + "name": "string", + "port_security_enabled": "bool", + "qos_policy_id": "string", + "region": "string", + "segments": [ + "set", + [ + "object", + { + "network_type": "string", + "physical_network": "string", + "segmentation_id": "number" + } + ] + ], + "shared": "bool", + "tags": [ + "set", + "string" + ], + "tenant_id": "string", + "timeouts": [ + "object", + { + "create": "string", + "delete": "string" + } + ], + "transparent_vlan": "bool", + "value_specs": [ + "map", + "string" + ] + } + ] + }, + "timescaledb_servers": { + "value": [ + { + "access_ip_v4": "10.1.33.181", + "access_ip_v6": "", + "admin_pass": null, + "all_metadata": {}, + "all_tags": [], + "availability_zone": "cnr-isti-nova-a", + "availability_zone_hints": "cnr-isti-nova-a", + "block_device": [ + { + "boot_index": 0, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "image", + "uuid": "54768889-8556-4be4-a2eb-82a4d9b34627", + "volume_size": 10, + "volume_type": "" + }, + { + "boot_index": -1, + "delete_on_termination": false, + "destination_type": "volume", + "device_type": "", + "disk_bus": "", + "guest_format": "", + "multiattach": false, + "source_type": "blank", + "uuid": "", + "volume_size": 30, + "volume_type": "" + } + ], + "config_drive": null, + "created": "2024-02-14 12:36:07 +0000 UTC", + "flavor_id": "4", + "flavor_name": "m1.medium", + "floating_ip": null, + "force_delete": false, + "id": "8d2331b8-0995-45dd-9755-d84b388ab3d4", + "image_id": "Attempt to boot from volume - no image supplied", + "image_name": "Ubuntu-Jammy-22.04", + "key_pair": "adellam", + "metadata": null, + "name": "timescaledb-01", + "network": [ + { + "access_network": false, + "fixed_ip_v4": "10.1.33.181", + "fixed_ip_v6": "", + "floating_ip": "", + "mac": "fa:16:3e:af:a7:22", + "name": "d4s-pre-cloud-main", + "port": "", + "uuid": "23fd8a99-d551-4ada-8d3a-9859542ebb8c" + }, + { + "access_network": false, + "fixed_ip_v4": "192.168.11.5", + "fixed_ip_v6": "", + "floating_ip": "", + "mac": "fa:16:3e:b5:65:23", + "name": "timescaledb-net", + "port": "", + "uuid": "435ac20a-8bd9-4e49-a86b-69bdfcd6967b" + } + ], + "network_mode": null, + "personality": [], + "power_state": "active", + "region": "isti_area_pi_1", + "scheduler_hints": [ + { + "additional_properties": {}, + "build_near_host_ip": "", + "different_cell": [], + "different_host": [], + "group": "84ce7a5c-ce77-43a6-8c49-39d61484e82e", + "query": [], + "same_host": [], + "target_cell": "" + } + ], + "security_groups": [ + "access_to_the_timescaledb_service", + "default_for_all", + "timescaledb_temporary" + ], + "stop_before_destroy": false, + "tags": [], + "timeouts": null, + "updated": "2024-02-29 16:53:56 +0000 UTC", + "user_data": "bb83b25fd1219aa1b850ece9be8d7b0f31714608", + "vendor_options": [], + "volume": [] + } + ], + "type": [ + "tuple", + [ + [ + "object", + { + "access_ip_v4": "string", + "access_ip_v6": "string", + "admin_pass": "string", + "all_metadata": [ + "map", + "string" + ], + "all_tags": [ + "set", + "string" + ], + "availability_zone": "string", + "availability_zone_hints": "string", + "block_device": [ + "list", + [ + "object", + { + "boot_index": "number", + "delete_on_termination": "bool", + "destination_type": "string", + "device_type": "string", + "disk_bus": "string", + "guest_format": "string", + "multiattach": "bool", + "source_type": "string", + "uuid": "string", + "volume_size": "number", + "volume_type": "string" + } + ] + ], + "config_drive": "bool", + "created": "string", + "flavor_id": "string", + "flavor_name": "string", + "floating_ip": "string", + "force_delete": "bool", + "id": "string", + "image_id": "string", + "image_name": "string", + "key_pair": "string", + "metadata": [ + "map", + "string" + ], + "name": "string", + "network": [ + "list", + [ + "object", + { + "access_network": "bool", + "fixed_ip_v4": "string", + "fixed_ip_v6": "string", + "floating_ip": "string", + "mac": "string", + "name": "string", + "port": "string", + "uuid": "string" + } + ] + ], + "network_mode": "string", + "personality": [ + "set", + [ + "object", + { + "content": "string", + "file": "string" + } + ] + ], + "power_state": "string", + "region": "string", + "scheduler_hints": [ + "set", + [ + "object", + { + "additional_properties": [ + "map", + "string" + ], + "build_near_host_ip": "string", + "different_cell": [ + "list", + "string" + ], + "different_host": [ + "list", + "string" + ], + "group": "string", + "query": [ + "list", + "string" + ], + "same_host": [ + "list", + "string" + ], + "target_cell": "string" + } + ] + ], + "security_groups": [ + "set", + "string" + ], + "stop_before_destroy": "bool", + "tags": [ + "set", + "string" + ], + "timeouts": [ + "object", + { + "create": "string", + "delete": "string", + "update": "string" + } + ], + "updated": "string", + "user_data": "string", + "vendor_options": [ + "set", + [ + "object", + { + "detach_ports_before_destroy": "bool", + "ignore_resize_confirmation": "bool" + } + ] + ], + "volume": [ + "set", + [ + "object", + { + "device": "string", + "id": "string", + "volume_id": "string" + } + ] + ] + } + ] + ] + ], + "sensitive": true + }, + "timescaledb_subnet": { + "value": { + "all_tags": [], + "allocation_pool": [ + { + "end": "192.168.11.254", + "start": "192.168.11.20" + } + ], + "allocation_pools": [ + { + "end": "192.168.11.254", + "start": "192.168.11.20" + } + ], + "cidr": "192.168.11.0/24", + "description": "subnet used to connect to the shared TimeScaleDB service", + "dns_nameservers": [ + "146.48.29.97", + "146.48.29.98", + "146.48.29.99" + ], + "enable_dhcp": true, + "gateway_ip": "", + "host_routes": [], + "id": "cba5700b-db7f-4764-9fc9-5132367608fa", + "ip_version": 4, + "ipv6_address_mode": "", + "ipv6_ra_mode": "", + "name": "timescaledb-subnet", + "network_id": "435ac20a-8bd9-4e49-a86b-69bdfcd6967b", + "no_gateway": true, + "prefix_length": null, + "region": "isti_area_pi_1", + "service_types": [], + "subnetpool_id": "", + "tags": [], + "tenant_id": "6fdc02e2827b405dad99f34698659742", + "timeouts": null, + "value_specs": null + }, + "type": [ + "object", + { + "all_tags": [ + "set", + "string" + ], + "allocation_pool": [ + "set", + [ + "object", + { + "end": "string", + "start": "string" + } + ] + ], + "allocation_pools": [ + "list", + [ + "object", + { + "end": "string", + "start": "string" + } + ] + ], + "cidr": "string", + "description": "string", + "dns_nameservers": [ + "list", + "string" + ], + "enable_dhcp": "bool", + "gateway_ip": "string", + "host_routes": [ + "list", + [ + "object", + { + "destination_cidr": "string", + "next_hop": "string" + } + ] + ], + "id": "string", + "ip_version": "number", + "ipv6_address_mode": "string", + "ipv6_ra_mode": "string", + "name": "string", + "network_id": "string", + "no_gateway": "bool", + "prefix_length": "number", + "region": "string", + "service_types": [ + "list", + "string" + ], + "subnetpool_id": "string", + "tags": [ + "set", + "string" + ], + "tenant_id": "string", + "timeouts": [ + "object", + { + "create": "string", + "delete": "string" + } + ], + "value_specs": [ + "map", + "string" + ] + } + ] + } + }, "resources": [ { "mode": "data", @@ -876,7 +1332,7 @@ "region": "isti_area_pi_1", "scheduler_hints": [ { - "additional_properties": null, + "additional_properties": {}, "build_near_host_ip": "", "different_cell": [], "different_host": [], @@ -888,12 +1344,13 @@ ], "security_groups": [ "access_to_the_timescaledb_service", - "default_for_all" + "default_for_all", + "timescaledb_temporary" ], "stop_before_destroy": false, - "tags": null, + "tags": [], "timeouts": null, - "updated": "2024-02-14 12:37:04 +0000 UTC", + "updated": "2024-02-29 16:53:56 +0000 UTC", "user_data": "bb83b25fd1219aa1b850ece9be8d7b0f31714608", "vendor_options": [], "volume": [] @@ -921,7 +1378,9 @@ "schema_version": 0, "attributes": { "id": "84ce7a5c-ce77-43a6-8c49-39d61484e82e", - "members": [], + "members": [ + "8d2331b8-0995-45dd-9755-d84b388ab3d4" + ], "name": "timescaledb_cluster", "policies": [ "soft-anti-affinity" @@ -1025,7 +1484,7 @@ "id": "fe63c906-7035-45a4-b0ed-3b4852c0c1ba", "name": "access_to_the_timescaledb_service", "region": "isti_area_pi_1", - "tags": null, + "tags": [], "tenant_id": "6fdc02e2827b405dad99f34698659742", "timeouts": null }, diff --git a/openstack-tf/modules/timescaledb/timescaledb-outputs.tf b/openstack-tf/modules/timescaledb/timescaledb-outputs.tf new file mode 100644 index 0000000..1e52729 --- /dev/null +++ b/openstack-tf/modules/timescaledb/timescaledb-outputs.tf @@ -0,0 +1,11 @@ +output "timescaledb_net" { + value = openstack_networking_network_v2.timescaledb_net +} + +output "timescaledb_subnet" { + value = openstack_networking_subnet_v2.timescaledb_subnet +} + +output "timescaledb_servers" { + value = openstack_compute_instance_v2.timescaledb_server +} diff --git a/openstack-tf/modules/timescaledb/timescaledb.tf b/openstack-tf/modules/timescaledb/timescaledb.tf index a1a9ea9..4ba7ae9 100644 --- a/openstack-tf/modules/timescaledb/timescaledb.tf +++ b/openstack-tf/modules/timescaledb/timescaledb.tf @@ -60,7 +60,7 @@ resource "openstack_compute_instance_v2" "timescaledb_server" { image_name = module.common_variables.ubuntu_2204.name flavor_name = var.timescaledb_node_flavor key_pair = module.ssh_settings.ssh_key_name - security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, openstack_networking_secgroup_v2.timescaledb_access.name] + security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, openstack_networking_secgroup_v2.timescaledb_access.name,"timescaledb_temporary"] scheduler_hints { group = openstack_compute_servergroup_v2.timescaledb_cluster.id } @@ -100,5 +100,3 @@ resource "openstack_compute_instance_v2" "timescaledb_server" { ] } } - -