shalb / cluster.dev

Cloud-native infrastructure templating. Creating cloud installers for SaaS. Replication of complex cloud-native infrastructures.
https://docs.cluster.dev/
GNU Affero General Public License v3.0
401 stars 36 forks source link

Create default subzone for new cluster #2

Closed MaxymVlasov closed 4 years ago

MaxymVlasov commented 4 years ago

Create service that add new subzone (UserID.cluster.dev) for all new clusters by POST request.

  1. Create subzone by TF in user account
  2. Get NS from output and send to cluster.dev API Gateway
  3. API Gteway triggers Lambda
  4. Lambda add NS record that point to user NS'es from step 2.
voatsap commented 4 years ago

Discussed with @gelo22 Lambda workflow: POST (Action(CREATE/UPDATE/DELETE), UserName, NS Servers, ZoneID) -> API Gateway -> Triggers Lambda (R53 record NS user-gh.cluster.dev) -> POST (DynamoDB).

gelo22 commented 4 years ago

What is done: Route53 management via POST request(json) Example for my test tomain:

event['body'] = {
    "Action": "CREATE|DELETE|UPDATE",
    "UserName": "gelo22",
    "NameServers": "ns-1768.awsdns-29.co.uk.,ns-683.awsdns-21.net.,ns-484.awsdns-60.com.,ns-1156.awsdns-16.org.",
    "ZoneID": "Z0978963ADA7KRYE5RPL",
    "DomainName": "test-domain.fun"
}

TODO: Use some naming rules for resources. Add tags for Route53 records if possible(DomainName). Use DynamoDB as records storage Write terraform(version12) code to deploy all things to aws Add Cloudwatch alerting for lambda, integrate with Opsgenie

gelo22 commented 4 years ago

https://github.com/shalb/cluster.dev-domain/pull/1

TODO: Lambda:

Cloudwatch:

Terraform:

Fixes:

insights doc

fields @timestamp, @message
| filter message="Exception"
| sort @timestamp desc
| limit 20

filter doc { $.message = "Exception" }

voatsap commented 4 years ago

cluster-dev support for domains merged: https://github.com/shalb/cluster.dev/pull/60

voatsap commented 4 years ago

close due inaction. Base functions works as expected.