Help us shape the future of Go! Take the 2026 Go Developer Survey

cfnattrgen

command
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Command cfnattrgen generates services/cloudformation's Fn::GetAtt attribute table from the CloudFormation resource specification. Real CreateStack/UpdateStack rejects Fn::GetAtt on an attribute a resource type doesn't support ("Template error: resource <X> does not support attribute type <Y> in Fn::GetAtt"); this table is what lets validateIntrinsics tell an undocumented attribute from a merely-unmodelled one (gopherstack-p7pvq).

The table is emitted as JSON (services/cloudformation/cfn_attributes.json), not Go source: goconst counts string literals package-wide, and a generated .go file's literals still push hand-written files over the min-occurrences threshold even when the generated file itself is excluded from lint reporting (verified empirically -- see gopherstack-erj2j). A resource type is included only when the package declares a resTypeXxx constant for it (the provisioner's supported-types surface) and the spec documents a non-empty Attributes set for it; every documented attribute is emitted, since there's no literal-count reason left to drop any.

Usage:

go run ./cmd/cfnattrgen -spec <cfn-resource-spec.json> -src <dir> -out <out.json>

Or, to refresh the trimmed spec fixture used for -spec from a fresh download of the full CloudFormation resource specification:

go run ./cmd/cfnattrgen -spec <full-spec.json> -trimspec-out <fixture.json>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL