forms.go 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  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. - type: checkbox
  387. variable: spot_instances_enabled
  388. label: Enable spot instances for this cluster.
  389. settings:
  390. default: false
  391. - name: spot_instance_price
  392. show_if: spot_instances_enabled
  393. contents:
  394. - type: string-input
  395. label: Assign a bid price for the spot instance (optional).
  396. variable: spot_price
  397. placeholder: "ex: 0.05"
  398. `
  399. const gcrForm = `name: GCR
  400. hasSource: false
  401. includeHiddenFields: true
  402. tabs:
  403. - name: main
  404. label: Configuration
  405. sections:
  406. - name: section_one
  407. contents:
  408. - type: heading
  409. label: GCR Configuration
  410. - type: select
  411. label: 📍 GCP Region
  412. variable: gcp_region
  413. settings:
  414. default: us-central1
  415. options:
  416. - label: asia-east1
  417. value: asia-east1
  418. - label: asia-east2
  419. value: asia-east2
  420. - label: asia-northeast1
  421. value: asia-northeast1
  422. - label: asia-northeast2
  423. value: asia-northeast2
  424. - label: asia-northeast3
  425. value: asia-northeast3
  426. - label: asia-south1
  427. value: asia-south1
  428. - label: asia-southeast1
  429. value: asia-southeast1
  430. - label: asia-southeast2
  431. value: asia-southeast2
  432. - label: australia-southeast1
  433. value: australia-southeast1
  434. - label: europe-north1
  435. value: europe-north1
  436. - label: europe-west1
  437. value: europe-west1
  438. - label: europe-west2
  439. value: europe-west2
  440. - label: europe-west3
  441. value: europe-west3
  442. - label: europe-west4
  443. value: europe-west4
  444. - label: europe-west6
  445. value: europe-west6
  446. - label: northamerica-northeast1
  447. value: northamerica-northeast1
  448. - label: southamerica-east1
  449. value: southamerica-east1
  450. - label: us-central1
  451. value: us-central1
  452. - label: us-east1
  453. value: us-east1
  454. - label: us-east4
  455. value: us-east4
  456. - label: us-east1
  457. value: us-east1
  458. - label: us-east1
  459. value: us-east1
  460. - label: us-west1
  461. value: us-west1
  462. - label: us-east1
  463. value: us-west2
  464. - label: us-west3
  465. value: us-west3
  466. - label: us-west4
  467. value: us-west4
  468. `
  469. const gkeForm = `name: GKE
  470. hasSource: false
  471. includeHiddenFields: true
  472. tabs:
  473. - name: main
  474. label: Configuration
  475. sections:
  476. - name: section_one
  477. contents:
  478. - type: heading
  479. label: GKE Configuration
  480. - type: select
  481. label: 📍 GCP Region
  482. variable: gcp_region
  483. settings:
  484. default: us-central1
  485. options:
  486. - label: asia-east1
  487. value: asia-east1
  488. - label: asia-east2
  489. value: asia-east2
  490. - label: asia-northeast1
  491. value: asia-northeast1
  492. - label: asia-northeast2
  493. value: asia-northeast2
  494. - label: asia-northeast3
  495. value: asia-northeast3
  496. - label: asia-south1
  497. value: asia-south1
  498. - label: asia-southeast1
  499. value: asia-southeast1
  500. - label: asia-southeast2
  501. value: asia-southeast2
  502. - label: australia-southeast1
  503. value: australia-southeast1
  504. - label: europe-north1
  505. value: europe-north1
  506. - label: europe-west1
  507. value: europe-west1
  508. - label: europe-west2
  509. value: europe-west2
  510. - label: europe-west3
  511. value: europe-west3
  512. - label: europe-west4
  513. value: europe-west4
  514. - label: europe-west6
  515. value: europe-west6
  516. - label: northamerica-northeast1
  517. value: northamerica-northeast1
  518. - label: southamerica-east1
  519. value: southamerica-east1
  520. - label: us-central1
  521. value: us-central1
  522. - label: us-east1
  523. value: us-east1
  524. - label: us-east4
  525. value: us-east4
  526. - label: us-east1
  527. value: us-east1
  528. - label: us-east1
  529. value: us-east1
  530. - label: us-west1
  531. value: us-west1
  532. - label: us-east1
  533. value: us-west2
  534. - label: us-west3
  535. value: us-west3
  536. - label: us-west4
  537. value: us-west4
  538. - type: string-input
  539. label: 👤 Issuer Email
  540. required: true
  541. placeholder: example@example.com
  542. variable: issuer_email
  543. - type: string-input
  544. label: GKE Cluster Name
  545. required: true
  546. placeholder: my-cluster
  547. variable: cluster_name
  548. `
  549. const docrForm = `name: DOCR
  550. hasSource: false
  551. includeHiddenFields: true
  552. tabs:
  553. - name: main
  554. label: Configuration
  555. sections:
  556. - name: section_one
  557. contents:
  558. - type: heading
  559. label: DOCR Configuration
  560. - type: select
  561. label: DO Subscription Tier
  562. variable: docr_subscription_tier
  563. settings:
  564. default: basic
  565. options:
  566. - label: Basic
  567. value: basic
  568. - label: Professional
  569. value: professional
  570. - type: string-input
  571. label: DOCR Name
  572. required: true
  573. placeholder: my-awesome-registry
  574. variable: docr_name
  575. `
  576. const doksForm = `name: DOKS
  577. hasSource: false
  578. includeHiddenFields: true
  579. tabs:
  580. - name: main
  581. label: Configuration
  582. sections:
  583. - name: section_one
  584. contents:
  585. - type: heading
  586. label: DOKS Configuration
  587. - type: select
  588. label: 📍 DO Region
  589. variable: do_region
  590. settings:
  591. default: nyc1
  592. options:
  593. - label: Amsterdam 3
  594. value: ams3
  595. - label: Bangalore 1
  596. value: blr1
  597. - label: Frankfurt 1
  598. value: fra1
  599. - label: London 1
  600. value: lon1
  601. - label: New York 1
  602. value: nyc1
  603. - label: New York 3
  604. value: nyc3
  605. - label: San Francisco 2
  606. value: sfo2
  607. - label: San Francisco 3
  608. value: sfo3
  609. - label: Singapore 1
  610. value: sgp1
  611. - label: Toronto 1
  612. value: tor1
  613. - type: string-input
  614. label: 👤 Issuer Email
  615. required: true
  616. placeholder: example@example.com
  617. variable: issuer_email
  618. - type: string-input
  619. label: DOKS Cluster Name
  620. required: true
  621. placeholder: my-cluster
  622. variable: cluster_name
  623. `