Skip to content

Commit

Permalink
feat(project-create): add project create options (#320)
Browse files Browse the repository at this point in the history
Blocked on neondatabase/cloud#23625

This commit introduces new options for project updates, including
`block_vpc_connections` and `block_public_connections`.

neondatabase/cloud#21903
  • Loading branch information
chaporgin authored Feb 7, 2025
1 parent 4e46d5f commit 07308ec
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/commands/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ export const builder = (argv: yargs.Argv) => {
'Create a project',
(yargs) =>
yargs.options({
'block-public-connections': {
describe:
projectCreateRequest['project.settings.block_public_connections']
.description,
type: 'boolean',
},
'block-vpc-connections': {
describe:
projectCreateRequest['project.settings.block_vpc_connections']
.description,
type: 'boolean',
},
name: {
describe: projectCreateRequest['project.name'].description,
type: 'string',
Expand Down Expand Up @@ -217,6 +229,8 @@ const list = async (props: CommonProps & { orgId?: string }) => {

const create = async (
props: CommonProps & {
blockPublicConnections?: boolean;
blockVpcConnections?: boolean;
name?: string;
regionId?: string;
cu?: string;
Expand All @@ -229,6 +243,18 @@ const create = async (
},
) => {
const project: ProjectCreateRequest['project'] = {};
if (props.blockPublicConnections !== undefined) {
if (!project.settings) {
project.settings = {};
}
project.settings.block_public_connections = props.blockPublicConnections;
}
if (props.blockVpcConnections !== undefined) {
if (!project.settings) {
project.settings = {};
}
project.settings.block_vpc_connections = props.blockVpcConnections;
}
if (props.name) {
project.name = props.name;
}
Expand Down

0 comments on commit 07308ec

Please sign in to comment.