Skip to content

Commit c16d634

Browse files
committed
fixes in doc
1 parent 735b799 commit c16d634

File tree

2 files changed

+11
-5
lines changed
  • adminforth/documentation/blog

2 files changed

+11
-5
lines changed

adminforth/documentation/blog/2024-10-01-ai-blog/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ Now you can open `http://localhost` in your browser and see your blog.
983983
### Deploy to EC2 with terraform
984984

985985

986-
First of all install Terraform as described here [https://developer.hashicorp.com/terraform/install#linux](terraform installation).
986+
First of all install Terraform as described here [terraform installation](https://developer.hashicorp.com/terraform/install#linux).
987987

988988
If you are on Ubuntu(WSL2 or native) you can use the following commands:
989989

adminforth/documentation/blog/2024-11-14-compose-ec2-deployment-ci/index.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ tfplan
9191
## Step 5 - Main terraform file main.tf
9292

9393

94+
95+
First of all install Terraform as described here [terraform installation](https://developer.hashicorp.com/terraform/install#linux).
96+
97+
9498
Create file `main.tf` in `deploy` folder:
9599

96100
```hcl title="deploy/main.tf"
@@ -122,7 +126,7 @@ data "aws_vpc" "default" {
122126
123127
124128
resource "aws_eip" "eip" {
125-
vpc = true
129+
domain = "vpc"
126130
}
127131
resource "aws_eip_association" "eip_assoc" {
128132
instance_id = aws_instance.app_instance.id
@@ -189,7 +193,7 @@ resource "aws_instance" "app_instance" {
189193
key_name = aws_key_pair.app_deployer.key_name
190194
191195
root_block_device {
192-
volume_size = 40 // Size in GB for root partition
196+
volume_size = 20 // Size in GB for root partition
193197
volume_type = "gp2"
194198
}
195199
@@ -238,8 +242,6 @@ resource "null_resource" "sync_files_and_run" {
238242
--exclude '.vscode' \
239243
--exclude '.env' \
240244
--exclude 'db' \
241-
--exclude 'up-human/debug' \
242-
--exclude 'up-human/storage' \
243245
../ ubuntu@${aws_eip_association.eip_assoc.public_ip}:/home/ubuntu/app/
244246
EOF
245247
}
@@ -375,6 +377,7 @@ terraform {
375377
region = "eu-central-1"
376378
profile = "myaws"
377379
dynamodb_table = "<your_app_name>-terraform-lock-table"
380+
use_lockfile = true
378381
}
379382
}
380383
```
@@ -395,6 +398,9 @@ Now run test deployment:
395398
terraform apply -auto-approve
396399
```
397400

401+
Now you can delete local `terraform.tfstate` file and `terraform.tfstate.backup` file as they are in the cloud now.
402+
403+
398404
## Step 7 - CI/CD - Github Actions
399405

400406
Create file `.github/workflows/deploy.yml`:

0 commit comments

Comments
 (0)