Class EC2Cloud

All Implemented Interfaces:
ExtensionPoint, Describable<Cloud>, ModelObject, SearchableModelObject, SearchItem, AccessControlled, ModelObjectWithContextMenu
Direct Known Subclasses:
AmazonEC2Cloud

public class EC2Cloud extends Cloud
Hudson's view of EC2.
Author:
Kohsuke Kawaguchi
  • Field Details

  • Constructor Details

  • Method Details

    • resolvePrivateKey

      @CheckForNull public EC2PrivateKey resolvePrivateKey()
    • getCloudName

      @Deprecated public String getCloudName()
      Deprecated.
      Use public field "name" instead.
    • getRegion

      public String getRegion()
    • parseRegion

      @CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static software.amazon.awssdk.regions.Region parseRegion(@CheckForNull String input)
    • parseEndpoint

      @CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static URI parseEndpoint(@CheckForNull String input)
    • isNoDelayProvisioning

      public boolean isNoDelayProvisioning()
    • setNoDelayProvisioning

      @DataBoundSetter public void setNoDelayProvisioning(boolean noDelayProvisioning)
    • getAltEC2Endpoint

      public String getAltEC2Endpoint()
    • setAltEC2Endpoint

      @DataBoundSetter public void setAltEC2Endpoint(String altEC2Endpoint)
    • addTemplate

      public void addTemplate(SlaveTemplate newTemplate) throws Exception
      Throws:
      Exception
    • updateTemplate

      public void updateTemplate(SlaveTemplate newTemplate, String oldTemplateDescription) throws Exception
      Throws:
      Exception
    • readResolve

      protected Object readResolve()
    • isUseInstanceProfileForCredentials

      public boolean isUseInstanceProfileForCredentials()
    • getRoleArn

      public String getRoleArn()
    • getRoleSessionName

      public String getRoleSessionName()
    • getCredentialsId

      public String getCredentialsId()
    • getSshKeysCredentialsId

      @CheckForNull public String getSshKeysCredentialsId()
    • getPrivateKey

      @Deprecated public EC2PrivateKey getPrivateKey()
      Deprecated.
    • getInstanceCapStr

      public String getInstanceCapStr()
    • getInstanceCap

      public int getInstanceCap()
    • getTemplates

      public List<SlaveTemplate> getTemplates()
    • getTemplate

      @CheckForNull public SlaveTemplate getTemplate(String template)
    • getTemplate

      @Deprecated public SlaveTemplate getTemplate(Label label)
      Deprecated.
      Gets SlaveTemplate that has the matching Label.
    • getTemplates

      public Collection<SlaveTemplate> getTemplates(Label label)
      Gets list of SlaveTemplate that matches Label.
    • getKeyPair

      @CheckForNull public KeyPair getKeyPair() throws software.amazon.awssdk.core.exception.SdkException, IOException
      Gets the KeyPairInfo used for the launch.
      Throws:
      software.amazon.awssdk.core.exception.SdkException
      IOException
    • doAttach

      public void doAttach(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String id) throws jakarta.servlet.ServletException, IOException, software.amazon.awssdk.core.exception.SdkException
      Debug command to attach to a running instance.
      Throws:
      jakarta.servlet.ServletException
      IOException
      software.amazon.awssdk.core.exception.SdkException
    • doProvision

      public org.kohsuke.stapler.HttpResponse doProvision(@QueryParameter String template) throws jakarta.servlet.ServletException, IOException
      Throws:
      jakarta.servlet.ServletException
      IOException
    • provision

      public Collection<NodeProvisioner.PlannedNode> provision(Label label, int excessWorkload)
      Overrides:
      provision in class Cloud
    • provision

      public void provision(SlaveTemplate t, int number)
    • canProvision

      public boolean canProvision(Label label)
      Overrides:
      canProvision in class Cloud
    • createCredentialsProvider

      protected software.amazon.awssdk.auth.credentials.AwsCredentialsProvider createCredentialsProvider()
    • getSlaveTypeTagValue

      public static String getSlaveTypeTagValue(String slaveType, String templateDescription)
    • createCredentialsProvider

      public static software.amazon.awssdk.auth.credentials.AwsCredentialsProvider createCredentialsProvider(boolean useInstanceProfileForCredentials, String credentialsId)
    • createCredentialsProvider

      public static software.amazon.awssdk.auth.credentials.AwsCredentialsProvider createCredentialsProvider(boolean useInstanceProfileForCredentials, String credentialsId, String roleArn, String roleSessionName, String region)
    • connect

      public software.amazon.awssdk.services.ec2.Ec2Client connect() throws software.amazon.awssdk.core.exception.SdkException
      Connects to EC2 and returns Ec2Client, which can then be used to communicate with EC2.
      Throws:
      software.amazon.awssdk.core.exception.SdkException
    • getHttpClient

      public static software.amazon.awssdk.http.SdkHttpClient getHttpClient()
    • createClientOverrideConfiguration

      public static software.amazon.awssdk.core.client.config.ClientOverrideConfiguration createClientOverrideConfiguration()
    • checkEndPoint

      public static URL checkEndPoint(String url) throws FormValidation
      Throws:
      FormValidation
    • log

      public static void log(Logger logger, Level level, TaskListener listener, String message)
    • log

      public static void log(Logger logger, Level level, TaskListener listener, String message, Throwable exception)