Amazon EC2
App · Cloud Computing · 20 actions
Manage Amazon EC2: launch, start, stop, reboot and terminate instances and check their health, find AMIs, create and snapshot EBS volumes, create security groups and open ports, and tag resources.
Actions
| Action | What it does |
|---|---|
| Add tags | Add or overwrite tags on EC2 resources (instances, volumes, snapshots, security groups, AMIs...). |
| Authorize inbound rule | Allow inbound traffic to a security group from an IP range or another security group. |
| Create security group | Create a security group (a virtual firewall). |
| Create snapshot | Back up an EBS volume to a snapshot. |
| Create volume | Create an EBS volume in an Availability Zone, empty or from a snapshot. |
| Delete volume | Permanently delete an EBS volume that is not attached. |
| Get instance status | Read the health checks (instance and system status) and scheduled events of EC2 instances. |
| Launch instance | Launch new EC2 instances from an AMI. |
| List availability zones | List the Availability Zones of the connection's region, with their state. |
| List images | Find AMIs to launch from, newest first - for example the latest Amazon Linux with name pattern 'al2023-ami-2023*-x86_64'. |
| List instances | List EC2 instances in the connection's region, optionally only some ids, states or filters (such as a tag). |
| List key pairs | List the SSH key pairs in the connection's region. |
| List security groups | List security groups with their inbound and outbound rules. |
| List snapshots | List EBS snapshots - by default this account's own. |
| List volumes | List EBS volumes, optionally by id, state or attached instance. |
| Reboot instances | Reboot running EC2 instances. |
| Remove tags | Remove tags, by key, from EC2 resources. |
| Start instances | Start stopped EC2 instances. |
| Stop instances | Stop running EC2 instances. |
| Terminate instances | Permanently delete EC2 instances. |
Add tags
Add or overwrite tags on EC2 resources (instances, volumes, snapshots, security groups, AMIs...).
Inputs
- Resource IDs
resource_idslistRequired - Any EC2 resources: instances (i-...), volumes (vol-...), snapshots (snap-...), security groups (sg-...), AMIs (ami-...) and more. Each can be the id, its ARN, or the link to it in the EC2 console.
- Tags
tagsobjectRequired - Tags as key/value pairs. An existing tag with the same key is overwritten; a blank value is allowed.
Outputs
resultobject
Example output
{
"result": {
"resource_ids": [
"i-0abcd1234efgh5678"
],
"tagged": true,
"tags": {
"env": "prod"
}
}
}Authorize inbound rule
Allow inbound traffic to a security group from an IP range or another security group.
Inputs
- Security group
group_idtextRequired - The security group (sg-...). Pick one, or give the id, its ARN, or the link to it in the EC2 console.
- Protocol
protocoltextRequired - All traffic opens every protocol and port.One of:
tcp,udp,icmp,-1(All traffic). - From port
from_portnumber - First port (e.g. 22 for SSH, 443 for HTTPS). For ICMP, the ICMP type (-1 for all). Not used for All traffic.From -1 to 65535.
- To port
to_portnumber - Last port of the range; default the same as From port. For ICMP, the ICMP code (-1 for all).From -1 to 65535.
- Source IP range
cidrtext - An IPv4 or IPv6 CIDR such as 203.0.113.0/24 or 2001:db8::/32 (0.0.0.0/0 is anyone). Give this or a source security group.
- Source security group
source_group_idtext - Allow traffic from instances in this security group (sg-...) instead of an IP range.
- Rule description
descriptiontext - Optional, up to 255 characters.
Outputs
resultobject
Example output
{
"result": {
"group_id": "sg-0a1b2c3d4e5f67890",
"rules": [
{
"cidr_ipv4": "203.0.113.0/24",
"cidr_ipv6": null,
"description": "SSH from office",
"from_port": 22,
"group_id": "sg-0a1b2c3d4e5f67890",
"is_egress": false,
"prefix_list_id": null,
"protocol": "tcp",
"rule_id": "sgr-0a1b2c3d4e5f67890",
"source_group_id": null,
"to_port": 22
}
]
}
}Create security group
Create a security group (a virtual firewall). It starts with no inbound rules - add some with Authorize inbound rule.
Inputs
- Group name
group_nametextRequired - Unique within the VPC, up to 255 characters, not starting with 'sg-'.
- Description
descriptiontextRequired - Up to 255 characters. It cannot be changed later.
- VPC ID
vpc_idtext - Optional VPC (vpc-...). Default: the region's default VPC.
- Tags
tagsobject - Optional tags as key/value pairs.
Outputs
resultobject
Example output
{
"result": {
"arn": "arn:aws:ec2:us-east-1:123456789012:security-group/sg-0a1b2c3d4e5f67890",
"description": "Web servers",
"group_id": "sg-0a1b2c3d4e5f67890",
"group_name": "web",
"tags": {},
"vpc_id": null
}
}Create snapshot
Back up an EBS volume to a snapshot. It starts 'pending' and completes in the background; snapshots are billed per GiB-month.
Inputs
- Volume ID
volume_idtextRequired - The volume (vol-...) to back up. Give the id, its ARN, or the link to it in the EC2 console.
- Description
descriptiontext - Optional, up to 255 characters.
- Name
nametext - Optional. Saved as the 'Name' tag, which the EC2 console shows.
- Tags
tagsobject - Optional tags as key/value pairs.
Outputs
resultobject
Example output
{
"result": {
"description": "Nightly backup",
"encrypted": false,
"name": "nightly",
"owner_id": "123456789012",
"progress": "0%",
"snapshot_id": "snap-0a1b2c3d4e5f67890",
"start_time": "2026-09-29T10:00:00Z",
"state": "pending",
"storage_tier": "standard",
"tags": {
"Name": "nightly"
},
"volume_id": "vol-0a1b2c3d4e5f67890",
"volume_size": 8
}
}Create volume
Create an EBS volume in an Availability Zone, empty or from a snapshot. Volumes are billed per GiB-month until deleted.
Inputs
- Availability Zone
availability_zonetextRequired - Where to create it - the zone of the instance it will attach to.
- Size (GiB)
sizenumber - 1-65536 GiB for gp3 (st1/sc1 need at least 125). Required unless restoring a snapshot.From 1 to 65536.
- Volume type
volume_typetext - Default gp3.One of:
gp3(gp3 - General Purpose SSD (recommended)),gp2(gp2 - General Purpose SSD (previous generation)),standard(standard - Magnetic),st1(st1 - Throughput Optimized HDD (min 125 GiB)),sc1(sc1 - Cold HDD (min 125 GiB)). - From snapshot
snapshot_idtext - Optional snapshot (snap-...) to restore.
- IOPS (gp3)
iopsnumber - gp3 only, 3000-80000. Default 3000.From 3000 to 80000.
- Throughput MiB/s (gp3)
throughputnumber - gp3 only, 125-2000. Default 125.From 125 to 2000.
- Encrypted
encryptedtrue/false - Encrypt with the account's default EBS key. Default: the account's encryption-by-default setting.
- Name
nametext - Optional. Saved as the 'Name' tag, which the EC2 console shows.
- Tags
tagsobject - Optional tags as key/value pairs.
- Wait until available
wait_until_availabletrue/false - Keep the step going until the volume is 'available' (up to 2 minutes), so the next step can snapshot or attach it.Default:
true.
Outputs
resultobject
Example output
{
"result": {
"attachments": [],
"availability_zone": "us-east-1a",
"create_time": "2026-09-29T10:00:00Z",
"encrypted": false,
"iops": 3000,
"name": "data",
"size": 8,
"snapshot_id": null,
"state": "available",
"tags": {
"Name": "data"
},
"throughput": 125,
"volume_id": "vol-0a1b2c3d4e5f67890",
"volume_type": "gp3",
"wait_timed_out": false
}
}Delete volume
Permanently delete an EBS volume that is not attached. Its data is gone unless you have a snapshot.
Inputs
- Volume ID
volume_idtextRequired - The volume (vol-...). Give the id, its ARN, or the link to it in the EC2 console.
Outputs
resultobject
Example output
{
"result": {
"deleted": true,
"volume_id": "vol-0a1b2c3d4e5f67890"
}
}Get instance status
Read the health checks (instance and system status) and scheduled events of EC2 instances.
Inputs
- Instance IDs
instance_idslist - Only these instances (i-...). Each can be the id, its ARN, or the link to it in the EC2 console.
- Include stopped instances
include_all_instancestrue/false - Also report instances that are not running. On by default; off reports running instances only.Default:
true. - Page size
max_resultsnumber - How many records to return per page, 5-1000. Default 100. Ignored when ids are given.From 5 to 1000.
- Next page token
next_tokentext - The 'next_token' from the previous page, to read the next one.
Outputs
resultobject
Example output
{
"result": {
"count": 1,
"next_token": null,
"statuses": [
{
"attached_ebs_status": "ok",
"availability_zone": "us-east-1a",
"events": [],
"instance_id": "i-0abcd1234efgh5678",
"instance_status": "ok",
"state": "running",
"system_status": "ok"
}
]
}
}Launch instance
Launch new EC2 instances from an AMI. Running instances are billed until stopped or terminated (Free plan accounts: use a free-tier type such as t3.micro).
Inputs
- AMI ID
image_idtextRequired - The AMI (ami-...) to launch from. AMI ids differ per region; List images finds the latest one.
- Instance type
instance_typetext - Default t3.micro. t4g types need an arm64 AMI. Free plan accounts can only launch t3.micro, t3.small, t4g.micro, t4g.small, c7i-flex.large, m7i-flex.large.
- Name
nametext - Optional. Saved as the 'Name' tag, which the EC2 console shows.
- Key pair
key_nametext - Optional key pair for SSH access.
- Security groups
security_group_idslist - Optional. Without any, the VPC's default security group is used.
- Subnet ID
subnet_idtext - Optional subnet (subnet-...). Without one, a default subnet of the default VPC is used.
- User data
user_datatext - Optional start-up script or cloud-init config, as plain text (it is base64-encoded for you). Up to 16 KB.
- Number of instances
instance_countnumber - How many identical instances to launch. Default 1.From 1 to 20.
- Root volume size (GiB)
root_volume_sizenumber - Optional. Default is the AMI's own size (8 GiB for Amazon Linux). The free tier covers 30 GiB of EBS.From 1 to 16384.
- When shut down from inside
shutdown_behaviortext - What happens when the operating system shuts down. Default: stop.One of:
stop(Stop the instance),terminate(Terminate the instance). - Tags
tagsobject - Optional tags as key/value pairs.
- Idempotency token
client_tokentext - Optional, up to 64 characters. Repeating a launch with the same token returns the first launch instead of starting more instances.
- Wait until running
wait_until_runningtrue/false - Keep the step going until every instance is 'running' (up to 5 minutes), so the next step can use it and the public IP address is filled in. Turn off to return straight away.Default:
true.
Outputs
resultobject
Example output
{
"result": {
"instance_id": "i-0abcd1234efgh5678",
"instance_ids": [
"i-0abcd1234efgh5678"
],
"instances": [
{
"architecture": "x86_64",
"availability_zone": "us-east-1a",
"image_id": "ami-0123456789abcdef0",
"instance_id": "i-0abcd1234efgh5678",
"instance_type": "t3.micro",
"key_name": "my-key",
"launch_time": "2026-09-29T10:00:00Z",
"name": "web-1",
"platform_details": "Linux/UNIX",
"private_dns_name": "ip-172-31-16-10.ec2.internal",
"private_ip_address": "172.31.16.10",
"public_dns_name": "ec2-3-80-1-2.compute-1.amazonaws.com",
"public_ip_address": "3.80.1.2",
"security_groups": [
{
"group_id": "sg-0a1b2c3d4e5f67890",
"group_name": "web"
}
],
"state": "running",
"state_reason": null,
"subnet_id": "subnet-0a1b2c3d",
"tags": {
"Name": "web-1"
},
"vpc_id": "vpc-0a1b2c3d"
}
],
"reservation_id": "r-0a1b2c3d4e5f67890",
"wait_timed_out": false
}
}List availability zones
List the Availability Zones of the connection's region, with their state.
Inputs
- Include Local and Wavelength Zones
all_zonestrue/false - Also list Local Zones and Wavelength Zones, including ones not opted in.Default:
false.
Outputs
resultobject
Example output
{
"result": {
"count": 1,
"zones": [
{
"group_name": "us-east-1-zg-1",
"opt_in_status": "opt-in-not-required",
"region_name": "us-east-1",
"state": "available",
"zone_id": "use1-az1",
"zone_name": "us-east-1a",
"zone_type": "availability-zone"
}
]
}
}List images
Find AMIs to launch from, newest first - for example the latest Amazon Linux with name pattern 'al2023-ami-2023*-x86_64'.
Inputs
- AMI IDs
image_idslist - Only these AMIs (ami-...).
- Owner
ownertext - Whose AMIs. Default Amazon (unless AMI IDs are given) - without an owner EC2 would list every public AMI.One of:
amazon(Amazon (official AMIs)),self(This account),aws-marketplace(AWS Marketplace). - Name pattern
nametext - AMI name, with * and ? wildcards, e.g. 'al2023-ami-2023*-x86_64' or 'ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*'.
- Architecture
architecturetext - Only AMIs for this processor architecture.One of:
x86_64(x86_64 (Intel/AMD)),arm64(arm64 (Graviton)),i386. - Free tier eligible only
free_tier_onlytrue/false - Only AMIs AWS marks as free-tier eligible.Default:
false. - Maximum images
max_resultsnumber - How many of the newest matches to return, 1-1000. Default 50.From 1 to 1000.
Outputs
resultobject
Example output
{
"result": {
"count": 1,
"images": [
{
"architecture": "x86_64",
"creation_date": "2026-09-15T20:00:00Z",
"deprecation_time": "2028-09-15T20:00:00Z",
"description": "Amazon Linux 2023 AMI",
"free_tier_eligible": true,
"image_id": "ami-0123456789abcdef0",
"name": "al2023-ami-2023.8.20260915.0-kernel-6.1-x86_64",
"owner_alias": "amazon",
"owner_id": "137112412989",
"platform_details": "Linux/UNIX",
"public": true,
"root_device_name": "/dev/xvda",
"root_device_type": "ebs",
"state": "available",
"tags": {},
"virtualization_type": "hvm"
}
],
"total_matched": 1,
"truncated": false
}
}List instances
List EC2 instances in the connection's region, optionally only some ids, states or filters (such as a tag).
Inputs
- Instance IDs
instance_idslist - Only these instances (i-...). Each can be the id, its ARN, or the link to it in the EC2 console.
- States
stateslist - Only instances in these states.One or more of:
pending,running,shutting-down,terminated,stopping,stopped. - Other filters
filtersobject - Extra EC2 filters as filter name to value (or list of values), e.g. 'tag:env' = 'prod' or 'instance-type' = 't3.micro'. Values may use * and ? wildcards.
- Page size
max_resultsnumber - How many records to return per page, 5-1000. Default 100. Ignored when ids are given.From 5 to 1000.
- Next page token
next_tokentext - The 'next_token' from the previous page, to read the next one.
Outputs
resultobject
Example output
{
"result": {
"count": 1,
"instances": [
{
"architecture": "x86_64",
"availability_zone": "us-east-1a",
"image_id": "ami-0123456789abcdef0",
"instance_id": "i-0abcd1234efgh5678",
"instance_type": "t3.micro",
"key_name": "my-key",
"launch_time": "2026-09-29T10:00:00Z",
"name": "web-1",
"platform_details": "Linux/UNIX",
"private_dns_name": "ip-172-31-16-10.ec2.internal",
"private_ip_address": "172.31.16.10",
"public_dns_name": "ec2-3-80-1-2.compute-1.amazonaws.com",
"public_ip_address": "3.80.1.2",
"security_groups": [
{
"group_id": "sg-0a1b2c3d4e5f67890",
"group_name": "web"
}
],
"state": "running",
"state_reason": null,
"subnet_id": "subnet-0a1b2c3d",
"tags": {
"Name": "web-1"
},
"vpc_id": "vpc-0a1b2c3d"
}
],
"next_token": null
}
}List key pairs
List the SSH key pairs in the connection's region.
Inputs
- Key pair names
key_nameslist - Only these key pairs.
- Include public key
include_public_keytrue/false - Also return each key pair's public key.Default:
false.
Outputs
resultobject
Example output
{
"result": {
"count": 1,
"key_pairs": [
{
"create_time": "2026-09-01T10:00:00Z",
"fingerprint": "Pq9Hc2Wk...",
"key_name": "my-key",
"key_pair_id": "key-0a1b2c3d4e5f67890",
"key_type": "ed25519",
"public_key": null,
"tags": {}
}
]
}
}List security groups
List security groups with their inbound and outbound rules.
Inputs
- Security group IDs
group_idslist - Only these security groups (sg-...).
- Group name
group_nametext - Only groups with this name (* wildcards allowed).
- VPC ID
vpc_idtext - Only groups in this VPC (vpc-...).
- Other filters
filtersobject - Extra EC2 filters as filter name to value (or list of values), e.g. 'tag:env' = 'prod' or 'instance-type' = 't3.micro'. Values may use * and ? wildcards.
- Page size
max_resultsnumber - How many records to return per page, 5-1000. Default 100. Ignored when ids are given.From 5 to 1000.
- Next page token
next_tokentext - The 'next_token' from the previous page, to read the next one.
Outputs
resultobject
Example output
{
"result": {
"count": 1,
"next_token": null,
"security_groups": [
{
"arn": "arn:aws:ec2:us-east-1:123456789012:security-group/sg-0a1b2c3d4e5f67890",
"description": "Web servers",
"group_id": "sg-0a1b2c3d4e5f67890",
"group_name": "web",
"inbound_rules": [
{
"from_port": 22,
"ipv4_ranges": [
"203.0.113.0/24"
],
"ipv6_ranges": [],
"prefix_list_ids": [],
"protocol": "tcp",
"source_group_ids": [],
"to_port": 22
}
],
"outbound_rules": [
{
"from_port": null,
"ipv4_ranges": [
"0.0.0.0/0"
],
"ipv6_ranges": [],
"prefix_list_ids": [],
"protocol": "all",
"source_group_ids": [],
"to_port": null
}
],
"owner_id": "123456789012",
"tags": {},
"vpc_id": "vpc-0a1b2c3d"
}
]
}
}List snapshots
List EBS snapshots - by default this account's own.
Inputs
- Snapshot IDs
snapshot_idslist - Only these snapshots (snap-...).
- Owner
ownertext - Whose snapshots. Default this account (unless snapshot IDs are given).One of:
self(This account),amazon. - Of volume
volume_idtext - Only snapshots of this volume (vol-...).
- States
stateslist - Only snapshots in these states.One or more of:
pending,completed,error. - Other filters
filtersobject - Extra EC2 filters as filter name to value (or list of values), e.g. 'tag:env' = 'prod' or 'instance-type' = 't3.micro'. Values may use * and ? wildcards.
- Page size
max_resultsnumber - How many records to return per page, 5-1000. Default 100. Ignored when ids are given.From 5 to 1000.
- Next page token
next_tokentext - The 'next_token' from the previous page, to read the next one.
Outputs
resultobject
Example output
{
"result": {
"count": 1,
"next_token": null,
"snapshots": [
{
"description": "Nightly backup",
"encrypted": false,
"name": "nightly",
"owner_id": "123456789012",
"progress": "100%",
"snapshot_id": "snap-0a1b2c3d4e5f67890",
"start_time": "2026-09-29T10:00:00Z",
"state": "completed",
"storage_tier": "standard",
"tags": {
"Name": "nightly"
},
"volume_id": "vol-0a1b2c3d4e5f67890",
"volume_size": 8
}
]
}
}List volumes
List EBS volumes, optionally by id, state or attached instance.
Inputs
- Volume IDs
volume_idslist - Only these volumes (vol-...). Each can be the id, its ARN, or the link to it in the EC2 console.
- States
stateslist - Only volumes in these states.One or more of:
creating,available,in-use,deleting,deleted,error. - Attached to instance
instance_idtext - Only volumes attached to this instance (i-...).
- Other filters
filtersobject - Extra EC2 filters as filter name to value (or list of values), e.g. 'tag:env' = 'prod' or 'instance-type' = 't3.micro'. Values may use * and ? wildcards.
- Page size
max_resultsnumber - How many records to return per page, 5-1000. Default 100. Ignored when ids are given.From 5 to 1000.
- Next page token
next_tokentext - The 'next_token' from the previous page, to read the next one.
Outputs
resultobject
Example output
{
"result": {
"count": 1,
"next_token": null,
"volumes": [
{
"attachments": [],
"availability_zone": "us-east-1a",
"create_time": "2026-09-29T10:00:00Z",
"encrypted": false,
"iops": 3000,
"name": "data",
"size": 8,
"snapshot_id": null,
"state": "available",
"tags": {
"Name": "data"
},
"throughput": 125,
"volume_id": "vol-0a1b2c3d4e5f67890",
"volume_type": "gp3"
}
]
}
}Reboot instances
Reboot running EC2 instances. They keep their IP addresses and data; the request returns before the reboot finishes.
Inputs
- Instance IDs
instance_idslistRequired - One or more instances (i-...). Each can be the id, its ARN, or the link to it in the EC2 console. List instances finds them.
Outputs
resultobject
Example output
{
"result": {
"instance_ids": [
"i-0abcd1234efgh5678"
],
"rebooted": true
}
}Remove tags
Remove tags, by key, from EC2 resources. Only the keys listed are removed, whatever their value.
Inputs
- Resource IDs
resource_idslistRequired - Any EC2 resources: instances (i-...), volumes (vol-...), snapshots (snap-...), security groups (sg-...), AMIs (ami-...) and more. Each can be the id, its ARN, or the link to it in the EC2 console.
- Tag keys
tag_keyslistRequired - The keys of the tags to remove.
Outputs
resultobject
Example output
{
"result": {
"removed": true,
"resource_ids": [
"i-0abcd1234efgh5678"
],
"tag_keys": [
"env"
]
}
}Start instances
Start stopped EC2 instances. Billing resumes once running.
Inputs
- Instance IDs
instance_idslistRequired - One or more instances (i-...). Each can be the id, its ARN, or the link to it in the EC2 console. List instances finds them.
- Wait until running
wait_until_runningtrue/false - Keep the step going until every instance is 'running' (up to 5 minutes), so the next step can use it and the public IP address is filled in. Turn off to return straight away.Default:
true.
Outputs
resultobject
Example output
{
"result": {
"instance_ids": [
"i-0abcd1234efgh5678"
],
"instances": [
{
"current_state": "running",
"instance_id": "i-0abcd1234efgh5678",
"previous_state": "stopped"
}
],
"wait_timed_out": false
}
}Stop instances
Stop running EC2 instances. Their EBS volumes are kept (and billed); memory contents are lost.
Inputs
- Instance IDs
instance_idslistRequired - One or more instances (i-...). Each can be the id, its ARN, or the link to it in the EC2 console. List instances finds them.
- Force
forcetrue/false - Force the instances to stop if they are stuck. They get no chance to flush file system caches, so use only as a last resort.Default:
false. - Skip graceful OS shutdown
skip_os_shutdowntrue/false - Skip the operating system's graceful shutdown, for a faster stop. Unsaved data in memory is lost.Default:
false. - Wait until stopped
wait_until_stoppedtrue/false - Keep the step going until every instance is 'stopped' (up to 5 minutes). Turn off to return straight away.Default:
true.
Outputs
resultobject
Example output
{
"result": {
"instance_ids": [
"i-0abcd1234efgh5678"
],
"instances": [
{
"current_state": "stopped",
"instance_id": "i-0abcd1234efgh5678",
"previous_state": "running"
}
],
"wait_timed_out": false
}
}Terminate instances
Permanently delete EC2 instances. This cannot be undone: instance-store data and root volumes set to delete on termination are destroyed.
Inputs
- Instance IDs
instance_idslistRequired - One or more instances (i-...). Each can be the id, its ARN, or the link to it in the EC2 console. List instances finds them.
- Force
forcetrue/false - Force the instances to stop if they are stuck. They get no chance to flush file system caches, so use only as a last resort.Default:
false. - Skip graceful OS shutdown
skip_os_shutdowntrue/false - Skip the operating system's graceful shutdown, for a faster stop. Unsaved data in memory is lost.Default:
false.
Outputs
resultobject
Example output
{
"result": {
"instance_ids": [
"i-0abcd1234efgh5678"
],
"instances": [
{
"current_state": "shutting-down",
"instance_id": "i-0abcd1234efgh5678",
"previous_state": "running"
}
]
}
}