cfnattrgen

command
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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