Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you publish to an existing Amazon EC2 instance using AWS Toolkit for Visual Studio?

I'm trying out the free tier on Amazon EC2 and intend to host a couple of small websites through the same micro instance. I have set up and configured an EC2 micro instance running Windows Server 2008, with all the necessities. The websites are all ASP.NET MVC3 applications.

I have installed the AWS Toolkit for Visual Studio and connected to my Amazon account, which all works well. The problem I have is that if I right-click my project in the Solution Explorer and choose Publish to AWS..., the only options I have is to publish it to a new instance. This does not work for me, as I want to host multiple sites on the same server.

Is it possible to publish to an existing instance using AWS Toolkit, and if so, how do I go about doing it?

like image 785
Christofer Eliasson Avatar asked May 13 '12 21:05

Christofer Eliasson


People also ask

Can we install Visual Studio in EC2 instance?

License-included Visual Studio on Amazon EC2 is now available in all AWS commercial and public Regions. You are billed per user for licenses of Visual Studio through a monthly subscription and per vCPU for license-included Windows Server instances on EC2.

How do I deploy AWS to Visual Studio?

From the Visual Studio Solutions Explorer pane, open the context menu for (right-click) the project's name, and choose Publish to AWS. This will open Publish to AWS. From Publish to AWS, choose Publish to New Target to configure a new deployment.

Can you use Visual Studio with AWS?

The AWS Toolkit for Visual Studio conveniently includes the AWS SDK for . NET, so you can get started building . NET applications on AWS infrastructure services in Visual Studio, including Amazon S3, Amazon EC2, AWS Elastic Beanstalk, and Amazon DynamoDB.


2 Answers

As far as I understand it the quick answer is no. This is because the recommended process after launching a new instance is to change the local admin password from that set by AWS. Since the publish to cloud formation only has the AccessKey & Secret Access Key it cannot get the new admin password & as a result cannot connect to an existing instance.

The quick way around this would be to set the instance's security group to allow FTP from your public IP address and then just publish via FTP.

like image 168
Johnv2020 Avatar answered Oct 06 '22 01:10

Johnv2020


I actually use a plugin called "dispatch", which publishes directly from Visual Studio to the server via FTP. I hate FTP, but that's the nicest solution I've seen so far.

I've been looking for an alternative myself.

The only other option I've used is called AllwaysSync, which is extremely cool. It can sync up a local hard drive with an S3 account. You can then link that s3 directory to CloudFront.

I've been "considering" doing a double sync with that, where I have alwayssync installed on my development box, and installed on my EC2 server. The EC2 machine has AlwaysSync set on auto-sync, so any changes to the S3 directory would get sucked in to the EC2 machine. That directory would be synced up with my local development machine when I initiate the upload.

Still.... It seems so half-as_ed that I've just sat back and waited for Amazon. They usually come up with something.

One thing that I've found works EXCEPTIONALLY well (if you have a fast connection)

I actually use an EC2 server as a workstation and RDP as a thin-client. There's an app called "SplitView" that lets me use 3 monitors at my worstation. I click a shortcut to RDP, my 3 monitors flicker and boom, All my stuff is still there from last-night. If someone steals my laptop.... there's nothing on it at all, except a link to the RDP account.

Anyway, now (for the Amazon sites) I just drag my files over to the live machine and change the IIS settings to targeet the new directory.

like image 21
Dan Avatar answered Oct 05 '22 23:10

Dan