Skip to content

Commit f955882

Browse files
Merge pull request #1121 from NHSDigital/NRL-1841-refresh-account-wide-infra
NRL-1841 terraform should create different volume pointer tables
2 parents 018658d + 16cf8da commit f955882

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

terraform/account-wide-infrastructure/test/dynamodb__pointers-table.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ module "ref-pointers-table" {
3232
}
3333

3434
module "perftest-pointers-table" {
35+
source = "../modules/pointers-table"
36+
name_prefix = "nhsd-nrlf--perftest"
37+
}
38+
39+
module "perftest-pointers-baseline-table" {
3540
source = "../modules/pointers-table"
3641
name_prefix = "nhsd-nrlf--perftest-baseline"
3742
}
43+
44+
module "perftest-pointers-15m-table" {
45+
source = "../modules/pointers-table"
46+
name_prefix = "nhsd-nrlf--perftest-15m"
47+
}
48+
49+
module "perftest-pointers-55m-table" {
50+
source = "../modules/pointers-table"
51+
name_prefix = "nhsd-nrlf--perftest-55m"
52+
}

terraform/bastion/README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Before deploying a bastion, you will need:
88

99
- An AWS account that has already been bootstrapped, as described in [bootstrap/README.md](../bootstrap/README.md) and has the account-wide infrastructure deployed as described in [account-wide-infrastructure/README.md](../account-wide-infrastructure/README.md). This is a one-time account setup step.
1010
- Your CLI configured to allow authentication to your AWS account
11+
- Install the [Session Manager plugin](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
1112

1213
## Deploying a bastion
1314

@@ -17,39 +18,41 @@ To deploy a bastion, you will first need to login to the AWS mgmt account on the
1718

1819
Then, initialise the Terraform workspace with:
1920

20-
```
21+
```sh
22+
assume nhsd-nrlf-mgmt
2123
terraform init
2224
```
2325

2426
If you want a read-only bastion (can only READ from the pointers table), plan the deployment like this:
2527

26-
```
28+
```sh
2729
make plan-ro
2830
```
2931

3032
If you want a read-write bastion (can READ and WRITE from the pointers table), plan the deployment like this:
3133

32-
```
34+
```sh
3335
make plan-rw
3436
```
3537

3638
Once you're happy with your planned changes, you can apply them with:
3739

38-
```
40+
```sh
3941
terraform apply ./bastion.tfplan
4042
```
4143

4244
## Using the bastion
4345

4446
Once the bastion is deployed, you can connect to it via SSH with:
4547

46-
```
47-
make ssh-connection
48+
```sh
49+
assume nhsd-nrlf-test
50+
make ssh-connection ENV={env}
4851
```
4952

5053
Once connected successfully, you will be at the SSM `$` prompt. To switch to the `nrlf_ops` user, run this command:
5154

52-
```
55+
```sh
5356
sudo su - nrlf_ops
5457
```
5558

@@ -68,7 +71,7 @@ see [user-data.sh](./scripts/user-data.sh) for exactly what's installed on there
6871

6972
If you're running the `make ssh-connection` and are seeing this error:
7073

71-
```
74+
```sh
7275
$ make ssh-connection
7376
....
7477
An error occurred (TargetNotConnected) when calling the StartSession operation: i-06ff25164f004bee4 is not connected.
@@ -78,21 +81,23 @@ $
7881

7982
If you've just created a new bastion, it may be that it hasn't started yet. Log in to the AWS console to see the state of the EC2 instance. Press the "Connect" button in the console and choose the SSM tab to see if things are working ok.
8083

84+
If there is a warning in the Session Manager tab "SSM Agent is not online" when you attempt to connect then it's likely the SSM agent has crashed. Reboot the EC2 instance and the SSM agent should start up with previous cli history preserved. To reboot via the CLI, find your EC2 instance > Instance state > Reboot instance. Beware: rebooting the EC2 instance will terminate any ongoing processes.
85+
8186
If the EC2 instance is running and the console looks ok, check you have defined the correct ENV param for the installed bastion.
8287

8388
#### The `nrlf_ops` using is missing
8489

8590
If you're getting this error:
8691

87-
```
92+
```sh
8893
$ sudo su - nrlf_ops
8994
su: user some_other does not exist or the user entry does not contain all the required fields
9095
$
9196
```
9297

9398
If you've just created a new bastion, you may need to wait a little until the cloud-init script has finished. You can check the status of this process with:
9499

95-
```
100+
```sh
96101
sudo tail -f /var/log/cloud-init-output.log
97102
```
98103

@@ -102,7 +107,7 @@ If you're trying to access an AWS resource from the bastion and are getting an a
102107

103108
You can check the role in the AWS console to work out if things are missing and can edit it there too for immediate access to the resources you need.
104109

105-
If you want to permenantly grant new access to the bastion, you can add a policy and attach it to the EC2 instance in [iam.tf](iam.tf)
110+
If you want to permanently grant new access to the bastion, you can add a policy and attach it to the EC2 instance in [iam.tf](iam.tf)
106111

107112
#### A tool I need is missing
108113

0 commit comments

Comments
 (0)