EC2
This check connects to an AWS account with the specified credentials, launch an EC2 instance with an option for userData.
This test can be used to check the availability of an ami, account service limits, run backup & restore operations, etc.
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: ec2-pass
spec:
interval: 30
spec:
ec2:
- description: test instance
accessKey:
valueFrom:
secretKeyRef:
name: aws-credentials
key: AWS_ACCESS_KEY_ID
secretKey:
valueFrom:
secretKeyRef:
name: aws-credentials
key: AWS_SECRET_ACCESS_KEY
region: af-south-1
userData: |
#!/bin/bash
yum install -y httpd
systemctl start httpd
systemctl enable httpd
usermod -a -G apache ec2-user
chown -R ec2-user:apache /var/www
chmod 2775 /var/www
find /var/www -type d -exec chmod 2775 {} \;
find /var/www -type f -exec chmod 0664 {} \;
securityGroup: WebAccess
| Field | Description | Scheme |
|---|---|---|
ami* | Master image to create EC2 instance from | string |
name* | Name of the check, must be unique within the canary |
|
securityGroup* | Security group to attach to the EC2 instance | string |
canaryRef | Reference Canary object | [[]v1.LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/ |
keepAlive | Keep the EC2 instance running after check completes | string |
region | string | |
timeout | Timeout after to consider the check failed | int |
userData | Configure EC2 instance with user data | string |
waitTime | Set wait-time for EC2 instance launch | int |
description | Description for the check |
|
display | Expression to change the formatting of the display | |
icon | Icon for overwriting default icon on the dashboard | |
labels | Labels for check | map[string]string |
metrics | Metrics to export from | |
test | Evaluate whether a check is healthy | |
transform | Transform data from a check into multiple individual checks | |
connection | The connection to use, mutually exclusive with | |
accessKey | ||
secretKey | ||
region | The AWS region |
|
endpoint | Custom AWS Endpoint to use | string |
skipTLSVerify | Skip TLS verify when connecting to AWS |
|