Skip to content

Commit e00072b

Browse files
DmitryFomin1NikolayS
authored andcommitted
improve TF module output
1 parent 47e198f commit e00072b

File tree

3 files changed

+58
-13
lines changed

3 files changed

+58
-13
lines changed

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,25 @@ The following steps were tested on Ubuntu 20.04 but supposed to be valid for oth
103103
```
104104
1. If everything goes well, you should get an output like this:
105105
```config
106-
vcs_db_migration_checker_verification_token = "gsio7KmgaxECfJ80kUx2tUeIf4kEXZex"
107-
dle_verification_token = "zXPodd13LyQaKgVXGmSCeB8TUtnGNnIa"
108-
ec2_public_dns = "ec2-18-118-126-25.us-east-2.compute.amazonaws.com"
109-
ec2instance = "i-0b07738148950af25"
110-
ip = "18.118.126.25"
111-
platform_joe_signing_secret = "lG23qZbUh2kq0ULIBfW6TRwKzqGZu1aP"
112-
public_dns_name = "demo-api-engine.aws.postgres.ai" # todo: this should be URL, not hostname – further we'll need URL, with protocol – `https://`
113-
```
106+
107+
#####################################################################
108+
109+
Congratulations! Database Lab Engine installed.
110+
Data initialization may take time, depending on the database size.
111+
112+
You should be able to work with all DLE interfaces already:
113+
- [RECOMMENDED] UI: https://tf-test.aws.postgres.ai:446
114+
- CLI: dblab init --url=https://tf-test.aws.postgres.ai --token=sDTPu17pzXhW9DkhcSGpAMj72KgiIJxG --environment="i-0687b060f45314be5" --insecure
115+
- API: https://tf-test.aws.postgres.ai
116+
- SSH connection for troubleshooting: ssh ubuntu@3.92.133.178 -i dmitry-DBLABserver-ec2instance.pem
117+
118+
(Use verification token: sDTPu17pzXhW9DkhcSGpAMj72KgiIJxG
119+
120+
For support, go to https://postgres.ai/contact.
121+
122+
#####################################################################
123+
124+
```
114125
115126
1. To verify result and check the progress, you might want to connect to the just-created EC2 machine using IP address or hostname from the Terraform output and ssh key from ssh_public_keys_files_list and/or ssh_public_keys_list variables. In our example, it can be done using this one-liner (you can find more about DLE logs and configuration on this page: https://postgres.ai/docs/how-to-guides/administration/engine-manage):
116127
```shell

dle-logical-init.sh.tpl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ case "${source_type}" in
190190

191191
esac
192192

193+
# Fix ownership of the dblab directory
194+
chown -R ubuntu.ubuntu /home/ubuntu/.dblab/
195+
193196
sudo docker run \
194197
--name dblab_server \
195198
--label dblab_control \
@@ -214,11 +217,14 @@ done
214217

215218
curl https://gitlab.com/postgres-ai/database-lab/-/raw/${dle_version}/scripts/cli_install.sh | bash
216219
sudo mv ~/.dblab/dblab /usr/local/bin/dblab
217-
dblab init \
218-
--environment-id=tutorial \
219-
--url=http://localhost:2345 \
220-
--token=${dle_verification_token} \
221-
--insecure
220+
221+
# Init dblab environment
222+
su - ubuntu -c \
223+
'dblab init \
224+
--environment-id=tutorial \
225+
--url=http://localhost:2345 \
226+
--token=${dle_verification_token} \
227+
--insecure'
222228

223229
# Configure and run Joe Bot container.
224230
joe_config_path="/home/ubuntu/.dblab/joe/configs"
@@ -276,3 +282,4 @@ sudo docker run \
276282
--volume /tmp/ci_checker:/tmp/ci_checker \
277283
--volume $ci_checker_config_path:/home/dblab/configs:ro \
278284
registry.gitlab.com/postgres-ai/database-lab/dblab-ci-checker:${dle_version}
285+

outputs.tf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,30 @@ output "vcs_db_migration_checker_registration_url" {
2828
output "local_ui_url" {
2929
value = "${format("%s://%s:%s", "https",join("", aws_route53_record.dblab_subdomain.*.fqdn),"446")}"
3030
}
31+
32+
locals {
33+
welcome_message = <<EOT
34+
35+
36+
#####################################################################
37+
38+
Congratulations! Database Lab Engine installed.
39+
Data initialization may take time, depending on the database size.
40+
41+
You should be able to work with all DLE interfaces already:
42+
- [RECOMMENDED] UI: ${format("%s://%s:%s", "https",join("", aws_route53_record.dblab_subdomain.*.fqdn),"446")}
43+
- CLI: dblab init --url=${format("%s://%s", "https",join("", aws_route53_record.dblab_subdomain.*.fqdn))} --token=${random_string.dle_verification_token.result} --environment="${aws_instance.aws_ec2.id}" --insecure
44+
- API: ${format("%s://%s", "https",join("", aws_route53_record.dblab_subdomain.*.fqdn))}
45+
- SSH connection for troubleshooting: ssh ubuntu@${aws_instance.aws_ec2.public_ip} -i ${var.aws_deploy_ec2_instance_tag_name}.pem
46+
47+
(Use verification token: ${random_string.dle_verification_token.result}
48+
49+
For support, go to https://postgres.ai/contact.
50+
51+
#####################################################################
52+
53+
EOT
54+
}
55+
output "zzz_next_steps" {
56+
value = local.welcome_message
57+
}

0 commit comments

Comments
 (0)