20 articles AWS

Finding AMI ids for CentOS AWS command line

aws –region ap-southeast-2 ec2 describe-images –owners aws-marketplace –filters Name=product-code,Values=aw0evgkw8e5c1q413zgy5pjcecode   { “Images”: [ { “BlockDeviceMappings”: [ { “DeviceName”: “/dev/sda1”, “Ebs”: { “DeleteOnTermination”: false, “VolumeType”: “standard”, “Encrypted”: false, “VolumeSize”: 8, “SnapshotId”: “snap-0635e3e9f403b9dc7” } } ], “ImageLocation”: “aws-marketplace/CentOS Linux 7 x86_64 HVM EBS 1704_01-b7ee8a69-ee97-4a49-9e68-afaee216db2e-ami-d52f5bc3.4”, “Description”: “CentOS Linux 7 x86_64 HVM EBS 1704_01”, “EnaSupport”: false, “State”: “available”, “Hypervisor”:…

Ubuntu Install AWS Cloudformation tools cfn-signal command

mkdir aws-cfn-bootstrap-latest curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest –strip-components 1 easy_install aws-cfn-bootstrap-latest Usage: /usr/local/bin/cfn-init –stack ${AWS::StackName} –resource AutoScalingGroup –region ${AWS::Region} /usr/local/bin/cfn-signal –exit-code 0 –stack ${AWS::StackName} –resource AutoScalingGroup –region ${AWS::Region}  

Command to make EBS volume available in EC2 Instance

  #view available disk devices [root@ip-172-31-21-110 lib]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 16G 0 disk └─xvda1 202:1 0 16G 0 part / xvdf 202:80 0 4G 0 disk #Check for filesystem exist [root@ip-172-31-21-110 lib]# file -s /dev/xvdf /dev/xvdf: data #Create file systems ext4 [root@ip-172-31-21-110 lib]# mkfs -t ext4 /dev/xvdf…

Running MySQL on Amazon EC2 with EBS (Elastic Block Store)

https://aws.amazon.com/articles/1663 Configuring MySQL to use the EBS volume Now that we have an EBS volume mounted on the instance with a good file system, let’s put the MySQL database on that volume and tell MySQL where it is. Stop the MySQL server. sudo /etc/init.d/mysql stop Move the existing database files to the EBS volume. Point…