AWS
Ir para navegação
Ir para pesquisar
EC2
Alterando/Adicionando uma security group a uma instância EC2
aws ec2 modify-instance-attribute --instance-id i-12345 --groups sg-12345 sg-67890
Automação
Terraform
Variáveis de ambiente
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
BOTO
- http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html
- http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Operations.html
2
- http://boto.cloudhackers.com/en/latest/ref/ec2.html
- http://boto.cloudhackers.com/en/latest/ec2_tut.html
- http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html
3
- http://boto3.readthedocs.io/en/latest/reference/services/ec2.html
- http://boto3.readthedocs.io/en/latest/guide/migrationec2.html
- http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.modify_instance_attribute
awslimitchecker
ANSIBLE
JAVA
- https://aws.amazon.com/pt/sdk-for-java/
- http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html
Ferramentas
Route 53
Import: cli53 import dominio.com.mx --file dominio.com.mx.txt --replace --wait Export: cli53 export dominio.com.mx
AWS CLI
- https://github.com/aws/aws-cli
- http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html
AWS Management Portal for vCenter
- http://docs.aws.amazon.com/amp/latest/userguide/setting-up.html#install-management-portal
- Migrating Your Virtual Machine to Amazon EC2 Using AWS Connector for vCenter
Migrar Guests
- Migrando suas máquinas virtuais para a AWS
- VM Import/Export
- vmimport_checklist.pdf
- Importing a VM as an Image Using VM Import/Export
Serviços
Amazon EC2
- https://aws.amazon.com/ec2/
- Amazon EC2 Instance Types
- Preço e tamanhos
- Managing the AWS
- APIReference
- EC2 BOTO
Dados da instância
curl http://169.254.169.254/latest/meta-data/ami-id curl http://ifconfig.co
Chaves SSH
Linux
Windows
Amazon S3
RDS
Import/Export
CloudFormation
AWS
Cursos
Billing
- What is AWS Billing and Cost Management?
- Billing & Cost Management Dashboard
- Cloud Economics Center
- Amazon EC2 Pricing
- AWS Calculator
Comandos
Print EC2 instances name, privateIP and TYPE as CSV
#!/bin/bash
function ARQTEMP() {
case $1 in
criar) mktemp
;;
apagar)
rm -fr $2
;;
esac
}
aws ec2 describe-instances | \
jq ".Reservations|.[]|.Instances|.[]|.InstanceId"| \
sed -e "s/\"//g"|\
while read instanceid
do
JSON=$(ARQTEMP criar)
aws ec2 describe-instances --instance-ids $instanceid > $JSON
endereco=$(cat $JSON| jq ".Reservations|.[]|.Instances|.[]|.PrivateIpAddress" | sed -e "s/\"//g")
enderecopublic=$(cat $JSON| jq ".Reservations|.[]|.Instances|.[]|.PrivateIpAddress" | sed -e "s/\"//g")
nome=$(echo $(cat $JSON| jq ".Reservations|.[]|.Instances|.[]|.Tags|.[]|.Key" | sed -e "s/\"//g") $(cat $JSON | jq ".Reservations|.[]|.Instances|.[]|.Tags|.[]|.Value" | sed -e "s/\"//g")|grep ^Name| sed -s "s/^Name//g")
tipo=$(cat $JSON | jq ".Reservations|.[]|.Instances|.[]|.InstanceType" | sed -e "s/\"//g")
securitygroups=$(cat $JSON| jq ".Reservations|.[]|.Instances|.[]|.SecurityGroups|.[]|.GroupId" | sed -e "s/\"//g")
instanceid=$(cat $JSON | jq ".Reservations|.[]|.Instances|.[]|.InstanceId" | sed -e "s/\"//g")
state=$(cat $JSON | jq ".Reservations|.[]|.Instances|.[]|.State|.Name" | sed -e "s/\"//g")
echo $instanceid,$endereco,$enderecopublic,$nome,$tipo,$securitygroups,$state
ARQTEMP apagar $JSON
done