Skip to content

Commit 208e1fa

Browse files
committed
Updates and improvements
1 parent 59dbee4 commit 208e1fa

4 files changed

Lines changed: 12 additions & 16 deletions

File tree

Makefile

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,15 @@ config:: # Configure development environment (main) @Configuration
5353
#### Proxygen ####
5454
##################
5555

56-
# Proxygen key only exists in our 'dev' AWS Parameter Store
57-
PROXYGEN_ENV ?= dev
58-
59-
# Specs are published in the APIM 'prod' environment
60-
APIM_ENV ?= prod
61-
6256
# Verify current AWS account login and retrieve the proxygen key
6357
# from AWS SSM Parameter Store
64-
retrieve-proxygen-key:
65-
@ ./scripts/check-aws-account.sh $(PROXYGEN_ENV)
58+
retrieve-proxygen-key: guard-ENV
59+
@ ./scripts/check-aws-account.sh
6660
mkdir -p ~/.proxygen
67-
aws ssm get-parameter --name /$$PROXYGEN_ENV/proxygen/private_key --with-decryption \
61+
aws ssm get-parameter --name /$$ENV/proxygen/private_key --with-decryption \
6862
| jq -r ".Parameter.Value" \
69-
> ~/.proxygen/eligibility-signposting-api-$(APIM_ENV).pem && \
70-
echo "Retrieved proxygen key for APIM '$(APIM_ENV)' environment"
63+
> ~/.proxygen/eligibility-signposting-api-$(ENV).pem && \
64+
echo "Retrieved proxygen key for APIM '$(ENV)' environment"
7165

7266
# Copy proxygen credentials for the specified environment to `~/.proxygen/`
7367
# This location required location for local proxygen usage

scripts/check-aws-account.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
#!/usr/bin/env bash
33
set -e
44

5-
APIM_ENV_NAME="$1"
6-
7-
# Expected AWS account for dev environment
5+
# Expected AWS account details for dev environment
6+
EXPECTED_ENV_NAME="dev"
87
EXPECTED_ACCOUNT="448049830832"
98

109
# Read the currently authenticated AWS account
@@ -13,10 +12,10 @@ CURRENT_ACCOUNT=$(aws sts get-caller-identity --query "Account" --output text)
1312
# Compare the current account with the expected account
1413
if [ "$CURRENT_ACCOUNT" != "$EXPECTED_ACCOUNT" ]; then
1514
echo "AWS account mismatch!"
16-
echo "The expected login is AWS '$APIM_ENV_NAME' account $EXPECTED_ACCOUNT, but the current logged in AWS account is $CURRENT_ACCOUNT."
15+
echo "The expected login is AWS '$EXPECTED_ENV_NAME' account $EXPECTED_ACCOUNT, but the current logged in AWS account is $CURRENT_ACCOUNT."
1716
echo "Please switch to the correct AWS account and try again."
1817
echo "Exiting script..."
1918
exit 1
2019
fi
2120

22-
echo "Active login to AWS '$APIM_ENV_NAME' account $CURRENT_ACCOUNT verified."
21+
echo "Active login to AWS '$EXPECTED_ENV_NAME' account $CURRENT_ACCOUNT verified."
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
client_id: eligibility-signposting-api-client
22
private_key_path: eligibility-signposting-api-prod.pem
33
key_id: 2027-01-21-Prod-eligibility-signposting-api
4+
base_url: https://identity.prod.api.platform.nhs.uk/realms/api-producers
5+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
client_id: eligibility-signposting-api-client
22
private_key_path: eligibility-signposting-api-ptl.pem
33
key_id: 2027-01-21-PTL-eligibility-signposting-api
4+
base_url: https://identity.ptl.api.platform.nhs.uk/realms/api-producers

0 commit comments

Comments
 (0)