Skip to content

Commit 5a84c37

Browse files
authored
Feature/Configure custom domain (#12)
* Add CNAME for custom domain * Add mkdocs.yml in file explorer * CNAME in right folder (docs) * Add CNAME in solution explorer * Update quickstart
1 parent a326c2e commit 5a84c37

File tree

4 files changed

+54
-45
lines changed

4 files changed

+54
-45
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Inspired by https://github.com/dotnet/roslyn/blob/master/.editorconfig
1+
# Inspired by https://github.com/dotnet/roslyn/blob/master/.editorconfig
22

33
root = true
44

@@ -149,3 +149,6 @@ csharp_space_between_square_brackets = false
149149
csharp_prefer_braces = true:silent
150150
csharp_preserve_single_line_blocks = true
151151
csharp_preserve_single_line_statements = true
152+
153+
[CNAME]
154+
insert_final_newline = false

TerraformBackend.sln

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0 - Solution Items", "0 - S
88
.editorconfig = .editorconfig
99
.gitignore = .gitignore
1010
.gitlab-ci.yml = .gitlab-ci.yml
11-
compose.yaml = compose.yaml
1211
compose.override.yaml = compose.override.yaml
12+
compose.yaml = compose.yaml
1313
CONTRIBUTING.md = CONTRIBUTING.md
1414
Directory.Build.props = Directory.Build.props
1515
README.md = README.md
@@ -59,7 +59,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "local-files", "local-files"
5959
EndProject
6060
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{FF437226-25A3-491B-B433-F4760EC45D25}"
6161
ProjectSection(SolutionItems) = preProject
62+
docs\CNAME = docs\CNAME
6263
docs\index.md = docs\index.md
64+
mkdocs.yml = mkdocs.yml
6365
docs\project.md = docs\project.md
6466
docs\quickstart.md = docs\quickstart.md
6567
docs\setup.md = docs\setup.md

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tfbackend-mongodb.devpro.fr

docs/quickstart.md

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
# Quickstart
22

3-
Let's do a quick demonstration of the application.
3+
## Demo
44

5-
## Make sure requirements are met
6-
7-
[Terraform](https://developer.hashicorp.com/terraform/install), or [OpenTofu](https://opentofu.org/docs/intro/install/), must be available from the command line.
8-
9-
## Run the application and the database in containers
10-
11-
=== "Docker"
12-
13-
```bash
14-
curl -O https://raw.githubusercontent.com/devpro/terraform-backend-mongodb/refs/heads/main/compose.yaml
15-
docker compose up
16-
```
5+
This is the exhaustive list of steps to use Terraform Backend MongoDB.
176

187
<!--
198
TODO: add other options
@@ -28,52 +17,66 @@ TODO: add other options
2817
2918
```bash
3019
helm upgrade --install tfbackend \
31-
https://github.com/devpro/helm-charts/releases/download/terraform-backend-mongodb-0.1.0/terraform-backend-mongodb-0.1.0.tgz \
32-
--create-namespace --namespace tfbackend
20+
https://github.com/devpro/helm-charts/releases/download/terraform-backend-mongodb-0.1.0/terraform-backend-mongodb-0.1.0.tgz \
21+
--create-namespace --namespace tfbackend
3322
```
34-
3523
-->
3624

37-
## Create a user to authenticate calls
25+
1. Make sure requirements are met:
3826

39-
=== "Docker"
27+
- [Terraform](https://developer.hashicorp.com/terraform/install), or [OpenTofu](https://opentofu.org/docs/intro/install/), must be available from the command line.
4028

41-
```bash
42-
curl -O https://raw.githubusercontent.com/devpro/terraform-backend-mongodb/refs/heads/main/scripts/tfbeadm
43-
MONGODB_CONTAINERNAME=tfbackmdb-mongodb-1 MONGODB_CONTAINERNETWORK=tfbackmdb_default tfbeadm create-user admin admin123 dummy
44-
```
29+
2. Run the application and the database in containers
4530

46-
## Create Terraform files
31+
=== "Docker"
4732

48-
=== "Docker"
33+
```bash
34+
curl -O https://raw.githubusercontent.com/devpro/terraform-backend-mongodb/refs/heads/main/compose.yaml
35+
docker compose up
36+
```
4937

50-
```bash
51-
curl -O https://raw.githubusercontent.com/devpro/terraform-backend-mongodb/refs/heads/main/samples/local-files/main.tf
52-
```
38+
39+
40+
3. Create a user to authenticate calls
41+
42+
=== "Docker"
5343

54-
## Initiatize Terraform
44+
```bash
45+
curl -O https://raw.githubusercontent.com/devpro/terraform-backend-mongodb/refs/heads/main/scripts/tfbeadm
46+
MONGODB_CONTAINERNAME=tfbackmdb-mongodb-1 MONGODB_CONTAINERNETWORK=tfbackmdb_default tfbeadm create-user admin admin123 dummy
47+
```
5548

56-
```bash
57-
terraform init
58-
```
49+
4. Update Terraform backend (copy of an already configured simple sample)
5950

60-
## Create the resources
51+
=== "Docker"
6152

62-
```bash
63-
terraform apply
64-
```
53+
```bash
54+
curl -O https://raw.githubusercontent.com/devpro/terraform-backend-mongodb/refs/heads/main/samples/local-files/main.tf
55+
```
6556

66-
## Query the state database
57+
5. Initiatize Terraform
58+
59+
```bash
60+
terraform init
61+
```
6762

68-
=== "Docker"
63+
6. Apply changes
6964

7065
```bash
71-
docker run --rm --link "tfbackmdb-mongodb-1" --network "tfbackmdb_default" "mongo:8.2" \
72-
bash -c "mongosh \"mongodb://mongodb:27017/terraform_backend_dev\" --eval 'db.tf_state.find().projection({tenant: 1, name: 1, createdAt: 1, \"value.version\": 1, \"value.resources.type\": 1, \"value.resources.name\": 1})'"
66+
terraform apply
7367
```
7468

75-
## Destroy the resources
69+
7. Query the state database
7670

77-
```bash
78-
terraform destroy
79-
```
71+
=== "Docker"
72+
73+
```bash
74+
docker run --rm --link "tfbackmdb-mongodb-1" --network "tfbackmdb_default" "mongo:8.2" \
75+
bash -c "mongosh \"mongodb://mongodb:27017/terraform_backend_dev\" --eval 'db.tf_state.find().projection({tenant: 1, name: 1, createdAt: 1, \"value.version\": 1, \"value.resources.type\": 1, \"value.resources.name\": 1})'"
76+
```
77+
78+
8. Destroy the resources
79+
80+
```bash
81+
terraform destroy
82+
```

0 commit comments

Comments
 (0)