OBLYTECH Logo
OBLYTECH Logo

Manage Amazon EC2 instances from ServiceNow with the EC2 spoke

The Amazon EC2 spoke lets ServiceNow workflows manage EC2 instances, Amazon Machine Images, key pairs, and tags through reusable actions. To manage Amazon EC2 instances from ServiceNow with the EC2 spoke, establish the required subscription, dependencies, and connection credentials, then combine discovery, approved changes, and follow-up checks in a flow.

Prepare ServiceNow to manage Amazon EC2 instances with the EC2 spoke

An Integration Hub subscription is required. Check the installed spoke version and your instance release before designing the workflow. The spoke was built against API version 2016-11-15; compatibility with later versions needs checking in your environment. Treat installation readiness and permission readiness as separate checks so a successful installation does not become your acceptance test.

The dependencies are ServiceNow IntegrationHub Runtime (com.glide.hub.integration.runtime), ServiceNow IntegrationHub Action Step – REST (com.glide.hub.action_step.rest), Complex Object (com.glide.cobject), and ServiceNow Flow Designer – Dynamic Inputs (com.glide.hub.dynamic_inputs). Check these dependencies when installation fails. Some dependencies require appropriate licensing when used outside the spoke implementation.

The stated AWS requirement is a user with full access to Amazon EC2, together with that user’s Access Key ID and Secret Access Key. Plan credential handling before building the flow. Keep secret values out of request descriptions, approval notes, and troubleshooting screenshots. Assign responsibility for maintaining the connection so a credential change has a clear owner.

Integration Hub uses connection and credential aliases to separate connection information from the actions consuming it. This allows connection details to change without editing each action that uses the connection. As an implementation check, verify which environment an alias reaches before testing a write operation. A working connection to the wrong environment is still a failed test.

Discover the target before choosing a lifecycle action

Start the design with a narrow request: identify the instance, intended region, desired outcome, and approval record. List Regions and Get Availability Zones help establish location context. List Instance Types retrieves instance types for an AWS region. List Instances retrieves instances; Get Instances Status checks status, while Get Instance Attribute retrieves a selected attribute.

The discovery order that works best is to resolve the environment, retrieve the intended resource, and inspect its current condition before offering a change.Record the identifiers used by the workflow alongside the request. Human-readable names can help the requester, but the execution record should make the actual target unambiguous to a reviewer.

  1. Establish the connection and regional context for the request.
  2. Retrieve the candidate instance and inspect the information needed for the decision.
  3. Check whether the requested outcome still applies to that instance.
  4. Route the proposed change through your chosen approval process.
  5. Execute the selected action and inspect the resource again.

The spoke supplies actions rather than a complete approval process. If the process spans two ServiceNow environments,consider the role of theRemote Instance spoke when planning how request context moves between them.

Build distinct paths for launch, stop, restart, and termination

Run Instances launches a specified number of instances from an AMI. Start Instances starts specified instances, Reboot Instances reboots them, and Stops Instances stops them. Preserve the action label Stops Instances when locating it in the action catalog. Terminate Instances provides the shutdown or termination operation and deserves a separate approval decision in your workflow.

For a launch request, decide how the flow will obtain the image choice and requested instance count. For an existing instance, decide how it will resolve the target and requested transition. Avoid placing all lifecycle operations behind an undifferentiated request option: the reviewer should understand whether the request starts capacity, interrupts an instance, or removes it.

After an action returns, use a follow-up status check to evaluate the requested outcome. As an acceptance criterion, record both the action result and the observed condition. If those disagree, route the request for investigation instead of marking the work complete merely because the flow reached its final step.

Update Instance Attribute has two specific constraints: the instance must be stopped before the update, and the action changes one attribute at a time. Plan an approved interruption where needed, check the stopped condition, apply the selected attribute change, and inspect that attribute afterward. Multiple attribute changes should be represented as separate operations with their own results.

For help planning this work, see ServiceNow implementation.

Manage images without confusing image work with instance work

List Images retrieves AMIs, and List Image Attribute retrieves a specified image attribute. Use those discovery actions when choosing an image for a launch or checking an image-related request. Keep the selected image identifier visible in the execution record so reviewers can connect the approved image to the launched resource.

Create Image creates an EBS-backed AMI from an EBS-backed instance that is running or stopped. Copy Image copies an AMI from a specified source region into the current region. When planning a copy, make the source and destination context explicit; the destination connection context is part of the change, not incidental background information.

Deregister Image deregisters the specified AMI. Give image retirement its own request criteria rather than treating it as part of an instance shutdown. A useful review question is whether the requested resource is an image or an instance. The answer determines which discovery action, approval evidence, and follow-up inspection belong in the flow.

Handle key pairs and tags as separate managed resources

Create Key Pair creates a 2048-bit SSH-2 RSA key pair. List Key Pair retrieves a specified pair or lists pairs, and Delete Key Pair deletes the specified pair. Build a handling decision for sensitive outputs before enabling creation.Limit what the flow copies into broadly visible task records, and route sensitive material through your approved handling process.

Create Tags adds or overwrites tags on specified resources. Delete Tags removes specified tags from specified resources, and List Tags retrieves tags for a region. Because creation can overwrite an existing value, review the current tags before applying a requested change. Inspect the resulting tags afterward and retain the resource identifiers with the change record.

Define who supplies tag values and who resolves conflicts between a request and existing resource information. For example, an ownership change should have a clear decision-maker before the flow replaces an owner value. That is a governance choice to make during design, rather than a behavior supplied by the tagging actions.

The Okta spoke covers user, password and group management. If a request also involves identity changes, handle them in that spoke, since key-pair actions and identity changes act on different resources and need their own acceptance checks.

Test the workflow against observable outcomes

Use a nonproduction target to test a discovery action before a write action. Then test one approved change at a time. Capture the requested target, selected connection context, action result, and follow-up observation. These records help distinguish a targeting mistake from an operation that ran but did not produce the intended condition.

Include rejection and failure paths in the design review. Decide what happens when discovery does not identify the intended instance, approval is withheld, or the follow-up check does not show the requested outcome. Avoid an automatic retry policy until you have considered what a repeated launch, tag overwrite, or image operation would mean for that request.

The spoke ships no flows or subflows of its own. Installing Now Assist in Conversational Spokes adds two sample conversational subflows, covered below.Plan to assemble the request, approvals, action sequence, and result handling for your process.For workflows that also need to run PowerShell on Windows machines, assess the PowerShell step. It runs through a MID Server and needs its own inputs and success criteria.

Questions about additional EC2 spoke capabilities

Can the spoke retrieve a Windows administrator password?

Get Password Data retrieves the encrypted administrator password for an active Windows instance. Treat the returned data as sensitive when designing where results are stored and who can inspect them.

Can a workflow change instance monitoring?

Monitor Instances enables monitoring for active instances. Unmonitor Instances disables monitoring for specified running instances. Give monitoring requests a clear target and desired setting so their approval records remain understandable.

Are conversational samples available?

Look up Images – Sample and Run instances – Sample are sample conversational subflows that become available when Now Assist in Conversational Spokes is installed.Assess that installation ifconversational interaction is part of the planned request experience.

What should a handover record include?

A handover note should record the connection owner,approved request types, test targets, expected observations, and the team responsible for failed changes. Include the reason behind interruption and retirement decisions so maintenance does not depend on the original flow designer being available.