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 following command can also be run regularly to update awscli
79
-
`pip install awscli --upgrade --user`
80
-
If the above command produced `error: invalid command 'bdist_wheel'` then run `pip install wheel`
81
-
82
-
Needed to then [update my path](https://docs.aws.amazon.com/cli/latest/userguide/install-linux.html#install-linux-pip) so that `~/.local/bin` would be included.
83
-
84
-
If you get the following error when runing `sam` commands:
85
-
```
86
-
/home/you/.local/lib/python2.7/site-packages/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
87
-
warnings.warn(warning, RequestsDependencyWarning)
88
-
```
89
-
Then run: `pip install --upgrade cryptography`
90
-
91
-
If you get OpenSSL errors like the following:
92
-
```
93
-
...
94
-
File "/home/you/.local/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
95
-
import OpenSSL.SSL
96
-
File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
97
-
from OpenSSL import rand, crypto, SSL
98
-
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
99
-
SSL_ST_INIT = _lib.SSL_ST_INIT
100
-
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
101
-
```
102
-
Then run: `pip install --upgrade pyOpenSSL`
59
+
If you are running on a Linux based system with apt, you can install `awscli` via the standard repository. This may be a little old, but it may be OK, and of course it's very quick and easy.
103
60
61
+
Or with a handful of commands you can install the latest, details [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html).
104
62
105
63
# Install aws-sam-cli
106
64
107
65
The [install details](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) for Linux can be found [here](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-linux.html).
108
66
You will need to install brew first. Once you have done that `which brew` will show you were it is installed.
67
+
Contrary to the install instructions, it was installed to: `/home/linuxbrew/.linuxbrew/Homebrew/bin/brew`
109
68
For us we use zsh, so adding homebrew to our path was just adding the following line to our ~/.zshrc file:
Your terminal should know where brew now is. Carry on with the aws-sam-cli install.
118
-
119
-
## Legacy Python install of aws-sam-cli below
120
-
121
-
`pip install --user --upgrade aws-sam-cli`
122
-
123
-
This kept failing with an error [`regex_3/_regex.c:46:20: fatal error: Python.h: No such file or directory`](https://github.com/awslabs/aws-sam-cli/issues/922#issuecomment-452361161)
124
-
125
-
So I did as [jfuss suggested](https://github.com/awslabs/aws-sam-cli/issues/922#issuecomment-452363441):
126
-
`sudo apt-get install python-dev python3-dev`
127
-
Then tried `pip install --user --upgrade aws-sam-cli` again, and could now see `sam` listed in `~/.local/bin/`
76
+
Your terminal should know where brew now is. Carry on with the aws-sam-cli install.
77
+
For us we had to run the install twice
78
+
```shell
79
+
brew tap aws/tap
80
+
brew install aws-sam-cli
81
+
```
128
82
129
-
# [Validating SAM templates](https://github.com/awslabs/aws-sam-cli/blob/develop/docs/usage.md#validate-sam-templates) (probably still needs doing)
83
+
# Configuring aws cli
130
84
131
85
In order to validate SAM templates, [you'll need](https://github.com/awslabs/aws-sam-cli/issues/394) an AWS user with CLI access and policy `AWSQuickSightListIAM` added to the group of the CLI user, then, usually the easiest way to do this is to run [`aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) which will create two files ([`~/.aws/credentials`](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html) & `~/.aws/config`) if they don't already exist. The `aws_access_key_id` & `aws_secret_access_key` will be created in the `credentials` file if they don't exist, and the `output` & [`region`](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-region.html) will be created in the `config` file if they don't exist. If you don't set the region you'll end up with [errors](https://github.com/awslabs/aws-sam-cli/issues/442)
132
86
Next it's a good idea to make sure these files are `chmod 600` (by default mine was). I then `chmod 700` on `~/.aws/`, just like the `~/.ssh/` directory is.
0 commit comments