public void SetUp() { Ec2ClientMock = new Mock<IAmazonEC2>(); InstanceService = new InstanceService(Ec2ClientMock.Object); SetUpResponse(); }
private static BootstrapData BootstrapApplication() { // If we're not on EC2, then we'll not even try bootstrapping the application. if (!IsEc2) { return null; } // Uses ambient AWS credentials, probably from an IAM role. // This should be exactly the same as just creating the clients without passing the credentials. // It is left explicit to guarantee the same algorithm is used to get credentials here as it is // in Startup.Autofac.cs. AWSCredentials credentials = AmbientCredentials.GetCredentials(); IAmazonEC2 ec2Client = AWSClientFactory.CreateAmazonEC2Client(credentials); IAmazonS3 s3Client = AWSClientFactory.CreateAmazonS3Client(credentials); var instanceService = new InstanceService(ec2Client); var storageService = new StorageService(s3Client, new S3PathParser()); var metadataService = new MetadataService(); var bootstrapper = new ApplicationBootstrapper(instanceService, storageService, metadataService); return bootstrapper.BootstrapApplication(); }