Skip to content

Latest commit

 

History

History
66 lines (53 loc) · 1.42 KB

File metadata and controls

66 lines (53 loc) · 1.42 KB

Carpathia

Carpathia is a service for creating and initializing EC2 instances within NGAP (NASA General Applications Platform) AWS environments. Carpathia's also performs automatic rotations of EC2 instances to keep up with NGAP AMI security updates automagically.

Package Lambda

zip carpathia_lambda_function.zip carpathia_lambda_function.py

Terraform Commands

Init

terraform init

Plan with a .tfvar file

terraform plan -var-file="envs/sandbox.tfvars"

Invoke Lambda Function

aws lambda invoke --function-name LAMBDA_FUNCTION response.json

Architecture

flowchart TD;
    EventBridge["AWS EventBridge Rule"] -->|Invokes| Lambda["AWS Lambda Function"]
    Lambda -->|Store Logs| CW["AWS CloudWatch LogGroup"]
    Lambda -->|Fetch AMI ID Parameter| SM["AWS Systems Manager"]
    Lambda -->|Create or Update| LT["AWS Launch Template"]

    LT -->|Create or Update| ASG["AWS Auto Scaling Group"]
    ASG -->|Find Subnet IDs| Subnets["AWS Subnets"]
    Subnets -->|Attach to ASG| ASG
    
    ASG -->|Launch New Instances| EC2["AWS EC2 Instances"]
Loading

S3 to EC2

flowchart TD;

E["/persistent/"]
F["/var/log/podaac/"]
G["/bootstrap/"]
H["/home/ssm-user/"]
    subgraph AWS-S3
        B["var/log/podaac/"]
        C["bootstrap/"]
        D["home/ssm-user/"]
    end

    subgraph EC2

        F --> B
        G --> C
        H --> D
        E -->AWS-S3
    end
Loading