Skip to content

Commit

Permalink
Commit changes made by code formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and Stephen James committed Jan 17, 2024
1 parent 897ead1 commit 49bef16
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
15 changes: 10 additions & 5 deletions documentation/rds-bastion.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ The bastion doesn't have any service exposed to the public like a "jump box" bas
The routine is

- Enable

- Enable the bastion via an "enable" flag set in AWS SSM Parameter Store to `true`.
- Deploy by running the CI pipeline.
- Create an SSM Session.
- Carry out required procedure

- Configure

- Simple set up to enable assuming a role

- Removal
- Disallow the bastion via an "enable" flag set in AWS SSM Parameter Store to `false`.
- Omit by running the CI pipeline.


## Enable

### Spin up a bastion
Expand All @@ -40,6 +41,7 @@ make aws_describe_instances
```

Then identify the running bastion host

```
i-019174128cf7b4563| t3a.small | None | running | mojo-production-rds-admin-bastion
```
Expand Down Expand Up @@ -80,7 +82,7 @@ then access to the s3 bucket

```
aws s3 ls s3://mojo-file-transfer/ --profile s3-role;
````
```

## Get a DB dump

Expand All @@ -93,16 +95,19 @@ make shell
the issue a terraform command to get the database details

Admin (dhcp & dns)

```shell
terraform output -json terraform_outputs | jq '.admin.db'
```

DHCP

```shell
terraform output -json terraform_outputs | jq '.dhcp.db'
```

Admin (NAC)* note: NAC code used `rds` as module name.
Admin (NAC)\* note: NAC code used `rds` as module name.

```shell
terraform output -json terraform_outputs | jq '.admin.rds'
```
Expand All @@ -113,7 +118,7 @@ To get the password run
./scripts/get_db_parameters.sh
```

## DHCP Database Backup and Restore
## DHCP Database Backup and Restore

In order to connect to the database the following items will be needed.

Expand Down Expand Up @@ -168,7 +173,7 @@ show databases;
### Use the database and see the table names

```sql
mysql>
mysql>
use staffdevicedevelopmentdhcpadmin;
show tables;
```
Expand Down
10 changes: 5 additions & 5 deletions modules/admin/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ output "rds" {
admin_db_id = var.run_restore_from_backup ? element(aws_db_instance.admin_db_restored.*.id, 0) : aws_db_instance.admin_db.id
admin_db_arn = var.run_restore_from_backup ? element(aws_db_instance.admin_db_restored.*.arn, 0) : aws_db_instance.admin_db.arn
rds_monitoring_role = aws_iam_role.rds_monitoring_role.arn
fqdn = aws_route53_record.admin_db.fqdn
endpoint = aws_db_instance.admin_db.endpoint
name = aws_db_instance.admin_db.name
port = aws_db_instance.admin_db.port
username = aws_db_instance.admin_db.username
fqdn = aws_route53_record.admin_db.fqdn
endpoint = aws_db_instance.admin_db.endpoint
name = aws_db_instance.admin_db.name
port = aws_db_instance.admin_db.port
username = aws_db_instance.admin_db.username
}
}

Expand Down

0 comments on commit 49bef16

Please sign in to comment.