From 92acd40465ad126ea26c3452817d2bd12106aa09 Mon Sep 17 00:00:00 2001 From: jvallexm Date: Fri, 23 Feb 2024 09:32:26 -0500 Subject: [PATCH] Issue 1563: ipv4 cidr fixes (#1573) * Use only one provider for workspace creation Only use one provider for Power VS workspace creation. This avoid issues in Schematics. * Release notes, remove commented out providers * Fix deploy.sh Schematics related issues (#1566) * Fix cross-platform handling of workspace multiplicity check on destroy * Fix cross-platform sed input issue. Mac does not have GNU sed * feat: power vs v2 enhancements * fix: ipv4 blocks * fix: issue-1570 * fix: issue-1570 * fix: import * add tile for no ssh key Signed-off-by: Lucas-Franke * feat: tiles * prettier * merge * fix: changelog --------- Signed-off-by: Lucas-Franke Co-authored-by: Samuel Matzek Co-authored-by: Lucas-Franke --- CHANGELOG.md | 13 +- client/package-lock.json | 8 +- client/package.json | 2 +- client/src/components/pages/about.scss | 4 + .../src/components/pages/classic/Classic.js | 6 + .../pages/diagrams/DeploymentIcon.js | 10 +- .../src/components/pages/diagrams/SshKeys.js | 15 +- client/src/components/pages/power/Power.js | 116 ++-- .../components/pages/power/PowerSshKeys.js | 4 + .../src/components/pages/projects/Projects.js | 12 +- .../components/pages/vpc/VpcDeployments.js | 11 +- client/src/lib/docs/release-notes.json | 18 +- .../src/lib/docs/templates/from-scratch.json | 2 +- client/src/lib/docs/templates/oracle-si.json | 2 +- .../docs/templates/power-poc-quick-start.json | 2 +- .../lib/docs/templates/power-sap-hana.json | 2 +- .../lib/docs/templates/quick-start-power.json | 2 +- client/src/lib/docs/templates/slz-mixed.json | 2 +- .../src/lib/docs/templates/slz-vsi-edge.json | 2 +- client/src/lib/docs/templates/slz-vsi.json | 2 +- .../lib/docs/templates/vpn-as-a-service.json | 2 +- client/src/lib/forms/index.js | 2 - client/src/lib/forms/invalid-callbacks.js | 63 --- client/src/lib/index.js | 2 - client/src/lib/state/utils.js | 68 ++- package-lock.json | 12 +- package.json | 4 +- unit-tests/api/craig-api.test.js | 4 +- unit-tests/forms/invalid-callbacks.test.js | 494 ------------------ unit-tests/forms/wizard.test.js | 24 +- unit-tests/state/power-vs.test.js | 52 ++ unit-tests/state/ssh-keys.test.js | 15 + unit-tests/state/vpn.test.js | 10 +- 33 files changed, 307 insertions(+), 680 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8459273d..bb12ea67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,16 +6,19 @@ All notable changes to this project will be documented in this file. ### Upgrade Notes -- Updated deploy script to create the ICR namespace in the user provided region and resource group -- Updated deploy script to generate a unique ICR namespace value if the `-n` flag is not provided to avoid existing namespace conflicts within the selected region - - ### Features +- When attempting to create a resource that requires an SSH Key using the V2 pages, users will now be directed to first create an SSH key instead of viewing the form +- CRAIG deploy script now creates an ICR namespace in the user provided region and resource group +- CRAIG deploy script now generates a unique ICR namespace value if the `-n` flag is not provided to avoid existing namespace conflicts within the selected region ### Fixes -- Fixed an issue causing Schematics to fail provisioning Power VS Workspaces in every zone +- Fixed an issue causing Power VS Workspace deploy scripts to fail in schematics +- Fixed an issue causing CIDR blocks and IP addresses to be incorrectly marked as invalid +- Fixed an issue causing SSH Keys to incorrectly display as invalid on V2 pages when using the same public key for VPC, Power, or Classic +- Fixed an issue causing invalid VPC VSI images to persist after removing references when importing a project + ## 1.11.1 diff --git a/client/package-lock.json b/client/package-lock.json index 5aea2857..053ff930 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -20,7 +20,7 @@ "icse-react-assets": "1.2.37", "json-to-tf": "^0.3.1", "jszip": "^3.10.1", - "lazy-z": "^1.11.16", + "lazy-z": "^1.11.17", "react": "^18.0.0", "react-chartjs-2": "^5.2.0", "react-dom": "^18.0.0", @@ -19232,9 +19232,9 @@ } }, "node_modules/lazy-z": { - "version": "1.11.16", - "resolved": "https://registry.npmjs.org/lazy-z/-/lazy-z-1.11.16.tgz", - "integrity": "sha512-YQ2MSmHowkGB+Cvu2c+R1hIZcW8km7oElxBcZcSAGNCMNnAQexlinBeEn6Enc13WbyC07wucUx1OqlQK7QtG8w==", + "version": "1.11.17", + "resolved": "https://registry.npmjs.org/lazy-z/-/lazy-z-1.11.17.tgz", + "integrity": "sha512-Cxn7zXtnGsH5wVk2M6T99Lg5pcLik4t+OmugmGdYOn8AAbQYU+zA9Sz87H7ANYWX9AGZFz5/4JZ4mNapcRDQ5A==", "dependencies": { "regex-but-with-words": "^1.5.0" } diff --git a/client/package.json b/client/package.json index 51134bff..b3ac3e66 100644 --- a/client/package.json +++ b/client/package.json @@ -26,7 +26,7 @@ "icse-react-assets": "1.2.37", "json-to-tf": "^0.3.1", "jszip": "^3.10.1", - "lazy-z": "^1.11.16", + "lazy-z": "^1.11.17", "react": "^18.0.0", "react-chartjs-2": "^5.2.0", "react-dom": "^18.0.0", diff --git a/client/src/components/pages/about.scss b/client/src/components/pages/about.scss index 01b5276f..88b093c0 100644 --- a/client/src/components/pages/about.scss +++ b/client/src/components/pages/about.scss @@ -143,3 +143,7 @@ div .center { #craig-about .cds--accordion__title { font-size: 1.25rem; } + +.width580 { + width: 580px !important; +} diff --git a/client/src/components/pages/classic/Classic.js b/client/src/components/pages/classic/Classic.js index 6420f99f..034c0c84 100644 --- a/client/src/components/pages/classic/Classic.js +++ b/client/src/components/pages/classic/Classic.js @@ -222,6 +222,12 @@ class ClassicDiagram extends React.Component { )} {isNullOrEmptyString(this.state.modalService, true) ? ( <> + ) : this.state.modalService === "classic_gateways" && + this.props.craig.store.json.classic_ssh_keys.length === 0 ? ( + ) : ( { > + ) : craig.store.json.power[this.state.powerIndex]?.ssh_keys + ?.length === 0 && + contains(["vtl", "power_instances"], this.state.modalService) ? ( + ) : (
- { - return ( - this.state.selectedItem === "power" && - this.state.selectedIndex === powerIndex - ); - }} - buttons={(powerIndex) => { - return ( - - this.onWorkspaceButtonClick(powerIndex) - } - /> - ); - }} - > - - { - return ( - this.state.selectedIndex === props.index && - this.state.selectedItem === props.itemName - ); - }} - volumeIsSelected={(volumeIndex) => { + onClick={this.onPowerWorkspaceClick} + isSelected={(powerIndex) => { return ( - this.state.selectedItem === "power_volumes" && - volumeIndex === this.state.selectedIndex + this.state.selectedItem === "power" && + this.state.selectedIndex === powerIndex ); }} - /> - { + buttons={(powerIndex) => { return ( - this.state.selectedIndex === props.index && - this.state.selectedItem === props.itemName + + this.onWorkspaceButtonClick(powerIndex) + } + /> ); }} - onVolumeClick={this.onVolumeClick} - /> - + > + + { + return ( + this.state.selectedIndex === props.index && + this.state.selectedItem === props.itemName + ); + }} + volumeIsSelected={(volumeIndex) => { + return ( + this.state.selectedItem === "power_volumes" && + volumeIndex === this.state.selectedIndex + ); + }} + /> + { + return ( + this.state.selectedIndex === props.index && + this.state.selectedItem === props.itemName + ); + }} + onVolumeClick={this.onVolumeClick} + /> + + )}
{this.state.editing === true ? ( diff --git a/client/src/components/pages/power/PowerSshKeys.js b/client/src/components/pages/power/PowerSshKeys.js index 0f4c6d42..0cb191dc 100644 --- a/client/src/components/pages/power/PowerSshKeys.js +++ b/client/src/components/pages/power/PowerSshKeys.js @@ -31,6 +31,10 @@ export const PowerSshKeys = (props) => { icon={Password} itemName="ssh_keys" craig={props.craig} + isInvalid={props.craig.power.ssh_keys.public_key.invalid(sshKey, { + data: sshKey, + craig: props.craig, + })} /> ))}
diff --git a/client/src/components/pages/projects/Projects.js b/client/src/components/pages/projects/Projects.js index 4981c725..7535b493 100644 --- a/client/src/components/pages/projects/Projects.js +++ b/client/src/components/pages/projects/Projects.js @@ -2,7 +2,7 @@ import React from "react"; import { Button } from "@carbon/react"; import { ProjectFormModal } from "./ProjectFormModal"; import { JSONModal } from "./JSONModal"; -import { azsort, contains, eachKey, splatContains } from "lazy-z"; +import { azsort, contains, eachKey, splat, splatContains } from "lazy-z"; import { Add, MagicWandFilled, Upload } from "@carbon/icons-react"; import { ProjectTile } from "./ProjectTile"; import { CraigHeader } from "../SplashPage"; @@ -202,7 +202,15 @@ class Projects extends React.Component { this.props.craig.store.json[item].forEach((resource) => { // if the resource name is contained in the list of invalid items // set the reference to null - if (contains(this.state.invalidItems[item], resource.name)) { + if ( + item === "vsi" + ? splatContains( + this.state.invalidItems[item], + "vsi", + resource.name + ) + : contains(this.state.invalidItems[item], resource.name) + ) { if (item === "vsi" && resource.image_name) { resource.image_name = null; resource.image = null; diff --git a/client/src/components/pages/vpc/VpcDeployments.js b/client/src/components/pages/vpc/VpcDeployments.js index 00fa6ef8..a631a5b8 100644 --- a/client/src/components/pages/vpc/VpcDeployments.js +++ b/client/src/components/pages/vpc/VpcDeployments.js @@ -52,7 +52,10 @@ import { docTabs, } from "../diagrams"; import { NoSecretsManagerTile } from "../../utils/NoSecretsManagerTile"; -import { NoVpcVsiTile } from "../../forms/dynamic-form/tiles"; +import { + CraigEmptyResourceTile, + NoVpcVsiTile, +} from "../../forms/dynamic-form/tiles"; import { RoutingTables } from "../diagrams/RoutingTables"; import { F5BigIp } from "../FormPages"; import f5 from "../../../images/f5.png"; @@ -352,6 +355,12 @@ class VpcDeploymentsDiagramPage extends React.Component { ) : this.state.selectedItem === "vpn_servers" && craig.store.json.secrets_manager.length === 0 ? ( + ) : contains(["fortigate_vnf", "vsi"], this.state.selectedItem) && + craig.store.json.ssh_keys.length === 0 ? ( + ) : ( { + // if the workspace matches the workspace + if (workspace.name === componentProps.arrayParentName) + // create a list of ssh keys that does not include NONE and + // does not have the same name as the array parent + otherPublicKeys = otherPublicKeys.concat( + splat( + workspace.ssh_keys.filter((sshKey) => { + if (sshKey.name !== componentProps.data.name) { + return sshKey; + } + }), + "public_key" + ).filter((pubKey) => { + if (pubKey !== "NONE") return pubKey; + }) + ); + }); + return contains(otherPublicKeys, stateData.public_key); + } else { + let otherPublicKeys = []; + otherPublicKeys = otherPublicKeys.concat( + splat( + // add keys that do not have the name of the current key + componentProps.craig.store.json[fieldName].filter((sshKey) => { + if (sshKey.name !== componentProps.data.name) { + return sshKey; + } + }), + "public_key" + ).filter((pubKey) => { + // remove none keys + if (pubKey !== "NONE") return pubKey; + }) + ); + return contains(otherPublicKeys, stateData.public_key); + } + } let schema = { name: { default: "", @@ -698,13 +745,14 @@ function sshKeySchema(fieldName) { public_key: { type: "public-key", default: null, - invalid: function (stateData, componentProps) { - return stateData.use_data - ? false - : invalidSshPublicKey(stateData, componentProps).invalid; - }, + invalid: invalidSshKey, invalidText: function (stateData, componentProps) { - return invalidSshPublicKey(stateData, componentProps).invalidText; + return !validSshKey(stateData.public_key) && + stateData.public_key !== "NONE" + ? "Provide a unique SSH public key that does not exist in the IBM Cloud account in your region" + : invalidSshKey(stateData, componentProps) + ? "SSH Public Key in use" + : ""; }, hideWhen: function (stateData) { return stateData.use_data; diff --git a/package-lock.json b/package-lock.json index 2e35708d..49c70571 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "craig", - "version": "1.11.1", + "version": "1.11.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "craig", - "version": "1.11.1", + "version": "1.11.2", "license": "ISC", "dependencies": { "axios": "^1.6.3", @@ -16,7 +16,7 @@ "express": "^4.18.1", "js-yaml": "^4.1.0", "json-to-tf": "^0.2.1", - "lazy-z": "1.11.16", + "lazy-z": "1.11.17", "regex-but-with-words": "^1.5.1", "swagger-ui-express": "^5.0.0", "tar-stream": "^3.1.6" @@ -2310,9 +2310,9 @@ "dev": true }, "node_modules/lazy-z": { - "version": "1.11.16", - "resolved": "https://registry.npmjs.org/lazy-z/-/lazy-z-1.11.16.tgz", - "integrity": "sha512-YQ2MSmHowkGB+Cvu2c+R1hIZcW8km7oElxBcZcSAGNCMNnAQexlinBeEn6Enc13WbyC07wucUx1OqlQK7QtG8w==", + "version": "1.11.17", + "resolved": "https://registry.npmjs.org/lazy-z/-/lazy-z-1.11.17.tgz", + "integrity": "sha512-Cxn7zXtnGsH5wVk2M6T99Lg5pcLik4t+OmugmGdYOn8AAbQYU+zA9Sz87H7ANYWX9AGZFz5/4JZ4mNapcRDQ5A==", "dependencies": { "regex-but-with-words": "^1.5.0" } diff --git a/package.json b/package.json index c822e45d..ee459e77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "craig", - "version": "1.11.1", + "version": "1.11.2", "description": "gui for generating ibm cloud infrastructure resources", "main": "index.js", "scripts": { @@ -42,7 +42,7 @@ "express": "^4.18.1", "js-yaml": "^4.1.0", "json-to-tf": "^0.2.1", - "lazy-z": "1.11.16", + "lazy-z": "1.11.17", "regex-but-with-words": "^1.5.1", "swagger-ui-express": "^5.0.0", "tar-stream": "^3.1.6" diff --git a/unit-tests/api/craig-api.test.js b/unit-tests/api/craig-api.test.js index eafc9395..eacdeefc 100644 --- a/unit-tests/api/craig-api.test.js +++ b/unit-tests/api/craig-api.test.js @@ -95,7 +95,7 @@ describe("craig api", () => { }, { name: "craig/craig.json", - data: '{\n "_options": {\n "prefix": "iac",\n "region": "us-south",\n "tags": [\n "hello",\n "world"\n ],\n "zones": 3,\n "endpoints": "private",\n "account_id": null,\n "fs_cloud": false,\n "enable_classic": false,\n "dynamic_subnets": true,\n "enable_power_vs": false,\n "power_vs_zones": [],\n "craig_version": "1.11.1",\n "power_vs_high_availability": false\n },\n "access_groups": [],\n "appid": [],\n "atracker": {\n "enabled": true,\n "type": "cos",\n "name": "atracker",\n "target_name": "atracker-cos",\n "bucket": "atracker-bucket",\n "add_route": true,\n "cos_key": "cos-bind-key",\n "locations": [\n "global",\n "us-south"\n ],\n "instance": false,\n "plan": "lite",\n "resource_group": null\n },\n "cbr_rules": [],\n "cbr_zones": [],\n "clusters": [\n {\n "kms": "kms",\n "cos": "cos",\n "entitlement": "cloud_pak",\n "kube_type": "openshift",\n "kube_version": "4.12.26_openshift",\n "flavor": "bx2.16x64",\n "name": "workload-cluster",\n "resource_group": "workload-rg",\n "encryption_key": "roks-key",\n "subnets": [\n "vsi-zone-1",\n "vsi-zone-2",\n "vsi-zone-3"\n ],\n "update_all_workers": false,\n "vpc": "workload",\n "worker_pools": [\n {\n "entitlement": "cloud_pak",\n "cluster": "workload-cluster",\n "flavor": "bx2.16x64",\n "name": "logging-worker-pool",\n "resource_group": "workload-rg",\n "subnets": [\n "vsi-zone-1",\n "vsi-zone-2",\n "vsi-zone-3"\n ],\n "vpc": "workload",\n "workers_per_subnet": 2\n }\n ],\n "opaque_secrets": [],\n "workers_per_subnet": 2,\n "private_endpoint": true\n }\n ],\n "dns": [],\n "event_streams": [],\n "f5_vsi": [],\n "iam_account_settings": {\n "enable": false,\n "mfa": null,\n "allowed_ip_addresses": null,\n "include_history": false,\n "if_match": null,\n "max_sessions_per_identity": null,\n "restrict_create_service_id": null,\n "restrict_create_platform_apikey": null,\n "session_expiration_in_seconds": null,\n "session_invalidation_in_seconds": null\n },\n "icd": [],\n "key_management": [\n {\n "name": "kms",\n "resource_group": "service-rg",\n "use_hs_crypto": false,\n "authorize_vpc_reader_role": true,\n "use_data": false,\n "keys": [\n {\n "key_ring": "ring",\n "name": "key",\n "root_key": true,\n "force_delete": true,\n "endpoint": "public",\n "rotation": 1,\n "dual_auth_delete": false\n },\n {\n "key_ring": "ring",\n "name": "atracker-key",\n "root_key": true,\n "force_delete": true,\n "endpoint": "public",\n "rotation": 1,\n "dual_auth_delete": false\n },\n {\n "key_ring": "ring",\n "name": "vsi-volume-key",\n "root_key": true,\n "force_delete": true,\n "endpoint": "public",\n "rotation": 1,\n "dual_auth_delete": false\n },\n {\n "key_ring": "ring",\n "name": "roks-key",\n "root_key": true,\n "force_delete": null,\n "endpoint": null,\n "rotation": 1,\n "dual_auth_delete": false\n }\n ]\n }\n ],\n "load_balancers": [],\n "logdna": {\n "name": "logdna",\n "archive": false,\n "enabled": false,\n "plan": "lite",\n "endpoints": "private",\n "platform_logs": false,\n "resource_group": "service-rg",\n "cos": "atracker-cos",\n "bucket": "atracker-bucket"\n },\n "object_storage": [\n {\n "buckets": [\n {\n "endpoint": "public",\n "force_delete": true,\n "kms_key": "atracker-key",\n "name": "atracker-bucket",\n "storage_class": "standard",\n "use_random_suffix": true\n }\n ],\n "keys": [\n {\n "name": "cos-bind-key",\n "role": "Writer",\n "enable_hmac": false,\n "use_random_suffix": true\n }\n ],\n "name": "atracker-cos",\n "plan": "standard",\n "resource_group": "service-rg",\n "use_data": false,\n "use_random_suffix": true,\n "kms": "kms"\n },\n {\n "buckets": [\n {\n "endpoint": "public",\n "force_delete": true,\n "kms_key": "key",\n "name": "management-bucket",\n "storage_class": "standard",\n "use_random_suffix": true\n },\n {\n "endpoint": "public",\n "force_delete": true,\n "kms_key": "key",\n "name": "workload-bucket",\n "storage_class": "standard",\n "use_random_suffix": true\n }\n ],\n "use_random_suffix": true,\n "keys": [],\n "name": "cos",\n "plan": "standard",\n "resource_group": "service-rg",\n "use_data": false,\n "kms": "kms"\n }\n ],\n "power": [],\n "power_instances": [],\n "power_volumes": [],\n "resource_groups": [\n {\n "use_prefix": true,\n "name": "service-rg",\n "use_data": false\n },\n {\n "use_prefix": true,\n "name": "management-rg",\n "use_data": false\n },\n {\n "use_prefix": true,\n "name": "workload-rg",\n "use_data": false\n }\n ],\n "routing_tables": [],\n "scc": {\n "credential_description": null,\n "id": null,\n "passphrase": null,\n "name": "",\n "location": "us",\n "collector_description": null,\n "is_public": false,\n "scope_description": null,\n "enable": false\n },\n "secrets_manager": [],\n "security_groups": [\n {\n "vpc": "management",\n "name": "management-vpe",\n "resource_group": "management-rg",\n "rules": [\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "inbound",\n "name": "allow-vpc-inbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "outbound",\n "name": "allow-vpc-outbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-53-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 53,\n "port_min": 53\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-80-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 80,\n "port_min": 80\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-443-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 443,\n "port_min": 443\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n }\n ]\n },\n {\n "vpc": "workload",\n "name": "workload-vpe",\n "resource_group": "workload-rg",\n "rules": [\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "inbound",\n "name": "allow-vpc-inbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "outbound",\n "name": "allow-vpc-outbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-53-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 53,\n "port_min": 53\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-80-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 80,\n "port_min": 80\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-443-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 443,\n "port_min": 443\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n }\n ]\n },\n {\n "vpc": "management",\n "name": "management-vsi",\n "resource_group": "management-rg",\n "rules": [\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "inbound",\n "name": "allow-vpc-inbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "outbound",\n "name": "allow-vpc-outbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "outbound",\n "name": "allow-ibm-tcp-53-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 53,\n "port_min": 53\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "outbound",\n "name": "allow-ibm-tcp-80-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 80,\n "port_min": 80\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "outbound",\n "name": "allow-ibm-tcp-443-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 443,\n "port_min": 443\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n }\n ]\n }\n ],\n "ssh_keys": [\n {\n "name": "ssh-key",\n "public_key": "",\n "resource_group": "management-rg",\n "use_data": false\n }\n ],\n "sysdig": {\n "enabled": false,\n "plan": "graduated-tier",\n "resource_group": "service-rg",\n "name": "sysdig",\n "platform_logs": false\n },\n "teleport_vsi": [],\n "transit_gateways": [\n {\n "name": "transit-gateway",\n "resource_group": "service-rg",\n "global": false,\n "connections": [\n {\n "tgw": "transit-gateway",\n "vpc": "management"\n },\n {\n "tgw": "transit-gateway",\n "vpc": "workload"\n }\n ]\n }\n ],\n "virtual_private_endpoints": [\n {\n "name": "management-cos",\n "service": "cos",\n "vpc": "management",\n "resource_group": "management-rg",\n "security_groups": [\n "management-vpe"\n ],\n "subnets": [\n "vpe-zone-1",\n "vpe-zone-2",\n "vpe-zone-3"\n ],\n "instance": null\n },\n {\n "name": "workload-cos",\n "service": "cos",\n "vpc": "workload",\n "resource_group": "workload-rg",\n "security_groups": [\n "workload-vpe"\n ],\n "subnets": [\n "vpe-zone-1",\n "vpe-zone-2",\n "vpe-zone-3"\n ],\n "instance": null\n }\n ],\n "vpcs": [\n {\n "cos": "cos",\n "bucket": "management-bucket",\n "name": "management",\n "resource_group": "management-rg",\n "classic_access": false,\n "manual_address_prefix_management": true,\n "default_network_acl_name": null,\n "default_security_group_name": null,\n "default_routing_table_name": null,\n "publicGateways": [],\n "address_prefixes": [\n {\n "vpc": "management",\n "zone": 1,\n "name": "management-zone-1",\n "cidr": "10.10.0.0/22"\n },\n {\n "vpc": "management",\n "zone": 2,\n "name": "management-zone-2",\n "cidr": "10.20.0.0/22"\n },\n {\n "vpc": "management",\n "zone": 3,\n "name": "management-zone-3",\n "cidr": "10.30.0.0/22"\n }\n ],\n "subnets": [\n {\n "vpc": "management",\n "zone": 1,\n "cidr": "10.10.0.0/29",\n "name": "vsi-zone-1",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 1,\n "cidr": "10.10.0.16/28",\n "name": "vpn-zone-1",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 2,\n "cidr": "10.20.0.0/29",\n "name": "vsi-zone-2",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 3,\n "cidr": "10.30.0.0/29",\n "name": "vsi-zone-3",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 1,\n "cidr": "10.10.0.48/29",\n "name": "vpe-zone-1",\n "resource_group": "management-rg",\n "network_acl": "management",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 2,\n "cidr": "10.20.0.16/29",\n "name": "vpe-zone-2",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 3,\n "cidr": "10.30.0.16/29",\n "name": "vpe-zone-3",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n }\n ],\n "public_gateways": [],\n "acls": [\n {\n "resource_group": "management-rg",\n "name": "management",\n "vpc": "management",\n "rules": [\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "acl": "management",\n "vpc": "management",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "source": "10.0.0.0/8",\n "direction": "outbound",\n "name": "allow-ibm-outbound",\n "destination": "161.26.0.0/16",\n "acl": "management",\n "vpc": "management",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "inbound",\n "name": "allow-all-network-inbound",\n "source": "10.0.0.0/8",\n "acl": "management",\n "vpc": "management",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "outbound",\n "name": "allow-all-network-outbound",\n "source": "10.0.0.0/8",\n "acl": "management",\n "vpc": "management",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n }\n ]\n }\n ]\n },\n {\n "cos": "cos",\n "bucket": "workload-bucket",\n "name": "workload",\n "resource_group": "workload-rg",\n "classic_access": false,\n "manual_address_prefix_management": true,\n "default_network_acl_name": null,\n "default_security_group_name": null,\n "default_routing_table_name": null,\n "publicGateways": [],\n "address_prefixes": [\n {\n "vpc": "workload",\n "zone": 1,\n "name": "workload-zone-1",\n "cidr": "10.40.0.0/22"\n },\n {\n "vpc": "workload",\n "zone": 2,\n "name": "workload-zone-2",\n "cidr": "10.50.0.0/22"\n },\n {\n "vpc": "workload",\n "zone": 3,\n "name": "workload-zone-3",\n "cidr": "10.60.0.0/22"\n }\n ],\n "subnets": [\n {\n "vpc": "workload",\n "zone": 1,\n "cidr": "10.40.0.0/28",\n "name": "vsi-zone-1",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 2,\n "cidr": "10.50.0.0/28",\n "name": "vsi-zone-2",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 3,\n "cidr": "10.60.0.0/28",\n "name": "vsi-zone-3",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 1,\n "cidr": "10.40.0.32/29",\n "name": "vpe-zone-1",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 2,\n "cidr": "10.50.0.32/29",\n "name": "vpe-zone-2",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 3,\n "cidr": "10.60.0.32/29",\n "name": "vpe-zone-3",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n }\n ],\n "public_gateways": [],\n "acls": [\n {\n "resource_group": "workload-rg",\n "name": "workload",\n "vpc": "workload",\n "rules": [\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "acl": "workload",\n "vpc": "workload",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "source": "10.0.0.0/8",\n "direction": "outbound",\n "name": "allow-ibm-outbound",\n "destination": "161.26.0.0/16",\n "acl": "workload",\n "vpc": "workload",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "inbound",\n "name": "allow-all-network-inbound",\n "source": "10.0.0.0/8",\n "acl": "workload",\n "vpc": "workload",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "outbound",\n "name": "allow-all-network-outbound",\n "source": "10.0.0.0/8",\n "acl": "workload",\n "vpc": "workload",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n }\n ]\n }\n ]\n }\n ],\n "vpn_gateways": [\n {\n "name": "management-gateway",\n "resource_group": "management-rg",\n "subnet": "vpn-zone-1",\n "vpc": "management"\n }\n ],\n "vpn_servers": [],\n "vsi": [\n {\n "kms": "kms",\n "encryption_key": "vsi-volume-key",\n "image": "ibm-ubuntu-22-04-1-minimal-amd64-1",\n "profile": "cx2-4x8",\n "name": "management-server",\n "security_groups": [\n "management-vsi"\n ],\n "ssh_keys": [\n "ssh-key"\n ],\n "subnets": [\n "vsi-zone-1",\n "vsi-zone-2",\n "vsi-zone-3"\n ],\n "vpc": "management",\n "vsi_per_subnet": 2,\n "resource_group": "management-rg",\n "override_vsi_name": null,\n "user_data": "",\n "network_interfaces": [],\n "volumes": []\n }\n ],\n "classic_ssh_keys": [],\n "classic_vlans": []\n}', + data: '{\n "_options": {\n "prefix": "iac",\n "region": "us-south",\n "tags": [\n "hello",\n "world"\n ],\n "zones": 3,\n "endpoints": "private",\n "account_id": null,\n "fs_cloud": false,\n "enable_classic": false,\n "dynamic_subnets": true,\n "enable_power_vs": false,\n "power_vs_zones": [],\n "craig_version": "1.11.2",\n "power_vs_high_availability": false\n },\n "access_groups": [],\n "appid": [],\n "atracker": {\n "enabled": true,\n "type": "cos",\n "name": "atracker",\n "target_name": "atracker-cos",\n "bucket": "atracker-bucket",\n "add_route": true,\n "cos_key": "cos-bind-key",\n "locations": [\n "global",\n "us-south"\n ],\n "instance": false,\n "plan": "lite",\n "resource_group": null\n },\n "cbr_rules": [],\n "cbr_zones": [],\n "clusters": [\n {\n "kms": "kms",\n "cos": "cos",\n "entitlement": "cloud_pak",\n "kube_type": "openshift",\n "kube_version": "4.12.26_openshift",\n "flavor": "bx2.16x64",\n "name": "workload-cluster",\n "resource_group": "workload-rg",\n "encryption_key": "roks-key",\n "subnets": [\n "vsi-zone-1",\n "vsi-zone-2",\n "vsi-zone-3"\n ],\n "update_all_workers": false,\n "vpc": "workload",\n "worker_pools": [\n {\n "entitlement": "cloud_pak",\n "cluster": "workload-cluster",\n "flavor": "bx2.16x64",\n "name": "logging-worker-pool",\n "resource_group": "workload-rg",\n "subnets": [\n "vsi-zone-1",\n "vsi-zone-2",\n "vsi-zone-3"\n ],\n "vpc": "workload",\n "workers_per_subnet": 2\n }\n ],\n "opaque_secrets": [],\n "workers_per_subnet": 2,\n "private_endpoint": true\n }\n ],\n "dns": [],\n "event_streams": [],\n "f5_vsi": [],\n "iam_account_settings": {\n "enable": false,\n "mfa": null,\n "allowed_ip_addresses": null,\n "include_history": false,\n "if_match": null,\n "max_sessions_per_identity": null,\n "restrict_create_service_id": null,\n "restrict_create_platform_apikey": null,\n "session_expiration_in_seconds": null,\n "session_invalidation_in_seconds": null\n },\n "icd": [],\n "key_management": [\n {\n "name": "kms",\n "resource_group": "service-rg",\n "use_hs_crypto": false,\n "authorize_vpc_reader_role": true,\n "use_data": false,\n "keys": [\n {\n "key_ring": "ring",\n "name": "key",\n "root_key": true,\n "force_delete": true,\n "endpoint": "public",\n "rotation": 1,\n "dual_auth_delete": false\n },\n {\n "key_ring": "ring",\n "name": "atracker-key",\n "root_key": true,\n "force_delete": true,\n "endpoint": "public",\n "rotation": 1,\n "dual_auth_delete": false\n },\n {\n "key_ring": "ring",\n "name": "vsi-volume-key",\n "root_key": true,\n "force_delete": true,\n "endpoint": "public",\n "rotation": 1,\n "dual_auth_delete": false\n },\n {\n "key_ring": "ring",\n "name": "roks-key",\n "root_key": true,\n "force_delete": null,\n "endpoint": null,\n "rotation": 1,\n "dual_auth_delete": false\n }\n ]\n }\n ],\n "load_balancers": [],\n "logdna": {\n "name": "logdna",\n "archive": false,\n "enabled": false,\n "plan": "lite",\n "endpoints": "private",\n "platform_logs": false,\n "resource_group": "service-rg",\n "cos": "atracker-cos",\n "bucket": "atracker-bucket"\n },\n "object_storage": [\n {\n "buckets": [\n {\n "endpoint": "public",\n "force_delete": true,\n "kms_key": "atracker-key",\n "name": "atracker-bucket",\n "storage_class": "standard",\n "use_random_suffix": true\n }\n ],\n "keys": [\n {\n "name": "cos-bind-key",\n "role": "Writer",\n "enable_hmac": false,\n "use_random_suffix": true\n }\n ],\n "name": "atracker-cos",\n "plan": "standard",\n "resource_group": "service-rg",\n "use_data": false,\n "use_random_suffix": true,\n "kms": "kms"\n },\n {\n "buckets": [\n {\n "endpoint": "public",\n "force_delete": true,\n "kms_key": "key",\n "name": "management-bucket",\n "storage_class": "standard",\n "use_random_suffix": true\n },\n {\n "endpoint": "public",\n "force_delete": true,\n "kms_key": "key",\n "name": "workload-bucket",\n "storage_class": "standard",\n "use_random_suffix": true\n }\n ],\n "use_random_suffix": true,\n "keys": [],\n "name": "cos",\n "plan": "standard",\n "resource_group": "service-rg",\n "use_data": false,\n "kms": "kms"\n }\n ],\n "power": [],\n "power_instances": [],\n "power_volumes": [],\n "resource_groups": [\n {\n "use_prefix": true,\n "name": "service-rg",\n "use_data": false\n },\n {\n "use_prefix": true,\n "name": "management-rg",\n "use_data": false\n },\n {\n "use_prefix": true,\n "name": "workload-rg",\n "use_data": false\n }\n ],\n "routing_tables": [],\n "scc": {\n "credential_description": null,\n "id": null,\n "passphrase": null,\n "name": "",\n "location": "us",\n "collector_description": null,\n "is_public": false,\n "scope_description": null,\n "enable": false\n },\n "secrets_manager": [],\n "security_groups": [\n {\n "vpc": "management",\n "name": "management-vpe",\n "resource_group": "management-rg",\n "rules": [\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "inbound",\n "name": "allow-vpc-inbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "outbound",\n "name": "allow-vpc-outbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-53-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 53,\n "port_min": 53\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-80-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 80,\n "port_min": 80\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-443-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 443,\n "port_min": 443\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n }\n ]\n },\n {\n "vpc": "workload",\n "name": "workload-vpe",\n "resource_group": "workload-rg",\n "rules": [\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "inbound",\n "name": "allow-vpc-inbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "outbound",\n "name": "allow-vpc-outbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-53-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 53,\n "port_min": 53\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-80-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 80,\n "port_min": 80\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "workload",\n "sg": "workload-vpe",\n "direction": "outbound",\n "name": "allow-ibm-tcp-443-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 443,\n "port_min": 443\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n }\n ]\n },\n {\n "vpc": "management",\n "name": "management-vsi",\n "resource_group": "management-rg",\n "rules": [\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "inbound",\n "name": "allow-vpc-inbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "outbound",\n "name": "allow-vpc-outbound",\n "source": "10.0.0.0/8",\n "tcp": {\n "port_max": null,\n "port_min": null\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "outbound",\n "name": "allow-ibm-tcp-53-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 53,\n "port_min": 53\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "outbound",\n "name": "allow-ibm-tcp-80-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 80,\n "port_min": 80\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n },\n {\n "vpc": "management",\n "sg": "management-vsi",\n "direction": "outbound",\n "name": "allow-ibm-tcp-443-outbound",\n "source": "161.26.0.0/16",\n "tcp": {\n "port_max": 443,\n "port_min": 443\n },\n "udp": {\n "port_max": null,\n "port_min": null\n },\n "icmp": {\n "type": null,\n "code": null\n }\n }\n ]\n }\n ],\n "ssh_keys": [\n {\n "name": "ssh-key",\n "public_key": "",\n "resource_group": "management-rg",\n "use_data": false\n }\n ],\n "sysdig": {\n "enabled": false,\n "plan": "graduated-tier",\n "resource_group": "service-rg",\n "name": "sysdig",\n "platform_logs": false\n },\n "teleport_vsi": [],\n "transit_gateways": [\n {\n "name": "transit-gateway",\n "resource_group": "service-rg",\n "global": false,\n "connections": [\n {\n "tgw": "transit-gateway",\n "vpc": "management"\n },\n {\n "tgw": "transit-gateway",\n "vpc": "workload"\n }\n ]\n }\n ],\n "virtual_private_endpoints": [\n {\n "name": "management-cos",\n "service": "cos",\n "vpc": "management",\n "resource_group": "management-rg",\n "security_groups": [\n "management-vpe"\n ],\n "subnets": [\n "vpe-zone-1",\n "vpe-zone-2",\n "vpe-zone-3"\n ],\n "instance": null\n },\n {\n "name": "workload-cos",\n "service": "cos",\n "vpc": "workload",\n "resource_group": "workload-rg",\n "security_groups": [\n "workload-vpe"\n ],\n "subnets": [\n "vpe-zone-1",\n "vpe-zone-2",\n "vpe-zone-3"\n ],\n "instance": null\n }\n ],\n "vpcs": [\n {\n "cos": "cos",\n "bucket": "management-bucket",\n "name": "management",\n "resource_group": "management-rg",\n "classic_access": false,\n "manual_address_prefix_management": true,\n "default_network_acl_name": null,\n "default_security_group_name": null,\n "default_routing_table_name": null,\n "publicGateways": [],\n "address_prefixes": [\n {\n "vpc": "management",\n "zone": 1,\n "name": "management-zone-1",\n "cidr": "10.10.0.0/22"\n },\n {\n "vpc": "management",\n "zone": 2,\n "name": "management-zone-2",\n "cidr": "10.20.0.0/22"\n },\n {\n "vpc": "management",\n "zone": 3,\n "name": "management-zone-3",\n "cidr": "10.30.0.0/22"\n }\n ],\n "subnets": [\n {\n "vpc": "management",\n "zone": 1,\n "cidr": "10.10.0.0/29",\n "name": "vsi-zone-1",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 1,\n "cidr": "10.10.0.16/28",\n "name": "vpn-zone-1",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 2,\n "cidr": "10.20.0.0/29",\n "name": "vsi-zone-2",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 3,\n "cidr": "10.30.0.0/29",\n "name": "vsi-zone-3",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 1,\n "cidr": "10.10.0.48/29",\n "name": "vpe-zone-1",\n "resource_group": "management-rg",\n "network_acl": "management",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 2,\n "cidr": "10.20.0.16/29",\n "name": "vpe-zone-2",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "management",\n "zone": 3,\n "cidr": "10.30.0.16/29",\n "name": "vpe-zone-3",\n "network_acl": "management",\n "resource_group": "management-rg",\n "public_gateway": false,\n "has_prefix": false\n }\n ],\n "public_gateways": [],\n "acls": [\n {\n "resource_group": "management-rg",\n "name": "management",\n "vpc": "management",\n "rules": [\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "acl": "management",\n "vpc": "management",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "source": "10.0.0.0/8",\n "direction": "outbound",\n "name": "allow-ibm-outbound",\n "destination": "161.26.0.0/16",\n "acl": "management",\n "vpc": "management",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "inbound",\n "name": "allow-all-network-inbound",\n "source": "10.0.0.0/8",\n "acl": "management",\n "vpc": "management",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "outbound",\n "name": "allow-all-network-outbound",\n "source": "10.0.0.0/8",\n "acl": "management",\n "vpc": "management",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n }\n ]\n }\n ]\n },\n {\n "cos": "cos",\n "bucket": "workload-bucket",\n "name": "workload",\n "resource_group": "workload-rg",\n "classic_access": false,\n "manual_address_prefix_management": true,\n "default_network_acl_name": null,\n "default_security_group_name": null,\n "default_routing_table_name": null,\n "publicGateways": [],\n "address_prefixes": [\n {\n "vpc": "workload",\n "zone": 1,\n "name": "workload-zone-1",\n "cidr": "10.40.0.0/22"\n },\n {\n "vpc": "workload",\n "zone": 2,\n "name": "workload-zone-2",\n "cidr": "10.50.0.0/22"\n },\n {\n "vpc": "workload",\n "zone": 3,\n "name": "workload-zone-3",\n "cidr": "10.60.0.0/22"\n }\n ],\n "subnets": [\n {\n "vpc": "workload",\n "zone": 1,\n "cidr": "10.40.0.0/28",\n "name": "vsi-zone-1",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 2,\n "cidr": "10.50.0.0/28",\n "name": "vsi-zone-2",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 3,\n "cidr": "10.60.0.0/28",\n "name": "vsi-zone-3",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 1,\n "cidr": "10.40.0.32/29",\n "name": "vpe-zone-1",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 2,\n "cidr": "10.50.0.32/29",\n "name": "vpe-zone-2",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n },\n {\n "vpc": "workload",\n "zone": 3,\n "cidr": "10.60.0.32/29",\n "name": "vpe-zone-3",\n "network_acl": "workload",\n "resource_group": "workload-rg",\n "public_gateway": false,\n "has_prefix": false\n }\n ],\n "public_gateways": [],\n "acls": [\n {\n "resource_group": "workload-rg",\n "name": "workload",\n "vpc": "workload",\n "rules": [\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "inbound",\n "name": "allow-ibm-inbound",\n "source": "161.26.0.0/16",\n "acl": "workload",\n "vpc": "workload",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "source": "10.0.0.0/8",\n "direction": "outbound",\n "name": "allow-ibm-outbound",\n "destination": "161.26.0.0/16",\n "acl": "workload",\n "vpc": "workload",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "inbound",\n "name": "allow-all-network-inbound",\n "source": "10.0.0.0/8",\n "acl": "workload",\n "vpc": "workload",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n },\n {\n "action": "allow",\n "destination": "10.0.0.0/8",\n "direction": "outbound",\n "name": "allow-all-network-outbound",\n "source": "10.0.0.0/8",\n "acl": "workload",\n "vpc": "workload",\n "icmp": {\n "type": null,\n "code": null\n },\n "tcp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n },\n "udp": {\n "port_min": null,\n "port_max": null,\n "source_port_min": null,\n "source_port_max": null\n }\n }\n ]\n }\n ]\n }\n ],\n "vpn_gateways": [\n {\n "name": "management-gateway",\n "resource_group": "management-rg",\n "subnet": "vpn-zone-1",\n "vpc": "management"\n }\n ],\n "vpn_servers": [],\n "vsi": [\n {\n "kms": "kms",\n "encryption_key": "vsi-volume-key",\n "image": "ibm-ubuntu-22-04-1-minimal-amd64-1",\n "profile": "cx2-4x8",\n "name": "management-server",\n "security_groups": [\n "management-vsi"\n ],\n "ssh_keys": [\n "ssh-key"\n ],\n "subnets": [\n "vsi-zone-1",\n "vsi-zone-2",\n "vsi-zone-3"\n ],\n "vpc": "management",\n "vsi_per_subnet": 2,\n "resource_group": "management-rg",\n "override_vsi_name": null,\n "user_data": "",\n "network_interfaces": [],\n "volumes": []\n }\n ],\n "classic_ssh_keys": [],\n "classic_vlans": []\n}', }, { data: ' Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n"License" shall mean the terms and conditions for use, reproduction,\nand distribution as defined by Sections 1 through 9 of this document.\n\n"Licensor" shall mean the copyright owner or entity authorized by\nthe copyright owner that is granting the License.\n\n"Legal Entity" shall mean the union of the acting entity and all\nother entities that control, are controlled by, or are under common\ncontrol with that entity. For the purposes of this definition,\n"control" means (i) the power, direct or indirect, to cause the\ndirection or management of such entity, whether by contract or\notherwise, or (ii) ownership of fifty percent (50%) or more of the\noutstanding shares, or (iii) beneficial ownership of such entity.\n\n"You" (or "Your") shall mean an individual or Legal Entity\nexercising permissions granted by this License.\n\n"Source" form shall mean the preferred form for making modifications,\nincluding but not limited to software source code, documentation\nsource, and configuration files.\n\n"Object" form shall mean any form resulting from mechanical\ntransformation or translation of a Source form, including but\nnot limited to compiled object code, generated documentation,\nand conversions to other media types.\n\n"Work" shall mean the work of authorship, whether in Source or\nObject form, made available under the License, as indicated by a\ncopyright notice that is included in or attached to the work\n(an example is provided in the Appendix below).\n\n"Derivative Works" shall mean any work, whether in Source or Object\nform, that is based on (or derived from) the Work and for which the\neditorial revisions, annotations, elaborations, or other modifications\nrepresent, as a whole, an original work of authorship. For the purposes\nof this License, Derivative Works shall not include works that remain\nseparable from, or merely link (or bind by name) to the interfaces of,\nthe Work and Derivative Works thereof.\n\n"Contribution" shall mean any work of authorship, including\nthe original version of the Work and any modifications or additions\nto that Work or Derivative Works thereof, that is intentionally\nsubmitted to Licensor for inclusion in the Work by the copyright owner\nor by an individual or Legal Entity authorized to submit on behalf of\nthe copyright owner. For the purposes of this definition, "submitted"\nmeans any form of electronic, verbal, or written communication sent\nto the Licensor or its representatives, including but not limited to\ncommunication on electronic mailing lists, source code control systems,\nand issue tracking systems that are managed by, or on behalf of, the\nLicensor for the purpose of discussing and improving the Work, but\nexcluding communication that is conspicuously marked or otherwise\ndesignated in writing by the copyright owner as "Not a Contribution."\n\n"Contributor" shall mean Licensor and any individual or Legal Entity\non behalf of whom a Contribution has been received by Licensor and\nsubsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\nthis License, each Contributor hereby grants to You a perpetual,\nworldwide, non-exclusive, no-charge, royalty-free, irrevocable\ncopyright license to reproduce, prepare Derivative Works of,\npublicly display, publicly perform, sublicense, and distribute the\nWork and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\nthis License, each Contributor hereby grants to You a perpetual,\nworldwide, non-exclusive, no-charge, royalty-free, irrevocable\n(except as stated in this section) patent license to make, have made,\nuse, offer to sell, sell, import, and otherwise transfer the Work,\nwhere such license applies only to those patent claims licensable\nby such Contributor that are necessarily infringed by their\nContribution(s) alone or by combination of their Contribution(s)\nwith the Work to which such Contribution(s) was submitted. If You\ninstitute patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Work\nor a Contribution incorporated within the Work constitutes direct\nor contributory patent infringement, then any patent licenses\ngranted to You under this License for that Work shall terminate\nas of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\nWork or Derivative Works thereof in any medium, with or without\nmodifications, and in Source or Object form, provided that You\nmeet the following conditions:\n\n(a) You must give any other recipients of the Work or\nDerivative Works a copy of this License; and\n\n(b) You must cause any modified files to carry prominent notices\nstating that You changed the files; and\n\n(c) You must retain, in the Source form of any Derivative Works\nthat You distribute, all copyright, patent, trademark, and\nattribution notices from the Source form of the Work,\nexcluding those notices that do not pertain to any part of\nthe Derivative Works; and\n\n(d) If the Work includes a "NOTICE" text file as part of its\ndistribution, then any Derivative Works that You distribute must\ninclude a readable copy of the attribution notices contained\nwithin such NOTICE file, excluding those notices that do not\npertain to any part of the Derivative Works, in at least one\nof the following places: within a NOTICE text file distributed\nas part of the Derivative Works; within the Source form or\ndocumentation, if provided along with the Derivative Works; or,\nwithin a display generated by the Derivative Works, if and\nwherever such third-party notices normally appear. The contents\nof the NOTICE file are for informational purposes only and\ndo not modify the License. You may add Your own attribution\nnotices within Derivative Works that You distribute, alongside\nor as an addendum to the NOTICE text from the Work, provided\nthat such additional attribution notices cannot be construed\nas modifying the License.\n\nYou may add Your own copyright statement to Your modifications and\nmay provide additional or different license terms and conditions\nfor use, reproduction, or distribution of Your modifications, or\nfor any such Derivative Works as a whole, provided Your use,\nreproduction, and distribution of the Work otherwise complies with\nthe conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\nany Contribution intentionally submitted for inclusion in the Work\nby You to the Licensor shall be under the terms and conditions of\nthis License, without any additional terms or conditions.\nNotwithstanding the above, nothing herein shall supersede or modify\nthe terms of any separate license agreement you may have executed\nwith Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\nnames, trademarks, service marks, or product names of the Licensor,\nexcept as required for reasonable and customary use in describing the\norigin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\nagreed to in writing, Licensor provides the Work (and each\nContributor provides its Contributions) on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied, including, without limitation, any warranties or conditions\nof TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\nPARTICULAR PURPOSE. You are solely responsible for determining the\nappropriateness of using or redistributing the Work and assume any\nrisks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\nwhether in tort (including negligence), contract, or otherwise,\nunless required by applicable law (such as deliberate and grossly\nnegligent acts) or agreed to in writing, shall any Contributor be\nliable to You for damages, including any direct, indirect, special,\nincidental, or consequential damages of any character arising as a\nresult of this License or out of the use or inability to use the\nWork (including but not limited to damages for loss of goodwill,\nwork stoppage, computer failure or malfunction, or any and all\nother commercial damages or losses), even if such Contributor\nhas been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\nthe Work or Derivative Works thereof, You may choose to offer,\nand charge a fee for, acceptance of support, warranty, indemnity,\nor other liability obligations and/or rights consistent with this\nLicense. However, in accepting such obligations, You may act only\non Your own behalf and on Your sole responsibility, not on behalf\nof any other Contributor, and only if You agree to indemnify,\ndefend, and hold each Contributor harmless for any liability\nincurred by, or claims asserted against, such Contributor by reason\nof your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following\nboilerplate notice, with the fields enclosed by brackets "[]"\nreplaced with your own identifying information. (Don\'t include\nthe brackets!) The text should be enclosed in the appropriate\ncomment syntax for the file format. We also recommend that a\nfile or class name and description of purpose be included on the\nsame "printed page" as the copyright notice for easier\nidentification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the "License");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n', @@ -288,7 +288,7 @@ describe("craig api", () => { ' "enable_classic": false,\n' + ' "dynamic_subnets": true,\n' + ' "enable_power_vs": false,\n' + - ' "craig_version": "1.11.1",\n' + + ' "craig_version": "1.11.2",\n' + ' "power_vs_zones": [],\n' + ' "power_vs_high_availability": false\n' + " },\n" + diff --git a/unit-tests/forms/invalid-callbacks.test.js b/unit-tests/forms/invalid-callbacks.test.js index 4eaf5c81..4e740d56 100644 --- a/unit-tests/forms/invalid-callbacks.test.js +++ b/unit-tests/forms/invalid-callbacks.test.js @@ -1,7 +1,6 @@ const { assert } = require("chai"); const { invalidName, - invalidSshPublicKey, invalidTagList, invalidCrnList, invalidIpCommaList, @@ -700,499 +699,6 @@ describe("invalid callbacks", () => { ); assert.isTrue(actualData, "it should be true"); }); - describe("invalidSshKey", () => { - it("should return false when updating name and NONE", () => { - let actualData = invalidSshPublicKey( - { - use_data: false, - name: "new-name", - resource_group: "management-rg", - public_key: "NONE", - }, - { - craig: { - store: { - json: { - ssh_keys: [ - { - name: "ssh-key", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - ], - }, - }, - }, - data: { - name: "ssh-key", - }, - } - ); - assert.deepEqual( - actualData, - { - invalid: false, - invalidText: "", - }, - "it should be valid" - ); - }); - it("should return false when updating name", () => { - let actualData = invalidSshPublicKey( - { - use_data: false, - name: "new-name", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - craig: { - store: { - json: { - ssh_keys: [ - { - name: "ssh-key", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - ], - }, - }, - }, - data: { - name: "ssh-key", - }, - } - ).invalid; - assert.isFalse(actualData); - }); - it("should return true when adding duplicate public key", () => { - let actualData = invalidSshPublicKey( - { - use_data: false, - name: "hi", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - craig: { - store: { - json: { - ssh_keys: [ - { - name: "ssh-key", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - ], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isTrue(actualData); - }); - it("should return true when key invalid", () => { - let actualData = invalidSshPublicKey( - { - use_data: false, - name: "hi", - public_key: "honk", - }, - { - craig: { - store: { - json: { - ssh_keys: [], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isTrue(actualData); - }); - it("should return false when adding valid key", () => { - let actualData = invalidSshPublicKey( - { - use_data: false, - name: "hi", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - craig: { - store: { - json: { - ssh_keys: [], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isFalse(actualData); - }); - describe("invalidSshKey", () => { - it("should return false when updating name", () => { - let actualData = invalidSshPublicKey( - { - use_data: false, - name: "new-name", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - craig: { - store: { - json: { - ssh_keys: [ - { - name: "ssh-key", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - ], - }, - }, - }, - data: { - name: "ssh-key", - }, - } - ).invalid; - assert.isFalse(actualData); - }); - it("should return true when adding duplicate public key", () => { - let actualData = invalidSshPublicKey( - { - use_data: false, - name: "hi", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - craig: { - store: { - json: { - ssh_keys: [ - { - name: "ssh-key", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - ], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isTrue(actualData); - }); - it("should return true when key invalid", () => { - let actualData = invalidSshPublicKey( - { - name: "hi", - public_key: "honk", - }, - { - craig: { - store: { - json: { - ssh_keys: [], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isTrue(actualData); - }); - it("should return false when adding valid key", () => { - let actualData = invalidSshPublicKey( - { - use_data: false, - name: "hi", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - craig: { - store: { - json: { - ssh_keys: [], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isFalse(actualData); - }); - it("should return true when ssh key is null", () => { - let actualData = invalidSshPublicKey( - { - name: "hi", - resource_group: "management-rg", - public_key: null, - }, - { - craig: { - store: { - json: { - ssh_keys: [], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isTrue(actualData); - }); - it("should return true when creating duplicate public key in same workspace", () => { - let actualData = invalidSshPublicKey( - { - name: "power-key", - resource_group: "craig-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - powerVs: true, - arrayParentName: "workspace", - craig: { - store: { - json: { - power: [ - { - name: "workspace", - resource_group: "craig-rg", - ssh_keys: [ - { - name: "power-key", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - workspace: "workspace", - }, - ], - }, - ], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isTrue(actualData); - }); - it("should return false when creating duplicate public key in another workspace", () => { - let actualData = invalidSshPublicKey( - { - name: "power-key-2", - resource_group: "craig-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - powerVs: true, - arrayParentName: "other-workspace", - craig: { - store: { - json: { - power: [ - { - name: "workspace", - resource_group: "craig-rg", - ssh_keys: [ - { - name: "power-key", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - workspace: "workspace", - }, - ], - }, - { - name: "other-workspace", - resource_group: "craig-rg", - ssh_keys: [], - }, - ], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isFalse(actualData); - }); - it("should return false when creating power key using the same public key as in regular ssh keys", () => { - let actualData = invalidSshPublicKey( - { - name: "power-key", - resource_group: "craig-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - powerVs: true, - arrayParentName: "workspace", - craig: { - store: { - json: { - ssh_keys: [ - { - name: "ssh-key", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - ], - power: [ - { - name: "workspace", - ssh_keys: [], - }, - ], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isFalse(actualData); - }); - it("should return false when creating power key with props passed from invalid-forms", () => { - let actualData = invalidSshPublicKey( - { - name: "power-key", - resource_group: "craig-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - workspace: "power-workspace", - }, - { - craig: { - store: { - json: { - ssh_keys: [ - { - name: "ssh-key", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - ], - power: [ - { - name: "workspace", - ssh_keys: [], - }, - ], - }, - }, - }, - data: { - name: "hi", - }, - arrayParentName: "workspace", - } - ).invalid; - assert.isFalse(actualData); - }); - it("should return false when creating classic key using the same public key as in regular ssh keys", () => { - let actualData = invalidSshPublicKey( - { - name: "classic-key", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - classic: true, - craig: { - store: { - json: { - ssh_keys: [ - { - name: "ssh-key", - resource_group: "management-rg", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - ], - classic_ssh_keys: [], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isFalse(actualData); - }); - it("should return true when creating duplicate classic key using the same public key as in classic ssh keys", () => { - let actualData = invalidSshPublicKey( - { - name: "classic-key-2", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - { - classic: true, - craig: { - store: { - json: { - classic_ssh_keys: [ - { - name: "classic-key", - public_key: - "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", - }, - ], - }, - }, - }, - data: { - name: "hi", - }, - } - ).invalid; - assert.isTrue(actualData); - }); - }); - }); describe("invalidTagList", () => { it("should return true when invalid tag list", () => { assert.isTrue(invalidTagList(["hi", "2@@@2"])); diff --git a/unit-tests/forms/wizard.test.js b/unit-tests/forms/wizard.test.js index ffafb096..6d496d52 100644 --- a/unit-tests/forms/wizard.test.js +++ b/unit-tests/forms/wizard.test.js @@ -57,7 +57,7 @@ describe("setup wizard", () => { enable_power_vs: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ @@ -967,7 +967,7 @@ describe("setup wizard", () => { enable_power_vs: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ @@ -1876,7 +1876,7 @@ describe("setup wizard", () => { enable_power_vs: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ @@ -2381,7 +2381,7 @@ describe("setup wizard", () => { enable_power_vs: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ @@ -2877,7 +2877,7 @@ describe("setup wizard", () => { enable_power_vs: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ @@ -3450,7 +3450,7 @@ describe("setup wizard", () => { enable_power_vs: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", }, resource_groups: [ { use_prefix: true, name: "service-rg", use_data: false }, @@ -3616,7 +3616,7 @@ describe("setup wizard", () => { enable_power_vs: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ @@ -4181,7 +4181,7 @@ describe("setup wizard", () => { enable_power_vs: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ @@ -4720,7 +4720,7 @@ describe("setup wizard", () => { enable_power_vs: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ @@ -5264,7 +5264,7 @@ describe("setup wizard", () => { enable_classic: false, enable_classic: false, power_vs_zones: [], - craig_version: "1.11.1", + craig_version: "1.11.2", }, resource_groups: [ { use_prefix: true, name: "service-rg", use_data: false }, @@ -5750,7 +5750,7 @@ describe("setup wizard", () => { enable_power_vs: true, enable_classic: false, power_vs_zones: ["dal10"], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ @@ -6246,7 +6246,7 @@ describe("setup wizard", () => { enable_power_vs: true, enable_classic: false, power_vs_zones: ["dal10"], - craig_version: "1.11.1", + craig_version: "1.11.2", power_vs_high_availability: false, }, resource_groups: [ diff --git a/unit-tests/state/power-vs.test.js b/unit-tests/state/power-vs.test.js index 91bcbdbc..8c78808f 100644 --- a/unit-tests/state/power-vs.test.js +++ b/unit-tests/state/power-vs.test.js @@ -433,6 +433,10 @@ describe("power-vs", () => { public_key: "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", }, + { + name: "aaa", + public_key: "NONE", + }, ], }, ], @@ -458,6 +462,54 @@ describe("power-vs", () => { "it should return correct text" ); }); + it("should return correct invalid text when not a duplicate ssh key is added", () => { + let tempState = newState(); + tempState.store = { + resourceGroups: ["hi"], + json: { + ssh_keys: [], + power: [ + { + name: "workspace", + ssh_keys: [ + { + name: "honk", + public_key: + "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", + }, + { + name: "ddd", + public_key: + "ssh-rsa AAAAB3NzaC1yc2thisisafakesshkeyDSKLFHSJSADFHGASJDSHDBASJKDASDASWDAS+/DSFSDJKFGXFVJDZHXCDZVZZCDKJFGSDJFZDHCVBSDUCZCXZKCHT= test@fakeemail.com", + }, + { + name: "aaa", + public_key: "NONE", + }, + ], + }, + ], + }, + }; + assert.deepEqual( + tempState.power.ssh_keys.public_key.invalidText( + { + name: "test", + resource_group: "hi", + public_key: "NONE", + }, + { + data: { + data: "test", + }, + arrayParentName: "workspace", + craig: tempState, + } + ), + "", + "it should return correct text" + ); + }); }); describe("invalid", () => { it("should return true when key in modal is invalid when no data", () => { diff --git a/unit-tests/state/ssh-keys.test.js b/unit-tests/state/ssh-keys.test.js index 3b03406d..64489409 100644 --- a/unit-tests/state/ssh-keys.test.js +++ b/unit-tests/state/ssh-keys.test.js @@ -118,6 +118,21 @@ describe("ssh_keys", () => { }); describe("ssh_keys.schema", () => { describe("public_key", () => { + it("should not be invalid if the key is NONE and another NONE key exists", () => { + let craig = newState(); + craig.store.json.ssh_keys.push({ name: "test", public_key: "NONE" }); + assert.isFalse( + craig.ssh_keys.public_key.invalid( + { public_key: "NONE" }, + { + data: {}, + isModal: true, + craig: craig, + } + ), + "it should be valid" + ); + }); describe("hideWhen", () => { it("should return true when use data is true", () => { let craig = newState(); diff --git a/unit-tests/state/vpn.test.js b/unit-tests/state/vpn.test.js index 7034cde3..00f4d0c8 100644 --- a/unit-tests/state/vpn.test.js +++ b/unit-tests/state/vpn.test.js @@ -434,7 +434,15 @@ describe("vpn_gateways", () => { "it should be invalid" ); }); - it("should be invalid when peer address is cidr", () => { + it("should be valid when peer address is cidr", () => { + assert.isFalse( + craig.vpn_gateways.connections.peer_address.invalid({ + peer_address: "131.239.211.196", + }), + "it should be valid" + ); + }); + it("should be valid when peer address is valid ip", () => { assert.isTrue( craig.vpn_gateways.connections.peer_address.invalid({ peer_address: "1.2.3.4/5",