forms.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. package infra
  2. const testForm = `name: Test
  3. hasSource: false
  4. includeHiddenFields: true
  5. isClusterScoped: true
  6. tabs:
  7. - name: main
  8. label: Configuration
  9. sections:
  10. - name: section_one
  11. contents:
  12. - type: heading
  13. label: String to echo
  14. - type: string-input
  15. variable: echo
  16. settings:
  17. default: hello
  18. `
  19. const rdsForm = `name: RDS
  20. hasSource: false
  21. includeHiddenFields: true
  22. isClusterScoped: true
  23. tabs:
  24. - name: main
  25. label: Main
  26. sections:
  27. - name: heading
  28. contents:
  29. - type: heading
  30. label: Database Settings
  31. - name: user
  32. contents:
  33. - type: string-input
  34. label: Database Master User
  35. required: true
  36. placeholder: "admin"
  37. variable: db_user
  38. - name: password
  39. contents:
  40. - type: string-input
  41. required: true
  42. label: Database Master Password
  43. variable: db_passwd
  44. - name: name
  45. contents:
  46. - type: string-input
  47. label: Database Name
  48. required: true
  49. placeholder: "rds-staging"
  50. variable: db_name
  51. - name: machine-type
  52. contents:
  53. - type: select
  54. label: ⚙️ Database Machine Type
  55. variable: machine_type
  56. settings:
  57. default: db.t3.medium
  58. options:
  59. - label: db.t2.medium
  60. value: db.t2.medium
  61. - label: db.t2.xlarge
  62. value: db.t2.xlarge
  63. - label: db.t2.2xlarge
  64. value: db.t2.2xlarge
  65. - label: db.t3.medium
  66. value: db.t3.medium
  67. - label: db.t3.xlarge
  68. value: db.t3.xlarge
  69. - label: db.t3.2xlarge
  70. value: db.t3.2xlarge
  71. - name: family-versions
  72. contents:
  73. - type: select
  74. label: Database Family Version
  75. variable: db_family
  76. settings:
  77. default: postgres13
  78. options:
  79. - label: "Postgres 9"
  80. value: postgres9
  81. - label: "Postgres 10"
  82. value: postgres10
  83. - label: "Postgres 11"
  84. value: postgres11
  85. - label: "Postgres 12"
  86. value: postgres12
  87. - label: "Postgres 13"
  88. value: postgres13
  89. - name: pg-9-versions
  90. show_if:
  91. is: "postgres9"
  92. variable: db_family
  93. contents:
  94. - type: select
  95. label: Database Version
  96. variable: db_engine_version
  97. settings:
  98. default: "9.6.23"
  99. options:
  100. - label: "v9.6.1"
  101. value: "9.6.1"
  102. - label: "v9.6.2"
  103. value: "9.6.2"
  104. - label: "v9.6.3"
  105. value: "9.6.3"
  106. - label: "v9.6.4"
  107. value: "9.6.4"
  108. - label: "v9.6.5"
  109. value: "9.6.5"
  110. - label: "v9.6.6"
  111. value: "9.6.6"
  112. - label: "v9.6.7"
  113. value: "9.6.7"
  114. - label: "v9.6.8"
  115. value: "9.6.8"
  116. - label: "v9.6.10"
  117. value: "9.6.10"
  118. - label: "v9.6.11"
  119. value: "9.6.11"
  120. - label: "v9.6.12"
  121. value: "9.6.12"
  122. - label: "v9.6.13"
  123. value: "9.6.13"
  124. - label: "v9.6.14"
  125. value: "9.6.14"
  126. - label: "v9.6.15"
  127. value: "9.6.15"
  128. - label: "v9.6.16"
  129. value: "9.6.16"
  130. - label: "v9.6.17"
  131. value: "9.6.17"
  132. - label: "v9.6.18"
  133. value: "9.6.18"
  134. - label: "v9.6.19"
  135. value: "9.6.19"
  136. - label: "v9.6.20"
  137. value: "9.6.20"
  138. - label: "v9.6.21"
  139. value: "9.6.21"
  140. - label: "v9.6.22"
  141. value: "9.6.22"
  142. - label: "v9.6.23"
  143. value: "9.6.23"
  144. - name: pg-10-versions
  145. show_if:
  146. is: "postgres10"
  147. variable: db_family
  148. contents:
  149. - type: select
  150. label: Database Version
  151. variable: db_engine_version
  152. settings:
  153. default: "10.18"
  154. options:
  155. - label: "v10.1"
  156. value: "10.1"
  157. - label: "v10.2"
  158. value: "10.2"
  159. - label: "v10.3"
  160. value: "10.3"
  161. - label: "v10.4"
  162. value: "10.4"
  163. - label: "v10.5"
  164. value: "10.5"
  165. - label: "v10.6"
  166. value: "10.6"
  167. - label: "v10.7"
  168. value: "10.7"
  169. - label: "v10.8"
  170. value: "10.8"
  171. - label: "v10.9"
  172. value: "10.9"
  173. - label: "v10.10"
  174. value: "10.10"
  175. - label: "v10.11"
  176. value: "10.11"
  177. - label: "v10.12"
  178. value: "10.12"
  179. - label: "v10.13"
  180. value: "10.13"
  181. - label: "v10.14"
  182. value: "10.14"
  183. - label: "v10.15"
  184. value: "10.15"
  185. - label: "v10.16"
  186. value: "10.16"
  187. - label: "v10.17"
  188. value: "10.17"
  189. - label: "v10.18"
  190. value: "10.18"
  191. - name: pg-11-versions
  192. show_if:
  193. is: "postgres11"
  194. variable: db_family
  195. contents:
  196. - type: select
  197. label: Database Version
  198. variable: db_engine_version
  199. settings:
  200. default: "11.13"
  201. options:
  202. - label: "v11.1"
  203. value: "11.1"
  204. - label: "v11.2"
  205. value: "11.2"
  206. - label: "v11.3"
  207. value: "11.3"
  208. - label: "v11.4"
  209. value: "11.4"
  210. - label: "v11.5"
  211. value: "11.5"
  212. - label: "v11.6"
  213. value: "11.6"
  214. - label: "v11.7"
  215. value: "11.7"
  216. - label: "v11.8"
  217. value: "11.8"
  218. - label: "v11.9"
  219. value: "11.9"
  220. - label: "v11.10"
  221. value: "11.10"
  222. - label: "v11.11"
  223. value: "11.11"
  224. - label: "v11.12"
  225. value: "11.12"
  226. - label: "v11.13"
  227. value: "11.13"
  228. - name: pg-12-versions
  229. show_if:
  230. is: "postgres12"
  231. variable: db_family
  232. contents:
  233. - type: select
  234. label: Database Version
  235. variable: db_engine_version
  236. settings:
  237. default: "12.8"
  238. options:
  239. - label: "v12.2"
  240. value: "12.2"
  241. - label: "v12.3"
  242. value: "12.3"
  243. - label: "v12.4"
  244. value: "12.4"
  245. - label: "v12.5"
  246. value: "12.5"
  247. - label: "v12.6"
  248. value: "12.6"
  249. - label: "v12.7"
  250. value: "12.7"
  251. - label: "v12.8"
  252. value: "12.8"
  253. - label: "v12.10"
  254. value: "12.10"
  255. - name: pg-13-versions
  256. show_if:
  257. is: "postgres13"
  258. variable: db_family
  259. contents:
  260. - type: select
  261. label: Database Version
  262. variable: db_engine_version
  263. settings:
  264. default: "13.4"
  265. options:
  266. - label: "v13.1"
  267. value: "13.1"
  268. - label: "v13.2"
  269. value: "13.2"
  270. - label: "v13.3"
  271. value: "13.3"
  272. - label: "v13.4"
  273. value: "13.4"
  274. - label: "v13.6"
  275. value: "13.6"
  276. - name: additional-settings
  277. contents:
  278. - type: heading
  279. label: Additional Settings
  280. - type: checkbox
  281. variable: db_deletion_protection
  282. label: Enable deletion protection for the database.
  283. settings:
  284. default: false
  285. - name: storage
  286. label: Storage
  287. sections:
  288. - name: storage
  289. contents:
  290. - type: heading
  291. label: Storage Settings
  292. - type: number-input
  293. label: Specify the amount of storage to allocate to this instance in gigabytes.
  294. variable: db_allocated_storage
  295. placeholder: "ex: 10"
  296. settings:
  297. default: 10
  298. - type: number-input
  299. label: Specify the maximum storage that this instance can scale to in gigabytes.
  300. variable: db_max_allocated_storage
  301. placeholder: "ex: 20"
  302. settings:
  303. default: 20
  304. - type: checkbox
  305. variable: db_storage_encrypted
  306. label: Enable storage encryption for the database.
  307. settings:
  308. default: false
  309. - name: advanced
  310. label: Advanced
  311. sections:
  312. - name: replicas
  313. contents:
  314. - type: heading
  315. label: Read Replicas
  316. - type: subtitle
  317. label: Specify the number of read replicas to run alongside your RDS instance.
  318. - type: number-input
  319. label: Replicas
  320. variable: db_replicas
  321. placeholder: "ex: 1"
  322. settings:
  323. default: 0`
  324. const ecrForm = `name: ECR
  325. hasSource: false
  326. includeHiddenFields: true
  327. tabs:
  328. - name: main
  329. label: Configuration
  330. sections:
  331. - name: section_one
  332. contents:
  333. - type: heading
  334. label: ECR Configuration
  335. - type: string-input
  336. label: ECR Name
  337. required: true
  338. placeholder: my-awesome-registry
  339. variable: ecr_name
  340. `
  341. const eksForm = `name: EKS
  342. hasSource: false
  343. includeHiddenFields: true
  344. tabs:
  345. - name: main
  346. label: Configuration
  347. sections:
  348. - name: section_one
  349. contents:
  350. - type: heading
  351. label: EKS Configuration
  352. - type: select
  353. label: ⚙️ AWS Machine Type
  354. variable: machine_type
  355. settings:
  356. default: t2.medium
  357. options:
  358. - label: t2.medium
  359. value: t2.medium
  360. - label: t2.xlarge
  361. value: t2.xlarge
  362. - label: t2.2xlarge
  363. value: t2.2xlarge
  364. - label: t3.medium
  365. value: t3.medium
  366. - label: t3.xlarge
  367. value: t3.xlarge
  368. - label: t3.2xlarge
  369. value: t3.2xlarge
  370. - type: string-input
  371. label: 👤 Issuer Email
  372. required: true
  373. placeholder: example@example.com
  374. variable: issuer_email
  375. - type: string-input
  376. label: EKS Cluster Name
  377. required: true
  378. placeholder: my-cluster
  379. variable: cluster_name
  380. - type: number-input
  381. label: Maximum number of EC2 instances to create in the application autoscaling group.
  382. variable: max_instances
  383. placeholder: "ex: 10"
  384. settings:
  385. default: 10
  386. - name: advanced
  387. label: Advanced
  388. sections:
  389. - name: spot_instance_should_enable
  390. contents:
  391. - type: heading
  392. label: Spot Instance Settings
  393. - type: checkbox
  394. variable: spot_instances_enabled
  395. label: Enable spot instances for this cluster.
  396. settings:
  397. default: false
  398. - name: spot_instance_price
  399. show_if: spot_instances_enabled
  400. contents:
  401. - type: string-input
  402. label: Assign a bid price for the spot instance (optional).
  403. variable: spot_price
  404. placeholder: "ex: 0.05"
  405. - name: net_settings
  406. contents:
  407. - type: heading
  408. label: Networking Settings
  409. - type: string-input
  410. label: "Add a different CIDR range prefix (first two octets: for example 10.99 will create a VPC with CIDR range 10.99.0.0/16)."
  411. variable: cluster_vpc_cidr_octets
  412. placeholder: "ex: 10.99"
  413. settings:
  414. default: "10.99"
  415. `
  416. const gcrForm = `name: GCR
  417. hasSource: false
  418. includeHiddenFields: true
  419. tabs:
  420. - name: main
  421. label: Configuration
  422. sections:
  423. - name: section_one
  424. contents:
  425. - type: heading
  426. label: GCR Configuration
  427. - type: select
  428. label: 📍 GCP Region
  429. variable: gcp_region
  430. settings:
  431. default: us-central1
  432. options:
  433. - label: asia-east1
  434. value: asia-east1
  435. - label: asia-east2
  436. value: asia-east2
  437. - label: asia-northeast1
  438. value: asia-northeast1
  439. - label: asia-northeast2
  440. value: asia-northeast2
  441. - label: asia-northeast3
  442. value: asia-northeast3
  443. - label: asia-south1
  444. value: asia-south1
  445. - label: asia-southeast1
  446. value: asia-southeast1
  447. - label: asia-southeast2
  448. value: asia-southeast2
  449. - label: australia-southeast1
  450. value: australia-southeast1
  451. - label: europe-north1
  452. value: europe-north1
  453. - label: europe-west1
  454. value: europe-west1
  455. - label: europe-west2
  456. value: europe-west2
  457. - label: europe-west3
  458. value: europe-west3
  459. - label: europe-west4
  460. value: europe-west4
  461. - label: europe-west6
  462. value: europe-west6
  463. - label: northamerica-northeast1
  464. value: northamerica-northeast1
  465. - label: southamerica-east1
  466. value: southamerica-east1
  467. - label: us-central1
  468. value: us-central1
  469. - label: us-east1
  470. value: us-east1
  471. - label: us-east4
  472. value: us-east4
  473. - label: us-east1
  474. value: us-east1
  475. - label: us-east1
  476. value: us-east1
  477. - label: us-west1
  478. value: us-west1
  479. - label: us-east1
  480. value: us-west2
  481. - label: us-west3
  482. value: us-west3
  483. - label: us-west4
  484. value: us-west4
  485. `
  486. const gkeForm = `name: GKE
  487. hasSource: false
  488. includeHiddenFields: true
  489. tabs:
  490. - name: main
  491. label: Configuration
  492. sections:
  493. - name: section_one
  494. contents:
  495. - type: heading
  496. label: GKE Configuration
  497. - type: select
  498. label: 📍 GCP Region
  499. variable: gcp_region
  500. settings:
  501. default: us-central1
  502. options:
  503. - label: asia-east1
  504. value: asia-east1
  505. - label: asia-east2
  506. value: asia-east2
  507. - label: asia-northeast1
  508. value: asia-northeast1
  509. - label: asia-northeast2
  510. value: asia-northeast2
  511. - label: asia-northeast3
  512. value: asia-northeast3
  513. - label: asia-south1
  514. value: asia-south1
  515. - label: asia-southeast1
  516. value: asia-southeast1
  517. - label: asia-southeast2
  518. value: asia-southeast2
  519. - label: australia-southeast1
  520. value: australia-southeast1
  521. - label: europe-north1
  522. value: europe-north1
  523. - label: europe-west1
  524. value: europe-west1
  525. - label: europe-west2
  526. value: europe-west2
  527. - label: europe-west3
  528. value: europe-west3
  529. - label: europe-west4
  530. value: europe-west4
  531. - label: europe-west6
  532. value: europe-west6
  533. - label: northamerica-northeast1
  534. value: northamerica-northeast1
  535. - label: southamerica-east1
  536. value: southamerica-east1
  537. - label: us-central1
  538. value: us-central1
  539. - label: us-east1
  540. value: us-east1
  541. - label: us-east4
  542. value: us-east4
  543. - label: us-east1
  544. value: us-east1
  545. - label: us-east1
  546. value: us-east1
  547. - label: us-west1
  548. value: us-west1
  549. - label: us-east1
  550. value: us-west2
  551. - label: us-west3
  552. value: us-west3
  553. - label: us-west4
  554. value: us-west4
  555. - type: string-input
  556. label: 👤 Issuer Email
  557. required: true
  558. placeholder: example@example.com
  559. variable: issuer_email
  560. - type: string-input
  561. label: GKE Cluster Name
  562. required: true
  563. placeholder: my-cluster
  564. variable: cluster_name
  565. `
  566. const docrForm = `name: DOCR
  567. hasSource: false
  568. includeHiddenFields: true
  569. tabs:
  570. - name: main
  571. label: Configuration
  572. sections:
  573. - name: section_one
  574. contents:
  575. - type: heading
  576. label: DOCR Configuration
  577. - type: select
  578. label: DO Subscription Tier
  579. variable: docr_subscription_tier
  580. settings:
  581. default: basic
  582. options:
  583. - label: Basic
  584. value: basic
  585. - label: Professional
  586. value: professional
  587. - type: string-input
  588. label: DOCR Name
  589. required: true
  590. placeholder: my-awesome-registry
  591. variable: docr_name
  592. `
  593. const doksForm = `name: DOKS
  594. hasSource: false
  595. includeHiddenFields: true
  596. tabs:
  597. - name: main
  598. label: Configuration
  599. sections:
  600. - name: section_one
  601. contents:
  602. - type: heading
  603. label: DOKS Configuration
  604. - type: select
  605. label: 📍 DO Region
  606. variable: do_region
  607. settings:
  608. default: nyc1
  609. options:
  610. - label: Amsterdam 3
  611. value: ams3
  612. - label: Bangalore 1
  613. value: blr1
  614. - label: Frankfurt 1
  615. value: fra1
  616. - label: London 1
  617. value: lon1
  618. - label: New York 1
  619. value: nyc1
  620. - label: New York 3
  621. value: nyc3
  622. - label: San Francisco 2
  623. value: sfo2
  624. - label: San Francisco 3
  625. value: sfo3
  626. - label: Singapore 1
  627. value: sgp1
  628. - label: Toronto 1
  629. value: tor1
  630. - type: string-input
  631. label: 👤 Issuer Email
  632. required: true
  633. placeholder: example@example.com
  634. variable: issuer_email
  635. - type: string-input
  636. label: DOKS Cluster Name
  637. required: true
  638. placeholder: my-cluster
  639. variable: cluster_name
  640. `