Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor EC2-related code #45

Merged
merged 11 commits into from
Oct 26, 2016
Merged

Refactor EC2-related code #45

merged 11 commits into from
Oct 26, 2016

Conversation

laughedelic
Copy link
Contributor

So-so. Something was already done here, but things should be simplified.

@laughedelic laughedelic self-assigned this Mar 10, 2016
@laughedelic laughedelic added this to the v0.18 milestone Mar 10, 2016
@laughedelic laughedelic modified the milestone: v0.18 Oct 12, 2016
@laughedelic
Copy link
Contributor Author

laughedelic commented Oct 21, 2016

  • move EC2.Instance and EC2.SpotInstanceRequest classes out of the client class
  • all API methods return Try
  • minimal or no wrappers for SDK Filter type
  • improve LaunchSpecs type
  • remove InstanceSpecs type
  • add waiters API at least for the instance states

@laughedelic
Copy link
Contributor Author

laughedelic commented Oct 24, 2016

There are several different types with essentially the same set of parameters describing instance launch specification:

There are for sure more such types, but these are the ones we're interested in the lib. And the problem is that they are not related anyhow in the SDK. So what I'm going to do here is to make a common denominator type and construct those other ones from it (similar to the current LaunchSpecs type).

@laughedelic
Copy link
Contributor Author

laughedelic commented Oct 25, 2016

Here is the list of their parameters with the common ones and specific.


Common parameters

  • blockDeviceMappings: Collection<BlockDeviceMapping>: One or more mappings that specify how block devices are exposed to the instance
  • ebsOptimized: Boolean: Indicates whether the instance is optimized for Amazon EBS I/O
  • iamInstanceProfile: IamInstanceProfileSpecification: The name or the ARN of the instance profile associated with the IAM role for the instance
  • imageId: String: The ID of the AMI
  • instanceType: InstanceType: The instance type
  • kernelId: String: The ID of the kernel (associated with the AMI)
  • keyName: String: The name of the key pair
  • ramdiskId: String: The ID of the RAM disk associated with the AMI
  • securityGroups: Collection<String>: One or more security groups with which to associate the instances
  • userData: String: The user data to make available to the launched EC2 instances
  • monitoring: Boolean: Enables detailed monitoring (true) or basic monitoring (false) for the Auto Scaling instances. It has different names/types:
    1. monitoringEnabled: Boolean
    2. monitoring: Boolean
    3. instanceMonitoring: InstanceMonitoring

LaunchSpecification additional parameters

  • allSecurityGroups: Collection<GroupIdentifier>: One or more security groups
  • networkInterfaces: Collection<InstanceNetworkInterfaceSpecification>: One or more network interfaces
  • subnetId: String: The ID of the subnet in which to launch the instance
  • placement: SpotPlacement: The placement information for the instance:
    • availability zone
    • the name of the placement group (for cluster instances))

RunInstancesRequest additional parameters

  • networkInterfaces: Collection<InstanceNetworkInterfaceSpecification>: One or more network interfaces
  • privateIpAddress: String: [EC2-VPC] The primary IP address
  • securityGroupIds: Collection<String>: One or more security group IDs
  • subnetId: String: [EC2-VPC] The ID of the subnet to launch the instance into
  • clientToken: String: Unique, case-sensitive identifier you provide to ensure the idempotency of the request
  • disableApiTermination: Boolean: If you set this parameter to true, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can
  • placement: Placement: The placement for the instance:
    • availability zone
    • the name of the placement group (for cluster instances))
    • ID of the Dedicted host on which the instance resides
    • tenancy of the instance (if the instance is running in a VPC)
  • instanceInitiatedShutdownBehavior: ShutdownBehavior: Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown)
  • maxCount: Integer: The maximum number of instances to launch
  • minCount: Integer: The minimum number of instances to launch

CreateLaunchConfigurationRequest additional parameters

  • associatePublicIpAddress: Boolean: Used for groups that launch instances into a virtual private cloud (VPC)
  • placementTenancy: String: The tenancy of the instance
  • classicLinkVPCId: String: The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to
  • classicLinkVPCSecurityGroups: Collection<String>: The IDs of one or more security groups for the specified ClassicLink-enabled VPC
  • spotPrice: String: The maximum hourly price to be paid for any Spot Instance launched to fulfill the request
  • launchConfigurationName: String: The name of the launch configuration
  • instanceId: String: The ID of the instance to use to create the launch configuration

@laughedelic laughedelic merged commit 70ab346 into master Oct 26, 2016
@laughedelic laughedelic deleted the pr/45 branch October 26, 2016 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant