You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
4 years ago | |
|---|---|---|
| .. | ||
| images | 4 years ago | |
| README.md | 5 years ago | |
| cloudwatch.md | 4 years ago | |
| ecs.md | 4 years ago | |
| s3-static-web.md | 5 years ago | |
| static-web.md | 4 years ago | |
README.md
AWS
- CLI
- Console SignIn
- EC2 vs Lambda comparison
- 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
- EC2 : VM instance
- 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
- SNS - Simple Notification Service
- VPC - Virtual Private Cloud
$ 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
$ aws help
$ aws ec2 help
$ aws ec2 describe-instances help
SSH
-
login
$ ssh -i sshprivatekey.pem ubuntu@ec2-3-0-55-149.ap-southeast-1.compute.amazonaws.com -
copy
$ scp -i $HOME/aws/netyth_razerpay.pem ./razerpay-schema-df.sql ubuntu@ec2-3-0-55-149.ap-southeast-1.compute.amazonaws.com:/home/ubuntu/xx.sql -
sql
$ mysql --host=mysql.db.com --user=admin --password=12311 $ mysql --host=razerpay.cx77tjbbiuga.ap-southeast-1.rds.amazonaws.com --user=admin --password=.... // export databse schema to sql text $ mysqldump -u username -p database_to_backup > backup_name.sqlmysql> CREATE DATABASE razerpay_singapore_prod; mysql> exit// import sql schema to database $ mysql -u admin -p razerpay_singapore_prod < file.sqlmysql> SHOW DATABASES; mysql> USE DATABASE; mysql> SHOW TABLES; mysql> DESCRIBE <table>; // display table schema mysql> SELECT user_id FROM df_receive_log; mysql> DROP DATABASE `db-name`; // delete database. use backtick if name have dash mysql> exit mysql> SET GLOBAL log_bin_trust_function_creators = 1; -
PEM (Windows) file permission change
# display file permission $ icacls <<pem file path>> # Remove the permissions inheritance $ icacls <<pem file path>> /inheritance:r /T # Grant read permission to the current user $ icacls <<pem file path>> /grant <<user name>>:R # updated permission display PS C:\dev\doc\ec2> icacls .\RPD-API.pem .\RPD-API.pem RAZER\tenghie.yik:(R) ### # ssh to aws ec2 using update pem file permission $ ssh -i "netyth-ec2-test.pem" ubuntu@ec2-54-169-180-189.ap-southeast-1.compute.amazonaws.com -
PEM (ubuntu) file permission change
# change file permission $ chmod 400 <<pem file>> # ssh to aws ec2 $ ssh -i "netyth-ec2-test.pem" ubuntu@ec2-54-169-180-189.ap-southeast-1.compute.amazonaws.com