Posts

Showing posts from March, 2020

AWS elasticbeanstalk automation example

#!/bin/bash PowerOnDuringWeekDaysAt="08:30" PowerOffDuringWeekDaysAt="18:30" CurrentTime=$(TZ=Europe/London date | sed 's/.* \([0-9]*:[0-9]*\):[0-9]*.*/\1/') WeekDay=`date +%u` # 1 is Monday - 7 is Sunday ListInstances=$(aws elasticbeanstalk describe-instances-health --environment-name my-aws-elastic-beanstalk-environment | jq -r '.InstanceHealthList[].InstanceId') PowerOn=$(aws elasticbeanstalk update-environment --environment-name my-aws-elastic-beanstalk-environment --option-settings file://poweron.json) PowerOff=$(aws elasticbeanstalk update-environment --environment-name my-aws-elastic-beanstalk-environment --option-settings file://poweroff.json) if (($WeekDay >= 1 && $WeekDay <= 5)) then echo "Weekdays Schedule" echo "-----------------" if [[ "$CurrentTime" > $PowerOnDuringWeekDaysAt ]] && [[ "$CurrentTime" < $PowerOffDuringWeekDaysAt ]] then echo "Sched...

AWS EB CLI

Image
This is a CLI that is specific to EB (Elastic Beanstalk) It can be installed in Powershell https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html https://github.com/aws/aws-elastic-beanstalk-cli-setup https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-getting-started.html Installing video https://www.youtube.com/watch?v=5jG-LSBJzoI used "home-brew" on mac brew install awsebcli Derricks-iMac:~ derricksobrien$ python --version Python 2.7.16 Derricks-iMac:~ derricksobrien$ cd applications Derricks-iMac:applications derricksobrien$ pwd /Users/derricksobrien/applications Derricks-iMac:applications derricksobrien$ ls Chrome Apps.localized LogMeIn Client.app GoToMeeting nodejs-v1 Derricks-iMac:applications derricksobrien$ cd nodejs-v1 Derricks-iMac:nodejs-v1 derricksobrien$ pwd /Users/derricksobrien/applications/nodejs-v1 ...

AWS interview questions

General AWS services https://www.youtube.com/watch?v=3t0AP1kO0do 10 mistakes - prepare for these questions https://www.youtube.com/watch?v=hpSQd54fJwI 10 mins but seems worth the watch

AWS labs

Create a stack using CloudFormation https://amazon.qwiklabs.com/focuses/8642?parent=catalog Deploy a solution using Elastic Beanstalk mokojumbie 1 = ASP.NET sample mokojumbie 2 = docker sample getting-started-app = docker sample (no environments) You have the EB documentation as PDF You also downloaded all the sample apps in various code formats Can be downloaded again from the links in PDF doc (need them as .zip files)

AWS CLI

Installing the CLI and using it from windows https://www.youtube.com/watch?v=sLtf7Sx8lsQ AWS CLI Tutorial | Introduction To AWS Command Line Interface | AWS Training | Edureka https://www.youtube.com/watch?v=Pk5x1diFwg8&vl=en Amazon AWS - AWS CLI installation on Windows AWS CLI refs AWS Command Line Interface aws — AWS CLI 1.18.13 Command Reference AWS Command Line Interface aws/aws-cli: Universal Command Line Interface for Amazon Web Services JMESPath Tutorial — JMESPath AWS | Amazon Linux AMI Amazon Linux 2 elasticbeanstalk — AWS CLI 1.18.13 Command Reference my account GUI console link =  https://351885124777.signin.aws.amazon.com/console High level steps to running commands in CLI 1) download CLI 2) install 3) check reponse > aws --version 4) login to IAM account or connect to an EC2 linux instance with SSH 5) provide the keys 6) (optional) specifiy the output type (default is JSON) some test commands (once you are logged in)...

AWS, Elastic Beanstalk - Answers

Appendix Answers to Review Questions Chapter 1: Introduction to AWS Cloud API B. The specific credentials include the access key ID and secret access key. If the access key is valid only for a short-term session, the credentials also include a session token. AWS uses the user name and passwords for working with the AWS Management Console, not for working with the APIs. Data encryption uses the customer master keys, not API access. C. Most AWS API services are regional in scope. The service is running and replicating your data across multiple Availability Zones within an AWS Region. You choose a regional API endpoint either from your default configuration or by explicitly setting a location for your API client. A. The AWS SDK relies on access keys, not passwords. The best practice is to use AWS Identity and Access Management (IAM) credentials and not the AWS account credentials. Comparing IAM users or IAM roles, only IAM users can have long-term security credentials....