Code Monkey home page Code Monkey logo

arca-assessment's Introduction


Creating EC2 and how to start and stop the instance

** For Terraform **

  1. Install the Terrform CLI, visit the installation documentation here (https://www.terraform.io/downloads.html), the downloads depends on the operating system (Windows, Linux, Mac OS etc).

1a. Download the Terraform executable file to the Downloads folder and copy it to the Documents folder

  1. Navigate to the terraform-ec2 folder using the Linux cd command.

2b. For the purpose of this demonstration, copy the Terraform executable file into the terraform-ec2 directory. For production use, the file should be places in a global location so it can be referenced from anywhere in the operating system

  1. Update the variables.tf file with the appropriate AWS access_key and secret_key to give access to the Terraform script

  2. Open the Command Prompt/Terminal on the terraform-ec2 directory and run terraform init to initialize and download dependency for the AWS Terraform provider

  3. Run terraform plan to get a sense of the AWS resources to be provisioned

  4. Run terraform apply to apply and create the EC2 instance

  5. This will create the instance in the default VPC

  6. When creation is done. The instance ID will be generated which will be updated in the python script

  7. To run the Python script, Navigate to ec2_start_stop directory and type python ec2_start.py to start the instance and python ec2_stop.py to stop the instance

** For CloudFormation **

  1. Login to the AWS Console

  2. Click on the Services menu item on the top menu bar.

  3. On the search bar, type Cloudformation to filter through the services. Click Cloudformation option that shows up. This will lead to the CloudFormation Console

  4. On the CloudFormation Console, click the Create Stack button on the top right corner of the screen, it will give a drop-down menu, on the menu, click on With new resources (standard), this is because we are creating new resources

  5. On the next screen, Click on the Upload a template file under the Specify template box.

  6. Click the Choose file button and select the ec2.yaml file contained in the cloudformation-ec2 directory.

  7. Click Next

  8. Enter the name of the Stack, for example, simple-ec2. Click Next

  9. The next page is about Tags, Permissions and Stack policy. Ignore configurations and Click Next

  10. Review all the configurations, and click the Create stack button to create the instance

  11. This will initialize the instance creation process.

  12. When creation is done. The instance ID will be generated which will be updated in the python script

  13. To run the Python script, Navigate to ec2_start_stop directory and type python ec2_start.py to start the instance and python ec2_stop.py to stop the instance

arca-assessment's People

Watchers

James Cloos avatar Ewere Diagboya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.