Skip to content

feat: add AWS EC2 power management and get instance components#5008

Merged
forestileao merged 5 commits into
superplanehq:mainfrom
felixgateru:feat/aws-ecs-2
May 29, 2026
Merged

feat: add AWS EC2 power management and get instance components#5008
forestileao merged 5 commits into
superplanehq:mainfrom
felixgateru:feat/aws-ecs-2

Conversation

@felixgateru
Copy link
Copy Markdown
Collaborator

@felixgateru felixgateru commented May 26, 2026

Resolves: #5006

What changed

Adds two AWS EC2 workflow components:

Get Instance — describe an EC2 instance and emit its current state, IP addresses, and metadata
Manage Instance Power — perform a power operation on an EC2 instance (start, stop, reboot, or hibernate) and wait for the expected terminal state

Why

SuperPlane already had EC2 AMI actions (create/get/copy image, etc.) and instance provisioning (create/delete), but no way to inspect a running instance mid-workflow or change its power state

How

Backend

Added GetInstance in pkg/integrations/aws/ec2/get_instance.go. Setup resolves the instance name via DescribeInstance and stores it alongside the instance ID in node metadata so the UI card shows both.
Added ManageInstancePower in pkg/integrations/aws/ec2/manage_instance_power.go with four operations: start (polls until running), stop (polls until stopped), hibernate (sends StopInstances?Hibernate=true, polls until stopped), and reboot (fire-and-forget, emits immediately since the instance stays running throughout).
Added RebootInstances and HibernateInstances (via a stopInstances helper with a Hibernate flag) to the EC2 client in pkg/integrations/aws/ec2/client.go.
Registered both components in pkg/integrations/aws/aws.go.
Added example outputs, tests, and updated ec2.go / example.go.

Frontend

Added workflow v2 mappers:
web_src/src/pages/workflowv2/mappers/aws/ec2/get_instance.ts — metadata card shows resolved instance name, raw instance ID (when a name was found), and region
web_src/src/pages/workflowv2/mappers/aws/ec2/manage_instance_power.ts — metadata card shows instance name, operation label (Start / Stop / Reboot / Hibernate), and region; execution details include the operation and final state
Registered mappers and event state registries in web_src/src/pages/workflowv2/mappers/aws/index.ts
Added mapper specs for both components (get_instance.spec.ts, manage_instance_power.spec.ts)

Demo

Screencast.From.2026-05-28.14-17-12.webm

@superplanehq-integration
Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

@felixgateru felixgateru marked this pull request as ready for review May 26, 2026 08:17
Comment thread web_src/src/pages/workflowv2/mappers/aws/ec2/get_instance.ts
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/aws/ec2/manage_instance_power.ts Outdated
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
@felixgateru felixgateru changed the title feat: add AWS ECS power management and get instance components feat: add AWS EC2 power management and get instance components May 28, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9432f98. Configure here.

Comment thread pkg/integrations/aws/ec2/manage_instance_power.go
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
@forestileao forestileao merged commit d0293d1 into superplanehq:main May 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AWS] Add EC2 getInstance and power management components

2 participants