Skip to main content
Version: 0.0.25

Table: instance

Table to manage AWS EC2 instances. Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the Amazon Web Services (AWS) Cloud. You can use Amazon EC2 to launch as many or as few virtual servers as you need, configure security and networking, and manage storage.

Example

INSERT INTO instance (ami, instance_type, tags, subnet_id)
SELECT '<internal-ami-id>', 't1.small', '{"name":"test-vm"}', id
FROM subnet
WHERE availability_zone = 'us-east-1a'
LIMIT 1;

UPDATE instance SET role_name = 'role_name' WHERE tags ->> 'name' = 'test-vm';

SELECT * FROM instance WHERE tags ->> 'name' = 'test-vm';

DELETE FROM instance WHERE tags ->> 'name' = 'test-vm';

See

Columns

ami: string

Unique identifier for the image to use on the vm.

See

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html

hibernation_enabled: boolean

Specifies if the hibernation mode is enabled for the instance

See

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html

Optional instance_id: string

Internal AWS ID for the instance

instance_type: string

Type of EC2 instance to spin

See

https://aws.amazon.com/es/ec2/instance-types/

key_pair_name: string

Name of the keypair to use to SSH into the machine

See

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html

region: string

Region for the instance

Optional role: iam_role

Specific role name used to spin the instance

See

security_groups: security_group[]

Reference to the security groups configured for that instance

See

https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html

state: state

Current state of the EC2 instance

Optional subnet: subnet

Reference to the subnets where this instance is connected

See

https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html

Optional tags: Object

Complex type to provide identifier tags for the instance

See

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ec2/interfaces/createvolumecommandinput.html#tagspecifications

Type definition

[key: string]: string

Optional user_data: string

Text blob containing the specific user data to configure the instance

See

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html