skeet
Version:
Full-stack TypeScript Serverless Framework
27 lines (25 loc) • 566 B
text/typescript
import { execSyncCmd } from '@/lib/execSyncCmd'
import { getNetworkConfig } from '@/lib/getNetworkConfig'
export const createConnector = async (
projectId: string,
appName: string,
region: string
) => {
const networkNames = await getNetworkConfig(projectId, appName)
const shCmd = [
'gcloud',
'compute',
'networks',
'vpc-access',
'connectors',
'create',
networkNames.connectorName,
'--region',
region,
'--subnet-project',
projectId,
'--subnet',
networkNames.subnetName,
]
await execSyncCmd(shCmd)
}