A Go SDK and AWS-style command-line tool for GreenNode, formerly VNG Cloud. Inspect resources, get price quotes, and create, change, and delete resources from Go, a terminal, or scripts.
This is a personal, unofficial project, not affiliated with or endorsed by
GreenNode or VNG. Since v1.0.0 it follows semantic versioning: public SDK
names, types, and fields, CLI flags, query keys, and exit codes change only
in a new major version.
Tags | Release notes | Wiki
Use the Go version required by go.mod or later. Install the CLI, configure an IAM-user profile, and read your budgets without creating or changing cloud resources:
go install danny.vn/vngcloud/cmd/vngcloud@latest # or pin a release tag
vngcloud configure
vngcloud billing list-budgets --read-onlyAdd Go's binary directory to PATH if your shell cannot find vngcloud.
Configuration asks for a region, the root account email, IAM username,
password, and optional two-factor authentication secret. Passwords and
secrets are not echoed. The IAM user needs permission for the read.
See credential setup and authentication methods for
service accounts, environment variables, static tokens, and custom
credential providers.
Commands follow vngcloud <service> <operation> [flags]:
vngcloud compute list-servers --read-only --output table
vngcloud compute list-servers --read-only --query 'Items[].Name' --output text
vngcloud compute list-servers --helpCreate a named profile with vngcloud configure --profile production, then
select it with --profile production. Use --region to select another
region and --project-id when more than one project matches the region.
The CLI reference covers commands, flags, output, queries, and exit
codes.
Add the module to your Go project:
go get danny.vn/vngcloud@latestThe SDK uses the same profiles and environment variables as the CLI. After configuring credentials above, this program reads your budgets:
package main
import (
"context"
"fmt"
"log"
"danny.vn/vngcloud"
"danny.vn/vngcloud/billing"
)
func main() {
ctx := context.Background()
cfg, err := vngcloud.LoadConfig(ctx)
if err != nil {
log.Fatal(err)
}
budgets, err := billing.New(cfg).ListBudgets(ctx, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Budgets: %d\n", len(budgets.Items))
}Each service has its own package and New(cfg) client. Clients built from
the same configuration share authentication and project discovery. The SDK
packages use only the Go standard library. See
Getting Started for client setup and the
Go reference for package details.
- Inspect resources and quotas across services. Use the canonical service coverage for supported operations and prerequisites.
- Create and delete resources, including credit-paid servers, volumes, NAT
gateways, private VKS clusters, Global Load Balancers with TCP pools and
listeners, vDB MySQL instances, and private endpoints. Creates with a price
quote refuse a quote above
--max-price; creates without a quote API (Global Load Balancer, VKS, vDB) need explicit--yesconsent. - Read budgets, costs, and balances, or get price quotes before an order. See Billing and Pricing.
- Manage vStorage buckets and keys or transfer objects through the separate native S3 client. See Storage and Storage Objects.
- Automate supported management operations from scripts or Go. Check each service guide and the known limitations before writing.
- JSON is the default output. Use
--queryfor JMESPath filtering and--output tableor--output textfor other formats. - Errors go to stderr as JSON with stable exit codes. Commands never prompt without a terminal.
--read-onlyrefuses every CLI write before a request. A profile'sread_only = trueorVNGCLOUD_READ_ONLY=1also enables the guard.- Destructive commands require
--yes. Supported paid creates and resizes compare a quote against--max-pricebefore ordering. That check is not a provider price lock or a final billing guarantee. Quotes place no orders.
To prepare a separate profile for scripts or an AI agent:
vngcloud configure --profile agent
vngcloud configure set read_only true --profile agent
vngcloud compute list-servers --profile agent --output jsonThe read-only guard applies to the CLI. Use IAM policies to restrict the credentials themselves. See Security for credential storage, token caching, and write guards.
- Getting Started: installation and client setup.
- Configuration and Authentication: profiles, identities, regions, projects, and credentials.
- CLI reference: commands, flags, queries, and exit codes.
- Service coverage and known limitations.
- Storage Workload Access: application identities, bucket grants, private key handoff, rotation, and network prerequisites for vServer and VKS.
- Contributing: development setup and required checks.
If you want, share what you use vngcloud for on GitHub Issues, without configuration or account details. Report security problems privately through SECURITY.md.
Licensed under Apache 2.0.