add aws
parent
d88e3e041b
commit
71b3251a25
@ -0,0 +1,68 @@
|
|||||||
|
# AWS
|
||||||
|
|
||||||
|
* [CLI](https://docs.aws.amazon.com/cli/latest/userguide/welcome-versions.html)
|
||||||
|
* Console [SignIn](https://razerpay.signin.aws.amazon.com/console)
|
||||||
|
* EC2 vs Lambda [comparison](https://www.nakivo.com/blog/aws-lambda-vs-amazon-ec2-which-one-to-choose/#:~:text=AWS%20EC2%20is%20a%20service,environments%2C%20and%20run%20custom%20applications.&text=AWS%20Lambda%20provides%20you%20a,an%20event%20trigger%20is%20activated.)
|
||||||
|
* EC2 : VM instance
|
||||||
|
* always running
|
||||||
|
* Pricing : CPU, memory, storage & runtime
|
||||||
|
* use-case : high-performance application, long running
|
||||||
|
* Lambda : Container
|
||||||
|
* Run when event triggered
|
||||||
|
* Pricing : based on running time
|
||||||
|
* Max Mem : 3008MB
|
||||||
|
* Max runtime : 900 sec
|
||||||
|
* use-case :
|
||||||
|
* automating task
|
||||||
|
* realtime log
|
||||||
|
* processing object upload to S3
|
||||||
|
* Storage
|
||||||
|
* EBS - Elastic Block Storage
|
||||||
|
* S3
|
||||||
|
* Messaging
|
||||||
|
* SNS - Simple Notification Service
|
||||||
|
* distributed Publish Subscribe system. push to subscriber
|
||||||
|
* multiple receiver allowed
|
||||||
|
* SQS - Simple Queue Service (Message Queue)
|
||||||
|
* distributed queuing system. polling by receiver
|
||||||
|
* single receiver
|
||||||
|
* VPC - Virtual Private Cloud
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ aws --version
|
||||||
|
|
||||||
|
$ aws configure
|
||||||
|
|
||||||
|
AWS Access Key ID [None]: ...
|
||||||
|
AWS Secret Access Key [None]: ...
|
||||||
|
Default region name [None]: ap-southeast-1
|
||||||
|
Default output format [None]:
|
||||||
|
|
||||||
|
$ aws configure list
|
||||||
|
|
||||||
|
Name Value Type Location
|
||||||
|
---- ----- ---- --------
|
||||||
|
profile <not set> None None
|
||||||
|
access_key ****************7BMR shared-credentials-file
|
||||||
|
secret_key ****************Ph2l shared-credentials-file
|
||||||
|
region ap-southeast-1 config-file ~/.aws/config
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
* setting folder `~/.aws/credentials` & `~/.aws/config`
|
||||||
|
|
||||||
|
* [Region Name](https://docs.aws.amazon.com/general/latest/gr/rande.html)
|
||||||
|
|
||||||
|
* [SDK](https://docs.aws.amazon.com/cli/latest/userguide/welcome-resources.html)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ aws help
|
||||||
|
|
||||||
|
$ aws ec2 help
|
||||||
|
|
||||||
|
$ aws ec2 describe-instances help
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
# Redis
|
||||||
|
|
||||||
|
* login docker
|
||||||
|
|
||||||
|
```sh
|
||||||
|
PS> docker exec -it redis-redis_1 sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* login redis with password = admin
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ redis-cli -p admin
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* get key
|
||||||
|
|
||||||
|
```sh
|
||||||
|
127.0.0.1:6379> keys *
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* set key
|
||||||
|
|
||||||
|
```sh
|
||||||
|
127.0.0.1:6379> set keyname 1
|
||||||
|
|
||||||
|
// set "session_<authToken>" (base64) key using for authentication
|
||||||
|
127.0.0.1:6379> set c2Vzc2lvbl83ZDNlYjNiYS0zYjliLTQyMGEtYTc4YS1lOGQwYzJmY2MzYWVfU2luZ2Fwb3Jl 1
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*
|
||||||
Loading…
Reference in New Issue