Class AwsInstancesComputeSource

java.lang.Object
co.yellowdog.platform.model.AwsInstancesComputeSource
All Implemented Interfaces:
AwsComputeSource, ComputeSource, Credentialed, Identified, Named, Serializable

@JsonClassDescription("Details needed for provisioning instances from AWS EC2") @ValidatedBy(AwsInstancesComputeSourceValidator.class) public class AwsInstancesComputeSource extends Object implements AwsComputeSource
Defines a source of compute composed of AWS EC2 instances using the RunInstances API.
See Also:
  • Constructor Details

  • Method Details

    • getTraits

      public ComputeSourceTraits getTraits()
      Description copied from interface: ComputeSource
      Returns an object describing behavioural traits specific to this compute source.
      Specified by:
      getTraits in interface ComputeSource
      Returns:
      an object describing behavioural traits specific to this compute source
    • getInstancePricing

      public InstancePricing getInstancePricing()
      Description copied from interface: ComputeSource
      Gets the instance pricing for this source, e.g. Spot
      Specified by:
      getInstancePricing in interface ComputeSource
      Returns:
      the instance pricing for this source
    • getCredentials

      public Set<String> getCredentials()
      Description copied from interface: Credentialed
      Return the names of the credentials to be used for this Credentialed entity.
      Specified by:
      getCredentials in interface Credentialed
      Returns:
      the names of the credentials to be used
    • builder

      public static AwsInstancesComputeSource.Builder builder()
    • toBuilder

    • getId

      public String getId()
      Description copied from interface: Identified
      Returns the ID
      Specified by:
      getId in interface ComputeSource
      Specified by:
      getId in interface Identified
      Returns:
      the ID
    • getCreatedFromId

      public String getCreatedFromId()
      Description copied from interface: ComputeSource
      Gets the ID of the source template if this source was created from a template.
      Specified by:
      getCreatedFromId in interface ComputeSource
      Returns:
      the ID of the source template if this source was created from a template
    • getName

      public String getName()
      Description copied from interface: ComputeSource
      Returns the name of this compute source (which must be unique within the containing ComputeRequirement).
      Specified by:
      getName in interface ComputeSource
      Specified by:
      getName in interface Named
      Returns:
      the name of this compute source
    • getCredential

      public String getCredential()
      Specified by:
      getCredential in interface AwsComputeSource
      Specified by:
      getCredential in interface ComputeSource
    • getRegion

      public String getRegion()
      The AWS region where instances will be provisioned.
      Specified by:
      getRegion in interface ComputeSource
      Returns:
      the AWS region where instances will be provisioned
    • getAvailabilityZone

      public String getAvailabilityZone()
      The AWS availability zone within the region where instances will be provisioned.
      Specified by:
      getAvailabilityZone in interface AwsComputeSource
      Returns:
      the AWS availability zone where instances will be provisioned
    • getSecurityGroupId

      public String getSecurityGroupId()
      The ID of the AWS Security Group for the provisioned instances.
      Specified by:
      getSecurityGroupId in interface AwsComputeSource
      Returns:
      the ID of the AWS Security Group for the provisioned instances
    • getSubnetId

      public String getSubnetId()
      The ID of the subnet to use for the provisioned instances.
      Specified by:
      getSubnetId in interface AwsComputeSource
      Returns:
      the ID of the subnet to use
    • getInstanceType

      public String getInstanceType()
      The EC2 instance type for the provisioned instances.
      Specified by:
      getInstanceType in interface ComputeSource
      Returns:
      the EC2 instance type for the provisioned instances
    • getImageId

      public String getImageId()
      The region-specific Amazon Machine Image (AMI) ID for the image to use for the provisioned instances.
      Specified by:
      getImageId in interface ComputeSource
      Returns:
      the AMI ID for the image to use for the provisioned instances
    • getUserData

      public String getUserData()
      Description copied from interface: ComputeSource
      Gets the user-data script to be passed to the provisioned instance at startup.
      Specified by:
      getUserData in interface ComputeSource
      Returns:
      the user-data script
    • getInstanceTags

      Description copied from interface: ComputeSource
      Gets the custom instance tags to be set on the provisioned instance at startup.
      Specified by:
      getInstanceTags in interface ComputeSource
      Returns:
      the custom instance tags
    • getIamInstanceProfileArn

      public String getIamInstanceProfileArn()
      The ARN of the IAM Instance Profile to use for the provisioned instances.
      Specified by:
      getIamInstanceProfileArn in interface AwsComputeSource
      Returns:
      the ARN of the IAM Instance Profile to use
    • getKeyName

      public String getKeyName()
      The name of the EC2 key pair to use when logging into any instances provisioned from this source.
      Specified by:
      getKeyName in interface AwsComputeSource
      Returns:
      the name of the key pair to use
    • getEnableDetailedMonitoring

      public Boolean getEnableDetailedMonitoring()
      Indicates if provisioned instances should have detailed CloudWatch monitoring enabled.
      Specified by:
      getEnableDetailedMonitoring in interface AwsComputeSource
      Returns:
      true, if provisioned instances should have detailed CloudWatch monitoring enabled; otherwise, false
    • getEnableInstanceMetadataTags

      public Boolean getEnableInstanceMetadataTags()
      Indicates if provisioned instances should expose their tags via instance metadata.
      Specified by:
      getEnableInstanceMetadataTags in interface AwsComputeSource
      Returns:
      true, if provisioned instances should expose their tags via instance metadata; otherwise, false
    • getUseCapacityBlock

      public Boolean getUseCapacityBlock()
      Indicates if instances should be provisioned within a reserved capacity block.
      Returns:
      true, if instances should be provisioned within a reserved capacity block; otherwise, false
    • isAssignPublicIp

      public boolean isAssignPublicIp()
      Indicates if provisioned instances should be assigned public IP addresses.
      Specified by:
      isAssignPublicIp in interface AwsComputeSource
      Returns:
      true, if provisioned instances should be assigned public IP addresses; otherwise, false
    • getCreateClusterPlacementGroup

      public Boolean getCreateClusterPlacementGroup()
      Indicates if instances should be provisioned within a cluster placement group.
      Specified by:
      getCreateClusterPlacementGroup in interface AwsComputeSource
      Returns:
      true, if provisioned instances should be provisioned within a cluster placement group; otherwise, false or null
    • getExistingPlacementGroup

      public AwsPlacementGroup getExistingPlacementGroup()
      Indicates an existing placement group within which instances should be provisioned.
      Specified by:
      getExistingPlacementGroup in interface AwsComputeSource
      Returns:
      an existing placement group
    • getCreateElasticFabricAdapter

      public Boolean getCreateElasticFabricAdapter()
      Indicates if instances should be provisioned with an Elastic Fabric Adapter network interface.
      Specified by:
      getCreateElasticFabricAdapter in interface AwsComputeSource
      Returns:
      true, if instances should be provisioned with an Elastic Fabric Adapter network interface; otherwise, false or null
    • getSecondaryNetworkInterfaces

      public List<@NotNull @Valid AwsSecondaryNetworkInterface> getSecondaryNetworkInterfaces()
      Secondary network interfaces to create on provisioned instances.
      Specified by:
      getSecondaryNetworkInterfaces in interface AwsComputeSource
    • getCapacityReservation

      public AwsCapacityReservation getCapacityReservation()
      Specifies the capacity reservation to target for provisioned instances.
      Specified by:
      getCapacityReservation in interface AwsComputeSource
    • getLimit

      public int getLimit()
      Description copied from interface: ComputeSource
      Returns the limit in number of instances that can be provisioned from this source.
      Specified by:
      getLimit in interface ComputeSource
      Returns:
      the limit in number of instances that can be provisioned from this source
    • isSpecifyMinimum

      public boolean isSpecifyMinimum()
      Indicates if YellowDog Compute should specify the minimum when requesting instances from AWS. If true, then no instances are provisioned unless all requested instances are available; otherwise, if false, YellowDog Compute will provision as many instances as possible up to the number requested from this compute source.
      Returns:
      true, if YellowDog Compute should specify minimum instance count to AWS; otherwise, false
    • isSpot

      public boolean isSpot()
      Indicates if spot instances should be requested rather than on-demand.
      Returns:
      true, if spot instances should be requested; otherwise, false
    • getSpotMaxPrice

      public Double getSpotMaxPrice()
      The maximum price that will be paid for instances provisioned from this source.
      Returns:
      the maximum price that will be paid for instances
    • getInstanceSummary

      public InstanceSummary getInstanceSummary()
      Description copied from interface: ComputeSource
      A summary of instance counts according to instance status
      Specified by:
      getInstanceSummary in interface ComputeSource
      Returns:
      a summary of instance counts according to instance status
    • getStatus

      public ComputeSourceStatus getStatus()
      Description copied from interface: ComputeSource
      Gets the current provisioning status of this source.
      Specified by:
      getStatus in interface ComputeSource
      Returns:
      the current provisioning status of this source
    • getStatusMessage

      public String getStatusMessage()
      Description copied from interface: ComputeSource
      Gets the message associated with the current provisioning status of this source. Returns null if no further detail is relevant to the status.
      Specified by:
      getStatusMessage in interface ComputeSource
      Returns:
      the message associated with the current provisioning status of this source
    • getExhaustion

      public ComputeSourceExhaustion getExhaustion()
      Description copied from interface: ComputeSource
      If this source is associated with an exhausted allowance, gets the exhaustion state.
      Specified by:
      getExhaustion in interface ComputeSource
      Returns:
      the exhaustion state, if the source is associated with an exhausted allowance; otherwise, null
    • getSupportingResourceCreated

      public Boolean getSupportingResourceCreated()
      Description copied from interface: ComputeSource
      Indicates if supporting resources have been created for this source.
      Specified by:
      getSupportingResourceCreated in interface AwsComputeSource
      Specified by:
      getSupportingResourceCreated in interface ComputeSource
      Returns:
      true, if supporting resources have been created for this source; false, if no supporting resources have been created; null, if unknown
    • setId

      public void setId(String id)
      Description copied from interface: ComputeSource
      Sets the ID
      Specified by:
      setId in interface ComputeSource
      Parameters:
      id - This should only be set by the YellowDog Platform
    • setCreatedFromId

      public void setCreatedFromId(String createdFromId)
      Description copied from interface: ComputeSource
      Sets the source template ID
      Specified by:
      setCreatedFromId in interface ComputeSource
      Parameters:
      createdFromId - This should only be set by the YellowDog Platform
    • setName

      public void setName(String name)
      Description copied from interface: ComputeSource
      Sets the name of this compute source (which must be unique within the containing ComputeRequirement).
      Specified by:
      setName in interface ComputeSource
      Parameters:
      name - the name of this compute source
    • setCredential

      public void setCredential(String credential)
    • setRegion

      public void setRegion(String region)
      The AWS region where instances will be provisioned.
      Parameters:
      region - the AWS region where instances will be provisioned
      This should not be changed once the requirement has been submitted to YellowDog Compute.
    • setAvailabilityZone

      public void setAvailabilityZone(String availabilityZone)
      The AWS availability zone within the region where instances will be provisioned.
      Parameters:
      availabilityZone - the AWS availability zone where instances will be provisioned
      This should not be changed once the requirement has been submitted to YellowDog Compute.
    • setSecurityGroupId

      public void setSecurityGroupId(String securityGroupId)
      The ID of the AWS Security Group for the provisioned instances.
      Parameters:
      securityGroupId - the ID of the AWS Security Group for the provisioned instances
    • setSubnetId

      public void setSubnetId(String subnetId)
      The ID of the subnet to use for the provisioned instances.
      Parameters:
      subnetId - the ID of the subnet to use
    • setInstanceType

      public void setInstanceType(String instanceType)
      The EC2 instance type for the provisioned instances.
      Specified by:
      setInstanceType in interface ComputeSource
      Parameters:
      instanceType - the EC2 instance type for the provisioned instances
    • setImageId

      public void setImageId(String imageId)
      The region-specific Amazon Machine Image (AMI) ID for the image to use for the provisioned instances.
      Specified by:
      setImageId in interface ComputeSource
      Parameters:
      imageId - the AMI ID for the image to use for the provisioned instances
    • setUserData

      public void setUserData(String userData)
      Description copied from interface: ComputeSource
      Sets the user-data script to be passed to the provisioned instance at startup.
      Specified by:
      setUserData in interface ComputeSource
      Parameters:
      userData - the user-data script
    • setInstanceTags

      public void setInstanceTags(Map<@AwsInstanceTagKey String,@AwsInstanceTagValue String> instanceTags)
      Description copied from interface: ComputeSource
      Sets the custom instance tags to be set on the provisioned instance at startup.
      Specified by:
      setInstanceTags in interface ComputeSource
      Parameters:
      instanceTags - the custom instance tags
    • setIamInstanceProfileArn

      public void setIamInstanceProfileArn(String iamInstanceProfileArn)
      The ARN of the IAM Instance Profile to use for the provisioned instances.
      Parameters:
      iamInstanceProfileArn - the ARN of the IAM Instance Profile to use
    • setKeyName

      public void setKeyName(String keyName)
      The name of the EC2 key pair to use when logging into any instances provisioned from this source.
      Parameters:
      keyName - the name of the key pair to use
    • setEnableDetailedMonitoring

      public void setEnableDetailedMonitoring(Boolean enableDetailedMonitoring)
      Indicates if provisioned instances should have detailed CloudWatch monitoring enabled.
      Parameters:
      enableDetailedMonitoring - true, if provisioned instances should have detailed CloudWatch monitoring enabled; otherwise, false
    • setEnableInstanceMetadataTags

      public void setEnableInstanceMetadataTags(Boolean enableInstanceMetadataTags)
      Indicates if provisioned instances should expose their tags via instance metadata.
      Parameters:
      enableInstanceMetadataTags - true, if provisioned instances should expose their tags via instance metadata; otherwise, false
    • setUseCapacityBlock

      public void setUseCapacityBlock(Boolean useCapacityBlock)
      Indicates if instances should be provisioned within a reserved capacity block.
      Parameters:
      useCapacityBlock - true, if instances should be provisioned within a reserved capacity block; otherwise, false
    • setAssignPublicIp

      public void setAssignPublicIp(boolean assignPublicIp)
      Indicates if provisioned instances should be assigned public IP addresses.
      Parameters:
      assignPublicIp - true, if provisioned instances should be assigned public IP addresses; otherwise, false
    • setCreateClusterPlacementGroup

      public void setCreateClusterPlacementGroup(Boolean createClusterPlacementGroup)
      Indicates if instances should be provisioned within a cluster placement group.
      Parameters:
      createClusterPlacementGroup - true, if provisioned instances should be provisioned within a cluster placement group; otherwise, false or null
    • setExistingPlacementGroup

      public void setExistingPlacementGroup(AwsPlacementGroup existingPlacementGroup)
      Indicates an existing placement group within which instances should be provisioned.
      Parameters:
      an - existing placement group
    • setCreateElasticFabricAdapter

      public void setCreateElasticFabricAdapter(Boolean createElasticFabricAdapter)
      Indicates if instances should be provisioned with an Elastic Fabric Adapter network interface.
      Parameters:
      createElasticFabricAdapter - true, if instances should be provisioned with an Elastic Fabric Adapter network interface; otherwise, false or null
    • setSecondaryNetworkInterfaces

      public void setSecondaryNetworkInterfaces(List<@NotNull @Valid AwsSecondaryNetworkInterface> secondaryNetworkInterfaces)
      Secondary network interfaces to create on provisioned instances.
    • setCapacityReservation

      public void setCapacityReservation(AwsCapacityReservation capacityReservation)
      Specifies the capacity reservation to target for provisioned instances.
    • setLimit

      public void setLimit(int limit)
      Description copied from interface: ComputeSource
      Sets the limit in number of instances that can be provisioned from this source.
      Specified by:
      setLimit in interface ComputeSource
      Parameters:
      limit - the limit in number of instances that can be provisioned from this source
    • setSpecifyMinimum

      public void setSpecifyMinimum(boolean specifyMinimum)
      Indicates if YellowDog Compute should specify the minimum when requesting instances from AWS. If true, then no instances are provisioned unless all requested instances are available; otherwise, if false, YellowDog Compute will provision as many instances as possible up to the number requested from this compute source.
      Parameters:
      specifyMinimum - true, if YellowDog Compute should specify minimum instance count to AWS; otherwise, false
    • setSpot

      public void setSpot(boolean spot)
      Indicates if spot instances should be requested rather than on-demand.
      Parameters:
      spot - true, if spot instances should be requested; otherwise, false
    • setSpotMaxPrice

      public void setSpotMaxPrice(Double spotMaxPrice)
      The maximum price that will be paid for instances provisioned from this source.
      Parameters:
      spotMaxPrice - the maximum price that will be paid for instances
    • setInstanceSummary

      public void setInstanceSummary(InstanceSummary instanceSummary)
      Specified by:
      setInstanceSummary in interface ComputeSource
    • setStatus

      public void setStatus(ComputeSourceStatus status)
      Description copied from interface: ComputeSource
      Sets the current provisioning status of this source.
      Specified by:
      setStatus in interface ComputeSource
      Parameters:
      status - This should only be set by the YellowDog Platform
    • setStatusMessage

      public void setStatusMessage(String statusMessage)
      Description copied from interface: ComputeSource
      Sets the message associated with the current provisioning status of this source.
      Specified by:
      setStatusMessage in interface ComputeSource
      Parameters:
      statusMessage - This should only be set by the YellowDog Platform
    • setExhaustion

      public void setExhaustion(ComputeSourceExhaustion exhaustion)
      Specified by:
      setExhaustion in interface ComputeSource
    • setSupportingResourceCreated

      public void setSupportingResourceCreated(Boolean supportingResourceCreated)
      Specified by:
      setSupportingResourceCreated in interface AwsComputeSource
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object