I’m trying to upload my web app to an EC2 instance through the .NET SDK using the “Publish to AWS” feature. For my other web application, this worked perfectly! The only difference between the two that I can see is this web app has a connection string to an attached RDS instance that is already live.
When the publish does go through, the instance launches and seems to be running fine. Within about ten minutes, the instance rolls back and terminates itself. After unchecking the terminate on fail checkbox the instance won’t terminate, however I’m not able to access my Default.aspx page. I haven’t been able to find anything helpful in the logs. I’m thinking it must have something to do with the connection string and attached volume.
I added my security group to the RDS instance that I use to launch the instance, however it still returns the same error.
Publish Info:
Instance Size: Micro
SDK Version: 1.5.10
AMI: ami-10ec6520
Region: US West 2
Error:
WaitCondition timed out. Received 0 conditions when expecting 1.
Stack Template
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "This will launch a single EC2 instance and deploy your application to it. **WARNING** This template creates one or more Amazon EC2 instances. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"InstanceType" : {
"Type" : "String",
"Default" : "t1.micro",
"Description" : "EC2 instance type."
},
"KeyPair" : {
"Type" : "String",
"Description" : "EC2 Key Pair."
},
"SecurityGroup" : {
"Type" : "String",
"Description" : "EC2 Security Group"
},
"BucketName" : {
"Type" : "String",
"Description" : "[Hidden]S3 Bucket for deployment."
},
"ConfigFile" : {
"Type" : "String",
"Description" : "[Hidden]Deployment Configuration File."
},
"AmazonMachineImage" : {
"Type" : "String",
"Default" : "ami-10ec6520",
"Description" : "AMI to launch."
},
"UserData" : {
"Type" : "String",
"Description" : "[Hidden]Base64-Encoded user data."
}
},
"Resources" : {
"DeployedApplicationWaitHandle" : {
"Type" : "AWS::CloudFormation::WaitConditionHandle",
"Properties" : {
}
},
"DeployedApplicationWaitCondition" : {
"Type" : "AWS::CloudFormation::WaitCondition",
"DependsOn" : "Ec2Instance",
"Properties" : {
"Handle" : { "Ref" : "DeployedApplicationWaitHandle" },
"Timeout" : "900"
}
},
"Ec2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : { "Ref" : "AmazonMachineImage" },
"KeyName" : { "Ref" : "KeyPair" },
"InstanceType" : { "Ref" : "InstanceType" },
"SecurityGroups" : [{ "Ref" : "SecurityGroup" }],
"UserData" : { "Fn::Base64" : {"Fn::Join" : [ "", ["[", { "Ref" : "UserData" }, "]", "[", { "Ref" : "DeployedApplicationWaitHandle" }, "]"] ]}}
}
}
},
"Outputs" : {
"URL" : {
"Description": "URL of the deployed application",
"Value" : { "Fn::Join" : [ "", [ "http://", { "Fn::GetAtt" : [ "Ec2Instance", "PublicDnsName" ] }]]}
},
"Bucket" : {
"Description" : "The S3 Bucket where the Web Deploy archive and configuration file are uploaded",
"Value" : { "Ref" : "BucketName" }
},
"ConfigFile" : {
"Description" : "The deployment configuration for the application",
"Value" : { "Ref" : "ConfigFile" }
},
"VSToolkitDeployed" : {
"Description" : "A flag indicating that the stack was created via VSToolkit Deploy wizard",
"Value" : "True"
}
}
}
UPDATE 1/18/2013
I finally got an instance launched that let me RDP into it. Below is the error that stuck out.
Error:
Microsoft.Web.Deployment.DeploymentFatalException: The SQL provider cannot run because of a missing dependency. Please make sure that Microsoft SQL Server Management Objects (Version 10 or higher) is installed. —> System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91’ or one of its dependencies. The system cannot find the file specified.
Any help would be greatly appreciated! If there’s any more information that would be helpful to provide, just let me know.
Turns out the answer was within my deployment settings in Visual Studio. Very amateur mistake on my part. In Project Properties => Package/Publish Web I needed to uncheck “Include all databases configured in Package/Publish SQL tab”
Since my database was already out and configured on RDS, all I needed to do was include the correct connection string in the Web.config file.
Thanks everyone for the help!