Coder Social home page Coder Social logo

aws_windows_ec2_setup's Introduction

Overview

As of the time of the writing, connecting to an AWS EC2 instance running the Windows OS can only be scripted up to a point, unlike Linux instances. The files in this directory are designed to create a Windows instance and get Python installed, as well as link a directory from your (the user's) physical machine to the EC2 instance for development purposes.

Requirements

  • awscli - Can be installed using pip install awscli.

    • Once this has been installed, run aws configure from the command line. This will setup the ~/.aws/ directory with two files, ~/.aws/config and ~/.aws/credentials. You will need your Access Key ID and Secret Access Key in order to complete this process - see Configuring the AWS CLI for information regarding these two.
  • key_pairs directory

    • After aws configure has been run, create a directory named key_pairs in the ~/.aws/ directory (mkdir ~/.aws/key_pairs/). Once you have created a key pair, download it and put it in this newly created directory.
  • Microsoft Remote Desktop

    • Has been tested with Version 10.3.2

Setup

  1. Run launch_windows_instance.sh (bash launch_windows_instance.sh). Follow the instructions that are printed to stdout.

  2. Open Microsoft Remote Desktop, click 'Add Desktop' (or click the '+' dropdown menu in the upper left of the application and then click 'Desktop').

  3. Copy the Public DNS in the dialogue box on AWS and paste it into 'PC Name' in Microsoft Remote Desktop. Click 'Add User Account...' in the 'User account' drop down menu, and copy/paste the User name and decrypted password into the appropriate fields.

  4. Before you click 'Add', click the 'Folders' tab in the 'Add a Desktop' dialogue box. Select 'Redirect folders', then click the '+' in the bottom left of the dialogue box. Add the setup_python_environment/ directory, in addition to the directory that contains the code you will be developing (you will have to add these separately).

  5. Click 'Add' to add the remote connection.

  6. Double-click or hit 'return' on your keyboard to connect to the instance. Select continue when prompted.

  7. Once you are 'in' the Windows instance, open File Explorer and click 'This PC' to show all the directories available. In addition to the traditional Downloads, Desktop, etc., you should see the two directories you selected in step 4 (see image below, in the red highlight box)

You would think that you're good to go and you could access these from Command prompt/Windows Powershell right? Wrong! Why, you ask? Windows, that's why.

  1. Right-click/two-finger click 'Network' and select 'Map network drive...'

  2. Choose whatever letter you want for 'Drive' and use \\tsclient\setup_python_environment\ for the setup_python_environment/ directory. Repeat this process for the other directory from step 4, choosing a different drive and using the directory name as the subdirectory name (i.e. if the name of the directory is src/, use \\tsclient\src\).

  3. Click the newly mapped drive in the 'This PC' drop down, right-click/two-finger click the windows_python_setup.bat batch file, and select 'Run as administrator'.

  1. The Python installer will pop up, showing the installation progress:

  1. Once this is complete, follow the commands that will be printed to stdout in the Command Prompt that opened when you ran the batch file. Doing so should open up the Python interpreter when py is run at the command line (regardless of the directory you are in) and the pip help page when pip is run at the command line (regardless of which directory you are in).

  1. Now you are setup to develop on your machine and run your code on the EC2 instance. Any changes you make to file within a mapped drive will show up in the file on the Windows instance once the file is saved on your machine and reopened on the EC2 instance.

Example: BEFORE

Example: AFTER

aws_windows_ec2_setup's People

Contributors

marshallm94 avatar

Watchers

 avatar  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.