Setting Up a .NET and PowerShell Development Environment with AWS Cloud9 and Amazon EC2

Setting Up a .NET and PowerShell Development Environment with AWS Cloud9 and Amazon EC2



hi guys my name is Trevor Sullivan a Solutions Architect with Amazon Web Services in this video we're going to set up a cloud 9 integrated development environment directly inside of your AWS account so that you can develop power shell and dotnet applications from a cloud-based browser-based integrated development environment to do this we're going to start by creating a new cloud 9 development environment and then we're going to connect it over to an Amazon ec2 instance that's running in a boon to dotnet ami or Amazon machine image the.net Amazon machine image includes both the dotnet framework for dotnet core 2.0 as well as the PowerShell core open source project pre-installed it also contains the AWS PowerShell module pre-installed so that you can write AWS automation scripts directly inside of cloud 9 let's go ahead and get started I'll start by going to my environments in cloud 9 inside of the AWS management console go ahead and click on the create environment button and give it a name so in this case I'll call it Ubuntu net go ahead and click on the next step button and then we'll choose to connect and run in a remote SSH server we're gonna plug in the user name which is going to be a boon to and then we'll plug in the host after we've provisioned a new ec2 instance but we need to do this step first because we need to grab this public SSH key here so that we can provision our ec2 instance let's switch over to the Amazon ec2 console and launch a new ec2 instance when you choose an Amazon machine image to provision the ec2 instance with you'll go ahead and just scroll down until you find the aboon – am i with dotnet pre-installed as you can see here we've got the dotnet core with a boon to server 1604 AMI and it includes powershell 6.0 which is the core edition of powershell that's open source as well as the dotnet core 2.0 framework once you've selected that ami you'll next be prompted to choose an instance type go ahead and just use the T to micro for now as that should be adequate for our development purposes under the configure instance details screen we need to make sure that we select an iam role that has access to the different AWS resources that we'll need to use from our cloud-based development environment I've already created an iam role called cloud 9 – Trevor here but you can use the iam console to create your own role as well and assign the appropriate policy permissions for it the next important part of the setup process is to go under advanced details and what we're going to do here is connect our Amazon ec2 instance to the cloud 9 environment so we're basically going to echo our public key here into the home the boon to SSH authorized Keys file we also need to make sure that we run an apt update which is the package manager for a boon to and after we've updated the package cache we need to then do an app to install node J s as well as Python 2.7 make sure you use the – – yes parameter to suppress any prompts that might show up and prevent the installation from completing in an automated fashion Python 2.7 is required by the cloud 9 development environment in order to install the environmental dependencies inside of the ec2 instance on the add storage screen you can just leave the default volume size of 8 gigabytes for now unless you need additional storage you don't need to specify any tags so go ahead and make sure that you go to the next screen and select a VPC security group that has inbound SSH access as mine does right here on the final screen you'll just review all of the instance details and then click on the launch button you can choose the proceed without a key pair because we're going to use this for a cloud 9 development environment and not be SSA Qing directly into it however if you do need to SSH into the instance for debugging purposes or troubleshooting purposes you can go ahead and create a new key pair or use an existing key pair that you've imported into your Amazon ec2 environment I'll go ahead and click on the launch instances button and wait for the instance to spin up and initialize you can monitor the progress of the initialization over on the instances screen now that your ec2 instance has finished initializing go ahead and copy the public ipv4 address for the ec2 instance and then switch back over to the cloud 9 console scroll down to the host field and paste in your IP address you also need to go under advanced settings and set the node.js binary path if it's different than the default which is user bin node so we're going to specify user bin slash node.js here as that's the default path on this a boon to AMI go ahead and click the next step button review the environment details and click on the create environment button the cloud 9 console will now go out and provision all of the necessary dependencies for the cloud-based IDE go ahead and check the always install everything button click on finish and the rest will be taken care of for you now that my development environment has been provisioned I'll go ahead and locate the powershell binary so i'll type which p WS h under my terminal environment here and I get back slash user bin powershell so to test out my environment i'm going to go ahead and create a new file and we'll call the file test dot p s 1 double-click the file to open it up and we'll add our shebang here and then we'll go ahead and add some test commands like get module and rate host – object finished go ahead and hit command s or choose file save to save that file next go ahead and do a chmod plus X on test stop ps1 to make the file executable next go ahead and run dot slash tests ps1 as you can see the output here just shows finished and it doesn't show the objects that are being emitted by the get module command if you want to see the objects that are emitted by the get module command make sure that you fire a PowerShell first as your interactive shell in the terminal and then go ahead and rerun the test ps1 file you can now see the module objects that are emitted from the get module command along with the text output from the right host command which emits directly to standard output that's all there is to setting up a development environment in the AWS cloud 9 integrated development environment we used an Amazon ec2 instance running dotnet core 2.0 and PowerShell core Edition to power our cloud 9 development environment thanks for watching and we'll see you next time

Posts created 35593

3 thoughts on “Setting Up a .NET and PowerShell Development Environment with AWS Cloud9 and Amazon EC2

  1. I keep getting this error I get the following error AWS Cloud9 couldn't write to the path /home/ec2-user/environment. Please check that it exists and is writeable. What am I doing wrong?

  2. "AWS Cloud9 couldn't connect to SSH server [email protected]—.—.—114."

    I am getting this error. I did the exact as video… strugling to solve this from last 3 days. please suggest the solutions…

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top