You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will run first deployment from local machine to create S3 bucket for storing Terraform state. In other words this deployment will create resources needed for storing Terraform state in the cloud and runnign deployment from GitHub actions.
653
658
654
-
```bash
659
+
In `deploy` folder run:
660
+
661
+
```bash
655
662
terraform init
656
663
```
657
664
@@ -788,14 +795,14 @@ jobs:
788
795
```
789
796
790
797
791
-
### Step 8.1 - Add secrets to GitHub
798
+
### Step 10 - Add secrets to GitHub
792
799
793
800
Go to your GitHub repository, then `Settings` -> `Secrets` -> `New repository secret` and add:
794
801
795
802
- `VAULT_AWS_ACCESS_KEY_ID`- your AWS access key
796
803
- `VAULT_AWS_SECRET_ACCESS_KEY`- your AWS secret key
797
-
- `VAULT_SSH_PRIVATE_KEY`- execute `cat ~/.ssh/id_rsa` and paste to GitHub secrets
798
-
- `VAULT_SSH_PUBLIC_KEY`- execute `cat ~/.ssh/id_rsa.pub` and paste to GitHub secrets
804
+
- `VAULT_SSH_PRIVATE_KEY`- execute `cat deploy/.keys/id_rsa` and paste to GitHub secrets
805
+
- `VAULT_SSH_PUBLIC_KEY`- execute `cat deploy/.keys/id_rsa.pub` and paste to GitHub secrets
799
806
- `VAULT_REGISTRY_CA_PEM`- execute `cat deploy/.keys/ca.pem` and paste to GitHub secrets
800
807
- `VAULT_REGISTRY_CA_KEY`- execute `cat deploy/.keys/ca.key` and paste to GitHub secrets
801
808
- `VAULT_ADMINFORTH_SECRET`- generate some random string and paste to GitHub secrets, e.g. `openssl rand -base64 32 | tr -d '\n'`
@@ -832,6 +839,16 @@ Now open GitHub actions file and add it to the `env` section:
832
839
833
840
In the same way you can add any other secrets to your GitHub actions.
834
841
842
+
### How to connect to EC2 instance?
843
+
844
+
To connect to EC2 instance you can use SSH.
845
+
846
+
```bash
847
+
cd deploy
848
+
ssh -i ./.keys/id_rsa ubuntu@<your_ec2_ip>
849
+
```
850
+
851
+
IP address can be found in terminal output after terraform apply.
835
852
836
853
### Out of space on EC2 instance? Extend EBS volume
837
854
@@ -903,14 +920,18 @@ Add this steps to the end of your GitHub actions file:
903
920
run: |
904
921
curl -X POST -H 'Content-type: application/json' --data \
0 commit comments