ardent-cli 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +59 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -700,6 +700,33 @@ async function createAction2(type, url, options) {
|
|
|
700
700
|
console.error(` Supported: ${supportedTypes.join(", ")}`);
|
|
701
701
|
process.exit(1);
|
|
702
702
|
}
|
|
703
|
+
const deploymentModel = options.deploymentModel ?? "ardent-cloud";
|
|
704
|
+
if (deploymentModel !== "ardent-cloud" && deploymentModel !== "customer-cloud") {
|
|
705
|
+
console.error(`\u2717 Invalid --deployment-model: ${deploymentModel}`);
|
|
706
|
+
console.error(" Supported: ardent-cloud, customer-cloud");
|
|
707
|
+
process.exit(1);
|
|
708
|
+
}
|
|
709
|
+
const isCustomerCloud = deploymentModel === "customer-cloud";
|
|
710
|
+
if (isCustomerCloud) {
|
|
711
|
+
const missing = [];
|
|
712
|
+
if (!options.awsRoleArn) missing.push("--aws-role-arn");
|
|
713
|
+
if (!options.awsExternalId) missing.push("--aws-external-id");
|
|
714
|
+
if (!options.awsRegion) missing.push("--aws-region");
|
|
715
|
+
if (missing.length > 0) {
|
|
716
|
+
console.error(
|
|
717
|
+
`\u2717 ${missing.join(", ")} required when --deployment-model=customer-cloud`
|
|
718
|
+
);
|
|
719
|
+
process.exit(1);
|
|
720
|
+
}
|
|
721
|
+
} else {
|
|
722
|
+
const stray = options.awsRoleArn || options.awsExternalId || options.awsRegion;
|
|
723
|
+
if (stray) {
|
|
724
|
+
console.error(
|
|
725
|
+
"\u2717 --aws-role-arn / --aws-external-id / --aws-region require --deployment-model=customer-cloud"
|
|
726
|
+
);
|
|
727
|
+
process.exit(1);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
703
730
|
const isByoc = Boolean(options.byoc);
|
|
704
731
|
if (isByoc) {
|
|
705
732
|
if (!options.apiKey || !options.projectId) {
|
|
@@ -727,7 +754,9 @@ async function createAction2(type, url, options) {
|
|
|
727
754
|
}
|
|
728
755
|
let createPayload;
|
|
729
756
|
if (isByoc) {
|
|
730
|
-
console.log(
|
|
757
|
+
console.log(
|
|
758
|
+
`Creating connector (BYOC Neon${isCustomerCloud ? ", customer-cloud data plane" : ""})...`
|
|
759
|
+
);
|
|
731
760
|
createPayload = {
|
|
732
761
|
name: connectorName,
|
|
733
762
|
service_name: "postgresql",
|
|
@@ -744,7 +773,9 @@ async function createAction2(type, url, options) {
|
|
|
744
773
|
console.error(" Example: postgresql://user:password@host:5432/db");
|
|
745
774
|
process.exit(1);
|
|
746
775
|
}
|
|
747
|
-
console.log(
|
|
776
|
+
console.log(
|
|
777
|
+
`Creating connector${isCustomerCloud ? " (customer-cloud data plane)" : ""}...`
|
|
778
|
+
);
|
|
748
779
|
createPayload = {
|
|
749
780
|
name: connectorName,
|
|
750
781
|
service_name: "postgresql",
|
|
@@ -757,6 +788,14 @@ async function createAction2(type, url, options) {
|
|
|
757
788
|
}
|
|
758
789
|
};
|
|
759
790
|
}
|
|
791
|
+
if (isCustomerCloud) {
|
|
792
|
+
createPayload.deployment_model = "customer-cloud";
|
|
793
|
+
createPayload.byoc_access_credentials = {
|
|
794
|
+
role_arn: options.awsRoleArn,
|
|
795
|
+
external_id: options.awsExternalId,
|
|
796
|
+
region: options.awsRegion
|
|
797
|
+
};
|
|
798
|
+
}
|
|
760
799
|
const created = await api.post("/v1/connectors", createPayload);
|
|
761
800
|
const connectorId = created.id;
|
|
762
801
|
if (isByoc) {
|
|
@@ -807,7 +846,11 @@ async function createAction2(type, url, options) {
|
|
|
807
846
|
setCacheEntry("connectors", cachedConnectors);
|
|
808
847
|
setConfig("currentConnectorId", connectorId);
|
|
809
848
|
setConfig("currentConnectorName", connectorName);
|
|
810
|
-
trackEvent("CLI: connector create succeeded", {
|
|
849
|
+
trackEvent("CLI: connector create succeeded", {
|
|
850
|
+
db_type: type,
|
|
851
|
+
byoc: isByoc,
|
|
852
|
+
deployment_model: deploymentModel
|
|
853
|
+
});
|
|
811
854
|
console.log("\u2713 Connector created and ready");
|
|
812
855
|
console.log(` ID: ${connectorId}`);
|
|
813
856
|
showNextStep();
|
|
@@ -1009,7 +1052,19 @@ async function switchAction2(name) {
|
|
|
1009
1052
|
|
|
1010
1053
|
// src/commands/connector/index.ts
|
|
1011
1054
|
var connectorCommand = new Command2("connector").description("Manage database connectors");
|
|
1012
|
-
connectorCommand.command("create <type> [url]").description("Create a new connector").option("-n, --name <name>", "Connector name").option("--byoc <provider>", "Bring your own Neon project (e.g. neon)").option("--api-key <key>", "Neon API key (required with --byoc)").option("--project-id <id>", "Neon project ID (required with --byoc)").
|
|
1055
|
+
connectorCommand.command("create <type> [url]").description("Create a new connector").option("-n, --name <name>", "Connector name").option("--byoc <provider>", "Bring your own Neon project (e.g. neon)").option("--api-key <key>", "Neon API key (required with --byoc)").option("--project-id <id>", "Neon project ID (required with --byoc)").option(
|
|
1056
|
+
"--deployment-model <model>",
|
|
1057
|
+
"'ardent-cloud' (default) or 'customer-cloud' to route CDC through the customer's AWS account"
|
|
1058
|
+
).option(
|
|
1059
|
+
"--aws-role-arn <arn>",
|
|
1060
|
+
"ArdentDeployer role ARN in the customer account (required with --deployment-model=customer-cloud)"
|
|
1061
|
+
).option(
|
|
1062
|
+
"--aws-external-id <id>",
|
|
1063
|
+
"External ID for sts:AssumeRole (required with --deployment-model=customer-cloud)"
|
|
1064
|
+
).option(
|
|
1065
|
+
"--aws-region <region>",
|
|
1066
|
+
"AWS region of the customer data plane (required with --deployment-model=customer-cloud)"
|
|
1067
|
+
).action(createAction2);
|
|
1013
1068
|
connectorCommand.command("list").description("List your connectors").action(listAction2);
|
|
1014
1069
|
connectorCommand.command("switch <name>").description("Switch to a different connector").action(switchAction2);
|
|
1015
1070
|
connectorCommand.command("delete <name>").description("Delete a connector by name").action(deleteAction2);
|