Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
Altonhe committed Jun 28, 2024
1 parent 09b2ba4 commit 1aabecc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions modules/aws-ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ resource "local_sensitive_file" "private_key" {
filename = "${path.module}/ssh/id_rsa"
}

# resource "null_resource" "set_permission" {
# depends_on = [local_sensitive_file.private_key]
#
# provisioner "local-exec" {
# command = "chmod 0600 ${local_sensitive_file.private_key.filename}"
# }
# }
# Only use this resource if you are using Linux or MacOS
resource "null_resource" "set_permission" {
depends_on = [local_sensitive_file.private_key]

provisioner "local-exec" {
command = "chmod 0600 ${local_sensitive_file.private_key.filename}"
}
}

resource "local_file" "public_key" {
content = tls_private_key.ssh_key.public_key_openssh
Expand Down
2 changes: 1 addition & 1 deletion modules/aws-ec2/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tofu init
cp .env.example .env
```

6. Modify the `.env` and `variables.tf` file according to your needs. You can modify `DOMAIN` to your own domain, this will be used to generate SSL certificate by [Caddy](https://caddyserver.com/). If you want to configure your own certs instead of automatic HTTPS, you can leave `caddy` blank.
6. Modify the `.env` and `variables.tf` file according to your needs. You can modify `DOMAIN` to your own domain, this will be used to generate SSL certificate by [Caddy](https://caddyserver.com/). If you want to configure your own certs instead of automatic HTTPS, you can leave `caddy` blank, you should also check `main.tf` file to make sure it works with your OS.

7. Deploy the project
```bash
Expand Down

0 comments on commit 1aabecc

Please sign in to comment.