forms.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  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.large
  361. value: t2.large
  362. - label: t2.xlarge
  363. value: t2.xlarge
  364. - label: t2.2xlarge
  365. value: t2.2xlarge
  366. - label: t3.medium
  367. value: t3.medium
  368. - label: t3.large
  369. value: t3.large
  370. - label: t3.xlarge
  371. value: t3.xlarge
  372. - label: t3.2xlarge
  373. value: t3.2xlarge
  374. - type: string-input
  375. label: 👤 Issuer Email
  376. required: true
  377. placeholder: example@example.com
  378. variable: issuer_email
  379. - type: string-input
  380. label: EKS Cluster Name
  381. required: true
  382. placeholder: my-cluster
  383. variable: cluster_name
  384. - type: number-input
  385. label: Maximum number of EC2 instances to create in the application autoscaling group.
  386. variable: max_instances
  387. placeholder: "ex: 10"
  388. settings:
  389. default: 10
  390. - name: advanced
  391. label: Advanced
  392. sections:
  393. - name: system_machine_type
  394. contents:
  395. - type: heading
  396. label: System Machine Type Settings
  397. - type: select
  398. label: ⚙️ AWS System Machine Type
  399. variable: system_machine_type
  400. settings:
  401. default: t2.medium
  402. options:
  403. - label: t2.medium
  404. value: t2.medium
  405. - label: t2.large
  406. value: t2.large
  407. - label: t2.xlarge
  408. value: t2.xlarge
  409. - label: t2.2xlarge
  410. value: t2.2xlarge
  411. - label: t3.medium
  412. value: t3.medium
  413. - label: t3.large
  414. value: t3.large
  415. - label: t3.xlarge
  416. value: t3.xlarge
  417. - label: t3.2xlarge
  418. value: t3.2xlarge
  419. - name: spot_instance_should_enable
  420. contents:
  421. - type: heading
  422. label: Spot Instance Settings
  423. - type: checkbox
  424. variable: spot_instances_enabled
  425. label: Enable spot instances for this cluster.
  426. settings:
  427. default: false
  428. - name: spot_instance_price
  429. show_if: spot_instances_enabled
  430. contents:
  431. - type: string-input
  432. label: Assign a bid price for the spot instance (optional).
  433. variable: spot_price
  434. placeholder: "ex: 0.05"
  435. - name: net_settings
  436. contents:
  437. - type: heading
  438. label: Networking Settings
  439. - type: string-input
  440. 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)."
  441. variable: cluster_vpc_cidr_octets
  442. placeholder: "ex: 10.99"
  443. settings:
  444. default: "10.99"
  445. `
  446. const gcrForm = `name: GCR
  447. hasSource: false
  448. includeHiddenFields: true
  449. tabs:
  450. - name: main
  451. label: Configuration
  452. sections:
  453. - name: section_one
  454. contents:
  455. - type: heading
  456. label: GCR Configuration
  457. - type: select
  458. label: 📍 GCP Region
  459. variable: gcp_region
  460. settings:
  461. default: us-central1
  462. options:
  463. - label: asia-east1
  464. value: asia-east1
  465. - label: asia-east2
  466. value: asia-east2
  467. - label: asia-northeast1
  468. value: asia-northeast1
  469. - label: asia-northeast2
  470. value: asia-northeast2
  471. - label: asia-northeast3
  472. value: asia-northeast3
  473. - label: asia-south1
  474. value: asia-south1
  475. - label: asia-southeast1
  476. value: asia-southeast1
  477. - label: asia-southeast2
  478. value: asia-southeast2
  479. - label: australia-southeast1
  480. value: australia-southeast1
  481. - label: europe-north1
  482. value: europe-north1
  483. - label: europe-west1
  484. value: europe-west1
  485. - label: europe-west2
  486. value: europe-west2
  487. - label: europe-west3
  488. value: europe-west3
  489. - label: europe-west4
  490. value: europe-west4
  491. - label: europe-west6
  492. value: europe-west6
  493. - label: northamerica-northeast1
  494. value: northamerica-northeast1
  495. - label: southamerica-east1
  496. value: southamerica-east1
  497. - label: us-central1
  498. value: us-central1
  499. - label: us-east1
  500. value: us-east1
  501. - label: us-east4
  502. value: us-east4
  503. - label: us-east1
  504. value: us-east1
  505. - label: us-east1
  506. value: us-east1
  507. - label: us-west1
  508. value: us-west1
  509. - label: us-east1
  510. value: us-west2
  511. - label: us-west3
  512. value: us-west3
  513. - label: us-west4
  514. value: us-west4
  515. `
  516. const gkeForm = `name: GKE
  517. hasSource: false
  518. includeHiddenFields: true
  519. tabs:
  520. - name: main
  521. label: Configuration
  522. sections:
  523. - name: section_one
  524. contents:
  525. - type: heading
  526. label: GKE Configuration
  527. - type: select
  528. label: 📍 GCP Region
  529. variable: gcp_region
  530. settings:
  531. default: us-central1
  532. options:
  533. - label: asia-east1
  534. value: asia-east1
  535. - label: asia-east2
  536. value: asia-east2
  537. - label: asia-northeast1
  538. value: asia-northeast1
  539. - label: asia-northeast2
  540. value: asia-northeast2
  541. - label: asia-northeast3
  542. value: asia-northeast3
  543. - label: asia-south1
  544. value: asia-south1
  545. - label: asia-southeast1
  546. value: asia-southeast1
  547. - label: asia-southeast2
  548. value: asia-southeast2
  549. - label: australia-southeast1
  550. value: australia-southeast1
  551. - label: europe-north1
  552. value: europe-north1
  553. - label: europe-west1
  554. value: europe-west1
  555. - label: europe-west2
  556. value: europe-west2
  557. - label: europe-west3
  558. value: europe-west3
  559. - label: europe-west4
  560. value: europe-west4
  561. - label: europe-west6
  562. value: europe-west6
  563. - label: northamerica-northeast1
  564. value: northamerica-northeast1
  565. - label: southamerica-east1
  566. value: southamerica-east1
  567. - label: us-central1
  568. value: us-central1
  569. - label: us-east1
  570. value: us-east1
  571. - label: us-east4
  572. value: us-east4
  573. - label: us-east1
  574. value: us-east1
  575. - label: us-east1
  576. value: us-east1
  577. - label: us-west1
  578. value: us-west1
  579. - label: us-east1
  580. value: us-west2
  581. - label: us-west3
  582. value: us-west3
  583. - label: us-west4
  584. value: us-west4
  585. - type: string-input
  586. label: 👤 Issuer Email
  587. required: true
  588. placeholder: example@example.com
  589. variable: issuer_email
  590. - type: string-input
  591. label: GKE Cluster Name
  592. required: true
  593. placeholder: my-cluster
  594. variable: cluster_name
  595. `
  596. const docrForm = `name: DOCR
  597. hasSource: false
  598. includeHiddenFields: true
  599. tabs:
  600. - name: main
  601. label: Configuration
  602. sections:
  603. - name: section_one
  604. contents:
  605. - type: heading
  606. label: DOCR Configuration
  607. - type: select
  608. label: DO Subscription Tier
  609. variable: docr_subscription_tier
  610. settings:
  611. default: basic
  612. options:
  613. - label: Basic
  614. value: basic
  615. - label: Professional
  616. value: professional
  617. - type: string-input
  618. label: DOCR Name
  619. required: true
  620. placeholder: my-awesome-registry
  621. variable: docr_name
  622. `
  623. const doksForm = `name: DOKS
  624. hasSource: false
  625. includeHiddenFields: true
  626. tabs:
  627. - name: main
  628. label: Configuration
  629. sections:
  630. - name: section_one
  631. contents:
  632. - type: heading
  633. label: DOKS Configuration
  634. - type: select
  635. label: 📍 DO Region
  636. variable: do_region
  637. settings:
  638. default: nyc1
  639. options:
  640. - label: Amsterdam 3
  641. value: ams3
  642. - label: Bangalore 1
  643. value: blr1
  644. - label: Frankfurt 1
  645. value: fra1
  646. - label: London 1
  647. value: lon1
  648. - label: New York 1
  649. value: nyc1
  650. - label: New York 3
  651. value: nyc3
  652. - label: San Francisco 2
  653. value: sfo2
  654. - label: San Francisco 3
  655. value: sfo3
  656. - label: Singapore 1
  657. value: sgp1
  658. - label: Toronto 1
  659. value: tor1
  660. - type: string-input
  661. label: 👤 Issuer Email
  662. required: true
  663. placeholder: example@example.com
  664. variable: issuer_email
  665. - type: string-input
  666. label: DOKS Cluster Name
  667. required: true
  668. placeholder: my-cluster
  669. variable: cluster_name
  670. `