Skip to content

Commit 3c806eb

Browse files
committed
Merge branch 'switch_to_s3_source_in_example' into 'master'
switch to S3 as a source for DLE in example, change welcome message output and some cleanup See merge request postgres-ai/terraform-postgres-ai-database-lab!50
2 parents 3e1f537 + 6f95e41 commit 3c806eb

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The following steps were tested on Ubuntu 20.04 but supposed to be valid for oth
9999
```
100100
1. Deploy:
101101
```
102-
terraform apply -var-file="secret.tfvars" -auto-approve
102+
terraform apply -var-file="secret.tfvars" -auto-approve && terraform output -raw next_steps
103103
```
104104
1. If everything goes well, you should get an output like this:
105105
```config
@@ -186,7 +186,7 @@ The following steps were tested on Ubuntu 20.04 but supposed to be valid for oth
186186
187187
This is it!
188188
189-
If you need to remove everything created by this Terraform module, you can simply run `terraform destroy`. Do not forget to do it if you're just experimenting. Otherwise, if you leave infrastructure blocks running, they might significantly affect your AWS bill (depending on the EC2 instance family you've chosen, the disk type, and size).
189+
If you need to remove everything created by this Terraform module, you can run `terraform destroy -var-file="secret.tfvars" -auto-approve`. Do not forget to do it if you're just experimenting. Otherwise, if you leave infrastructure blocks running, they might significantly affect your AWS bill (depending on the EC2 instance family you've chosen, the disk type, and size).
190190
191191
## Important Note
192192
When the DLE creates new database clones, it makes them available on incremental ports in the 6000 range (e.g. 6000, 6001, ...). The DLE CLI will also report that the clone is available on a port in the 6000 range. However, please note that these are the ports when accessing the DLE from `localhost`. This Terraform module deploys [Envoy](https://www.envoyproxy.io/) to handle SSL termination and port forwarding to connect to DLE generated clones.

Diff for: instance.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
locals {
2-
public_key = file("~/.ssh/id_rsa.pub")
3-
}
4-
51
resource "tls_private_key" "ssh_key" {
62
algorithm = "RSA"
73
rsa_bits = 4096

Diff for: outputs.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ locals {
5252
5353
EOT
5454
}
55-
output "zzz_next_steps" {
55+
output "next_steps" {
5656
value = local.welcome_message
57+
sensitive = true
5758
}

Diff for: terraform.tfvars

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ aws_deploy_allow_ssh_from_cidrs = ["0.0.0.0/0"]
1414
aws_deploy_dns_api_subdomain = "tf-test" # subdomain in aws.postgres.ai, fqdn will be ${dns_api_subdomain}.aws.postgres.ai
1515

1616
source_postgres_version = "13"
17-
source_postgres_host = "ec2-3-215-57-87.compute-1.amazonaws.com"
18-
source_postgres_port = "5432"
19-
source_postgres_dbname = "d3dljqkrnopdvg" # this is an existing DB (Heroku example DB)
20-
source_postgres_username = "bfxuriuhcfpftt" # in secret.tfvars, use: source_postgres_password = "dfe01cbd809a71efbaecafec5311a36b439460ace161627e5973e278dfe960b7"
2117

2218
dle_debug_mode = "true"
2319
dle_retrieval_refresh_timetable = "0 0 * * 0"
2420
postgres_config_shared_preload_libraries = "pg_stat_statements,logerrors" # DB Migration Checker requires logerrors extension
2521

2622
platform_project_name = "aws_test_tf"
2723

24+
source_type = "s3" # source is dump stored on demo s3 bucket
25+
source_pgdump_s3_bucket = "tf-demo-dump" # This is an example public bucket
26+
source_pgdump_path_on_s3_bucket = "heroku_sql.sql" # This is an example dump from demo database
27+
2828
# Edit this list to have all public keys that will be placed to
2929
# have them placed to authorized_keys. Instead of ssh_public_keys_files_list,
3030
# it is possible to use ssh_public_keys_list containing public keys as text values.

Diff for: variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ variable "source_postgres_port" {
9999

100100
variable "source_postgres_username" {
101101
description = "Source database username"
102-
sensitive = true
102+
default = "postgres"
103103
}
104104

105105
variable "source_postgres_password" {

0 commit comments

Comments
 (0)