NAEOS menyertakan dukungan deployment cloud bawaan. Anda dapat merencanakan, mendeploy, dan menghancurkan infrastruktur cloud langsung dari spesifikasi Anda menggunakan perintah cloud.

Ikhtisar

Integrasi cloud bekerja dalam tiga fase:

  1. Plan — Hasilkan rencana deployment Terraform HCL dari spesifikasi Anda
  2. Deploy — Eksekusi rencana terhadap provider cloud pilihan Anda
  3. Destroy — Hancurkan resource yang di-deploy saat tidak diperlukan

Provider yang Didukung

ProviderLayananStatus
AWSEC2, ECS, Lambda, RDS, S3, CloudFront, VPCStable
GCPGCE, Cloud Run, Cloud SQL, Cloud StorageStable
AzureAKS, Azure Functions, SQL Database, Blob StorageBeta

Konfigurasi

Tambahkan konfigurasi cloud ke spesifikasi Anda:

project: my-service
modules:
  - name: api
    path: ./api
  - name: worker
    path: ./worker
services:
  - name: api-server
    kind: rest
    port: 8080
  - name: queue-worker
    kind: worker
deployment:
  provider: aws
  region: us-east-1
  strategy: ecs-fargate
  resources:
    - type: ecs-service
      name: api
      module: api
      config:
        cpu: 512
        memory: 1024
        desired_count: 2
    - type: sqs-queue
      name: events
      config:
        visibility_timeout: 300
        retention_period: 1209600

Perintah CLI

Plan

Hasilkan rencana deployment tanpa menerapkannya:

naeos cloud plan --provider aws --region us-east-1 --input-file spec.yaml

Ini menghasilkan direktori terraform/ berisi file HCL siap untuk terraform init && terraform apply.

Deploy

Eksekusi deployment:

naeos cloud deploy --provider aws --region us-east-1 --input-file spec.yaml

Perintah deploy:

  1. Menghasilkan rencana Terraform
  2. Menjalankan terraform init
  3. Menjalankan terraform plan dan menampilkan rencana eksekusi
  4. Menerapkan rencana (dengan prompt konfirmasi)
  5. Menghasilkan ID resource dan endpoint

Status

Periksa status resource yang di-deploy:

naeos cloud status

Destroy

Hancurkan semua resource yang di-deploy:

naeos cloud destroy --provider aws --region us-east-1

Tipe Resource

Tipe ResourceAWSGCPAzure
compute-instanceEC2GCEVM
container-serviceECS/FargateCloud RunAKS
serverless-functionLambdaCloud FunctionsAzure Functions
databaseRDSCloud SQLSQL Database
storage-bucketS3Cloud StorageBlob Storage
cdnCloudFrontCloud CDNAzure CDN
queueSQSPub/SubService Bus
cacheElastiCacheMemorystoreRedis Cache

Estimasi Biaya

Perintah plan menyertakan estimasi biaya bulanan:

naeos cloud plan --provider aws --input-file spec.yaml --estimate-cost

Output:

Resource                        Est. Bulanan
─────────────────────────────────────────────
ecs-service/api (2 tasks)       $73.20
rds/postgres-db (db.t3.micro)   $12.40
s3/storage-bucket                $1.20
sqs/events-queue                 $0.40
─────────────────────────────────────────────
Total estimasi:                  $87.20/bulan

Lihat juga: Pipeline Engine, Bahasa Spesifikasi, Governance