@@ -24,25 +24,31 @@ echo "[Press Enter to continue] "
24
24
read unusedVariable2
25
25
echo " "
26
26
27
- echo " *** WARNING ***"
28
- echo " You should ONLY run this from the root folder of your local copy of the "
29
- echo " Serverless MFA API's files. You are currently in the following folder: "
30
27
echo " "
31
- pwd
28
+ echo " --------------------- Configuring AWS CLI profiles ---------------------- "
32
29
echo " "
33
- echo " Please cancel this if that is not the appropriate folder. "
34
- echo " [Press Enter to continue] "
35
- read unusedVariable3
30
+
31
+ echo " Please enter the AWS Access Key ID/Secret for the source AWS account, "
32
+ echo " which we will use to download the backup data from S3."
33
+ echo " "
34
+ echo " For the default region, use the region where the current Serverless MFA "
35
+ echo " API is running (probably us-east-1). The Default output format can be "
36
+ echo " left blank."
37
+ aws configure --profile restore-s3-backups
36
38
echo " "
37
39
40
+ echo " Now please enter the AWS Access Key ID/Secret for the target AWS "
41
+ echo " account, which we will use to create the new copy of the Serverless MFA "
42
+ echo " API. "
38
43
echo " "
39
- echo " --------------------- Preparing to download backups ---------------------"
44
+ echo " For the default region, use the region where you want to deploy the new "
45
+ echo " copy of the Serverless MFA API (such as us-east-1, us-east-2, us-west-1, "
46
+ echo " or us-west-2). The Default output format can be left blank."
47
+ aws configure
40
48
echo " "
41
49
42
- echo " Which AWS CLI profile should we use to download the backup data from the "
43
- echo " existing Serverless MFA API that you are trying to recover? "
44
- echo " EXAMPLE: sourceAWSaccount-dynamodb-backup-manager-yourname"
45
- read awsProfileForDownloadingBackups
50
+ echo " "
51
+ echo " --------------------- Preparing to download backups ---------------------"
46
52
echo " "
47
53
48
54
echo " What is the S3 bucket where those backups are stored? "
@@ -54,15 +60,15 @@ aws s3 sync \
54
60
--delete \
55
61
--acl private \
56
62
--sse AES256 \
57
- --profile " ${awsProfileForDownloadingBackups} " \
63
+ --profile " restore-s3-backups " \
58
64
" s3://${s3bucketToRestoreFrom} " \
59
65
" recovery/TempCopyOfBackups/"
60
66
61
67
echo " "
62
68
echo " ------------- Installing serverless-mfa-api's dependencies --------------"
63
69
echo " "
64
70
65
- sudo npm i -g npm
71
+ npm i -g npm
66
72
67
73
npm ci
68
74
@@ -97,7 +103,7 @@ echo ""
97
103
echo " ---------------------- Installing backups library -----------------------"
98
104
echo " "
99
105
100
- sudo npm install gulp-cli -g
106
+ npm install gulp-cli -g
101
107
102
108
if [ ! -d " ./recovery/DynamoDbBackUp" ]; then
103
109
cd ./recovery
@@ -121,6 +127,7 @@ echo ""
121
127
echo " What name do you want to use for the new S3 Bucket where backups will be "
122
128
echo " stored? "
123
129
echo " EXAMPLE: targetAWSaccount.backups.dynamodb.${newServiceName} "
130
+ echo " (but replace targetAWSaccount with the name of the target AWS account)"
124
131
read newS3bucketName
125
132
echo " "
126
133
@@ -251,16 +258,23 @@ echo ""
251
258
echo " ---------------------- Finished setting up the new ----------------------"
252
259
echo " --------------- Serverless MFA API with data from backups ---------------"
253
260
echo " "
261
+ echo " IMPORTANT! "
262
+ echo " "
254
263
echo " You can now update your systems that need to use this, giving them the "
255
- echo " new API Gateway URL (visible in the Serverless output a ways above this "
256
- echo " line, as well as in the AWS CloudFormation 'Service Endpoint' Output for "
257
- echo " the ${newServiceName} -${stage} stack) as the new value for their "
258
- echo " apiBaseUrl. (The apiKey and apiSecret will not have changed, since those "
259
- echo " were in the restored data.) "
260
- echo " "
261
- echo " If using this with our IdP-in-a-Box, you will need to update the "
262
- echo " mfa_totp_apibaseurl and mfa_u2f_apibaseurl Terraform variables for the "
263
- echo " ID Broker workspace of the applicable IdP."
264
+ echo " new API Gateway URL. To find that... "
265
+ echo " "
266
+ echo " 1. Sign in to the target AWS account. "
267
+ echo " 2. Go to CloudFormation. "
268
+ echo " 3. Find the ${newServiceName} -${stage} stack. "
269
+ echo " 4. In its Outputs section, find the 'Service Endpoint' URL. "
270
+ echo " 5. ADD A TRAILING SLASH and use that as the new value for the apiBaseUrl "
271
+ echo " of any IdP that should use this new copy of the Serverless MFA API. "
272
+ echo " (The apiKey and apiSecret will not have changed, since those were in "
273
+ echo " the restored data.) "
274
+ echo " "
275
+ echo " If using this with our IdP-in-a-Box, you will do so by updating the "
276
+ echo " mfa_totp_apibaseurl and mfa_u2f_apibaseurl Terraform variables for "
277
+ echo " the ID Broker workspace of the applicable IdP."
264
278
echo " "
265
279
echo " ========================================================================="
266
280
echo " "
0 commit comments