public async Task SetupAsync(Ec2Instance instance)
 {
     this.Instance = instance;
     this.Instance.Logger = this.logger;
     this.DisplayName = "Terminating " + this.Instance.Name;
     await this.Instance.DestroyAsync();
     this.TryClose();
 }
Exemple #2
0
        // Create a new empty volume, not from snapshot
        public Ec2Volume(Ec2Instance instance, string name, int sizeGb)
        {
            this.Instance = instance;
            this.Name = name;
            this.sizeGb = sizeGb;
            this.Logger = instance.Logger;

            this.IsSetup = false;
        }
Exemple #3
0
        // New creation
        public Ec2Volume(Ec2Instance instance, string source, string name)
        {
            this.Instance = instance;
            this.source = source;
            this.Name = name;
            this.Logger = instance.Logger;

            this.IsSetup = false;
        }
Exemple #4
0
        // Shortcut to the above, if the information is already available
        public Ec2Volume(Ec2Instance instance, string volumeId, string name, string device)
        {
            this.Instance = instance;
            this.VolumeId = volumeId;
            this.Name = name;
            this.Device = device;

            this.Logger = instance.Logger;
            this.IsSetup = true;
        }
Exemple #5
0
        // Connection to existing. Currently only used for deletion
        public Ec2Volume(Ec2Instance instance, string volumeId)
        {
            this.Instance = instance;
            this.VolumeId = volumeId;

            // TODO: Get name and mountPoint source from Ec2
            // Currently only used for deleting volumes, so it's not an issue

            this.Logger = new StubLogger();
            this.IsSetup = true;
        }
 public Ec2Instance CreateInstance(string name, string instanceAmi, InstanceSize instanceSize, string availabilityZone = null, double? spotBidPrice = null)
 {
     var instance = new Ec2Instance(this.client, this.config, name, new InstanceSpecification(instanceAmi, instanceSize, availabilityZone, spotBidPrice));
     instance.Logger = this.Logger;
     return instance;
 }