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
The script accepts a number of arguments, either as environment variables or
17
-
command-line flags:
18
-
19
-
```text
20
-
Usage:
21
-
main [OPTIONS]
22
-
Application Options:
23
-
--region= The AWS region (default: us-west-2) [$AWS_REGION]
24
-
--account-id= The AWS account number [$AWS_ACCOUNT_ID]
25
-
--profile= The AWS profile name [$AWS_PROFILE]
26
-
--iam-user= The IAM user name
27
-
--role= The user role type
28
-
--output= The AWS CLI output format (default: json)
29
-
Help Options:
30
-
-h, --help Show this help message
20
+
### Prerequisites
21
+
22
+
#### Dependencies
23
+
24
+
```shell
25
+
brew cask install aws-vault
26
+
```
27
+
28
+
Before running this tool, you will need to following pieces of information
29
+
30
+
* IAM role - This is the IAM Role with permissions allowing access to AWS APIs
31
+
and services. This is usually something like `admin` or `engineer`.
32
+
* IAM user name - This is your IAM username.
33
+
* AWS profile - This is the name that populates your `~/.aws/config` profile
34
+
name. It is usually the name of the aws account alias you are trying to access.
35
+
* AWS account Id - This is the 12-digit account number of the AWS account you
36
+
are trying to access.
37
+
* Temporary AWS access keys - These should be given to you by an administrator
38
+
of the AWS account you are trying to access. The tool will prompt you for
39
+
the access key id and secret access key.
40
+
41
+
## Running the tool
42
+
43
+
1. Run the setup-new-user - `setup-new-aws-user --role <IAM_ROLE> --iam_user <USER> --profile=<AWS_PROFILE> --account-id=<AWS_ACCOUNT_ID>`
44
+
2. Enter the access keys generated when prompted.
45
+
46
+
3. The script will open a window with a QR code, which you will use to configure a temporary one time password (TOTP).
47
+
4. You'll then need to create a new entry in your 1Password account configure it with a TOTP field.
48
+
5. Use 1Password to scan the QR code and hit save. New TOTP tokens should generate every 30 seconds.
49
+
6. From here the tool will prompt you for 3 unique TOTP tokens. **NOTE Take care not to use the same token more than once, as this will cause the process to fail.**
50
+
7. Once the tool has completed, you should be able to access the AWS account. You can run the following command filling in the AWS_PROFILE value
51
+
52
+
```shell
53
+
aws-vault exec AWS_PROFILE -- aws sts get-session
31
54
```
32
55
33
-
For the arguments that accept either an environment variable or command-line
34
-
flag, the environment variable takes precedence if both are provided due to the
0 commit comments