“Have you tried turning it off and on again?” That’s usually the quickest and the most efficient advice you can tell someone debugging a problem. Sometimes there are things between heaven an earth that can’t be explained but can be solved by restarting a server.
For these cases Buttonize brings EC2InstanceControlPanel
construct. Let your L1 support or even non-technical colleagues handle the basic operations around EC2 instances.
Features
- CPU Utilization chart for the past hour
- Status information
- Actions
- Start - calls
StartInstances
EC2 API to start the instance if it’s stopped - Stop - calls
StopInstances
EC2 API to stop the instance if it’s running - Reboot - calls
RebootInstances
EC2 API to reboot the instance if it’s running
- Start - calls
Preview
Usage
In case you create EC2 instance in CDK
import * as cdk from 'aws-cdk-lib'import { AmazonLinuxImage, Instance, InstanceClass, InstanceSize, InstanceType, Vpc } from 'aws-cdk-lib/aws-ec2'import { Buttonize } from 'buttonize/cdk'import { EC2InstanceControlPanel } from 'buttonize/library'import { Construct } from 'constructs'
export class CdkStack extends cdk.Stack { constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props)
Buttonize.init(this, { apiKey: 'YOUR_API_KEY' })
const defaultVpc = Vpc.fromLookup(this, 'VPC', { isDefault: true })
const ec2Instance = new Instance(this, 'EC2Instance', { instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.MICRO), machineImage: new AmazonLinuxImage(), vpc: defaultVpc })
new EC2InstanceControlPanel(this, 'ControlPanel', { instance: ec2Instance }) }}
In case you create EC2 outside of the CDK scope and know only instance’s ARN
import * as cdk from 'aws-cdk-lib'import { Buttonize } from 'buttonize/cdk'import { EC2InstanceControlPanel } from 'buttonize/library'import { Construct } from 'constructs'
export class CdkStack extends cdk.Stack { constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props)
Buttonize.init(this, { apiKey: 'YOUR_API_KEY' })
new EC2InstanceControlPanel(this, 'ControlPanel', { instanceArn: 'arn:aws:ec2:<region>:<account-number>:instance/<instance-id>' }) }}