@propulsionworks/cfn-resource-schemas
v0.1.71
Published
Versioned mirror of AWS CloudFormation Resource Schemas (unofficial)
Readme
@propulsionworks/cfn-resource-schemas
This repository contains the CloudFormation resource provider schemas for the us-east-1 region.
The schemas are checked weekly (on Monday) for changes, and if there are any, a new version of this package is automatically published.
Usage
Schemas
The resource schemas are available via loadSchemas(). These are as-published by Amazon, with two additional fields:
$id: the original filename, without the.jsonextension$integrity: an Subresource Integrity value for the schema (excluding$idand$integrityattributes)
import { loadSchemas } from "@propulsionworks/cfn-resource-schemas";
import { ResourceTypeSchemaWithMeta } from "@propulsionworks/cfn-resource-schemas/types";
const schemas = loadSchemas();
for await (const schema of schemas) {
// schema is a ResourceTypeSchemaWithMeta
}Supplemental
Extra data is available via loadSupplemental(). This contains improved documentation (sourced from @aws-cdk/aws-service-spec) and a field wellKnownType for some properties that provides more information about the property type not available in the resource schema. At present, the only possible value for this field is "iam-policy", which means that the field should contain a IAM Policy document.
For each resource, definition, and property, a documentationUrl value is provided, containing a generated link to the AWS documentation (e.g. AWS::Lambda::Function).
import { loadSupplemental } from "@propulsionworks/cfn-resource-schemas";
import { ResourceSupplemental } from "@propulsionworks/cfn-resource-schemas/types";
const resources = loadSupplemental();
for await (const resource of resources) {
// resource is a ResourceSupplemental
}The supplemental data has the following shape:
export type ResourceSupplemental = {
attributes: ObjectSupplemental;
definitions: Record<string, ObjectSupplemental>;
description?: string | undefined;
documentationUrl?: string | undefined;
properties: Record<string, PropertySupplemental>;
typeName: string;
};
export type ObjectSupplemental = {
description?: string | undefined;
documentationUrl?: string | undefined;
properties: Record<string, PropertySupplemental>;
};
export type PropertySupplemental = {
description?: string | undefined;
documentationUrl?: string | undefined;
wellKnownType?: WellKnownType | undefined;
};
export type WellKnownType = "iam-policy";