aws --profile $profilename --region $regionname ec2 import-key-pair --key-name $keyname --public-key-material file://path/to/pub/key
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,State.Name,KeyName,PublicIpAddress,SecurityGroups[0].GroupName]' --output table
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[PublicIpAddress]' --output text --filter "Name=tag:**tagkey**,Values=**tagvalue**"
aws --output text ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,NetworkInterfaces[*].Groups[*]]'
aws ec2 get-console-output --instance-id $instanceid
aws ec2 copy-image --source-image-id ami-<id> --source-region us-east-1 --region ap-northeast-1 --name "$ec2_name"
aws --profile $your_profile --region $region_to_upload ec2 import-image --description "$your_description" --license-type BYOL --disk-containers file://containers.json --role-name $your_rolename_to_use
example containers record
[
{
"Description": "Your description",
"Format": "ova",
"UserBucket": {
"S3Bucket": "$S3_bucket_you_uploaded_the_ova_to",
"S3Key": "$filename.ova"
}
}]
aws lambda list-functions
aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://package.zip
aws route53 change-resource-record-sets --hosted-zone-id $yourdomainhostedzoneid --change-batch file://setup-dns-record.json
example dns record
{
"Comment": "alias api gateway to custom domain",
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "api.example.com",
"Type": "A",
"AliasTarget": {
"HostedZoneId": "$apigatewayhostedzoneid",
"DNSName": "yourapigateway.execute-api.us-west-1.amazonaws.com",
"EvaluateTargetHealth": false
}
}
}
]
}
https://forums.aws.amazon.com/thread.jspa?threadID=269585&tstart=0
https://docs.aws.amazon.com/general/latest/gr/rande.html#apigateway_region
https://blyx.com/2016/03/11/forensics-in-aws-an-introduction/
https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html