Manage custom CloudFormation resource types and extensions.
Registers a new custom resource type or module in the CloudFormation registry.
/**
* Registers a custom resource type, module, or hook with CloudFormation
* Enables use of third-party and custom resource types in templates
*/
class RegisterTypeCommand {
constructor(input: RegisterTypeCommandInput);
}
interface RegisterTypeCommandInput {
/** Type of extension to register */
Type?: RegistryType;
/** Unique name for the type */
TypeName: string;
/** S3 URL or inline schema handler package */
SchemaHandlerPackage: string;
/** Logging configuration for the type */
LoggingConfig?: LoggingConfig;
/** IAM execution role ARN for the type */
ExecutionRoleArn?: string;
/** Unique identifier for idempotency */
ClientRequestToken?: string;
/** Type configuration alias */
TypeConfigurationAlias?: string;
}
interface RegisterTypeCommandOutput {
/** Registration token for tracking */
RegistrationToken?: string;
}
interface LoggingConfig {
/** CloudWatch Logs group name */
LogRoleArn: string;
/** Log group name */
LogGroupName: string;
}
type RegistryType =
| "RESOURCE"
| "MODULE"
| "HOOK";Usage Examples:
import {
CloudFormationClient,
RegisterTypeCommand,
DescribeTypeRegistrationCommand,
ActivateTypeCommand
} from "@aws-sdk/client-cloudformation";
const client = new CloudFormationClient({ region: "us-east-1" });
// Register a custom resource type
const registerCommand = new RegisterTypeCommand({
Type: "RESOURCE",
TypeName: "MyCompany::CustomService::Database",
SchemaHandlerPackage: "s3://my-bucket/custom-resource-handler.zip",
LoggingConfig: {
LogRoleArn: "arn:aws:iam::123456789012:role/CloudWatchLogsRole",
LogGroupName: "/aws/cloudformation/custom-resource-logs"
},
ExecutionRoleArn: "arn:aws:iam::123456789012:role/CustomResourceExecutionRole"
});
const registration = await client.send(registerCommand);
console.log("Registration token:", registration.RegistrationToken);
// Register a CloudFormation module
const moduleCommand = new RegisterTypeCommand({
Type: "MODULE",
TypeName: "MyCompany::NetworkingModule::VPC",
SchemaHandlerPackage: "s3://my-bucket/vpc-module.zip"
});
const moduleRegistration = await client.send(moduleCommand);Retrieves the status and details of a type registration operation.
/**
* Retrieves registration status and details for a type registration
* Shows progress and any errors during registration process
*/
class DescribeTypeRegistrationCommand {
constructor(input: DescribeTypeRegistrationCommandInput);
}
interface DescribeTypeRegistrationCommandInput {
/** Registration token from RegisterType operation */
RegistrationToken: string;
}
interface DescribeTypeRegistrationCommandOutput {
/** Registration progress status */
ProgressStatus?: RegistrationStatus;
/** Type description */
Description?: string;
/** Type ARN */
TypeArn?: string;
/** Type version ARN */
TypeVersionArn?: string;
}
type RegistrationStatus =
| "COMPLETE"
| "IN_PROGRESS"
| "FAILED";Activates a registered type for use in CloudFormation templates.
/**
* Activates a registered type for use in CloudFormation operations
* Makes the type available for template usage
*/
class ActivateTypeCommand {
constructor(input: ActivateTypeCommandInput);
}
interface ActivateTypeCommandInput {
/** Type of extension */
Type?: RegistryType;
/** Public type name */
PublicTypeArn?: string;
/** Publisher ID */
PublisherId?: string;
/** Type name */
TypeName?: string;
/** Type name alias */
TypeNameAlias?: string;
/** Auto-update configuration */
AutoUpdate?: boolean;
/** Logging configuration */
LoggingConfig?: LoggingConfig;
/** Execution role ARN */
ExecutionRoleArn?: string;
/** Version bump for updates */
VersionBump?: VersionBump;
/** Major version for activation */
MajorVersion?: number;
}
interface ActivateTypeCommandOutput {
/** ARN of the activated type */
Arn?: string;
}
type VersionBump =
| "MAJOR"
| "MINOR";Deactivates a type, preventing its use in new CloudFormation operations.
/**
* Deactivates a type to prevent use in new CloudFormation operations
* Existing stacks using the type are not affected
*/
class DeactivateTypeCommand {
constructor(input: DeactivateTypeCommandInput);
}
interface DeactivateTypeCommandInput {
/** Type name */
TypeName?: string;
/** Type of extension */
Type?: RegistryType;
/** Type ARN */
Arn?: string;
}
interface DeactivateTypeCommandOutput {
/** ARN of the deactivated type */
Arn?: string;
}Retrieves detailed information about a registered type.
/**
* Retrieves detailed information about a registered type
* Includes schema, configuration, and usage information
*/
class DescribeTypeCommand {
constructor(input: DescribeTypeCommandInput);
}
interface DescribeTypeCommandInput {
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
/** Type ARN */
Arn?: string;
/** Version ID */
VersionId?: string;
/** Publisher ID */
PublisherId?: string;
/** Public version number */
PublicVersionNumber?: string;
}
interface DescribeTypeCommandOutput {
/** Type ARN */
Arn?: string;
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
/** Default version ID */
DefaultVersionId?: string;
/** Type tests status */
TypeTestsStatus?: TypeTestsStatus;
/** Description */
Description?: string;
/** JSON Schema for the type */
Schema?: string;
/** Provisioning type */
ProvisioningType?: ProvisioningType;
/** Deprecation status */
DeprecatedStatus?: DeprecatedStatus;
/** Logging configuration */
LoggingConfig?: LoggingConfig;
/** Required activated types */
RequiredActivatedTypes?: RequiredActivatedType[];
/** Execution role ARN */
ExecutionRoleArn?: string;
/** Visibility */
Visibility?: Visibility;
/** Source URL */
SourceUrl?: string;
/** Documentation URL */
DocumentationUrl?: string;
/** Last updated timestamp */
LastUpdated?: Date;
/** Time created */
TimeCreated?: Date;
/** Configuration schema */
ConfigurationSchema?: string;
/** Publisher ID */
PublisherId?: string;
/** Original type name */
OriginalTypeName?: string;
/** Original type ARN */
OriginalTypeArn?: string;
/** Public version number */
PublicVersionNumber?: string;
/** Latest public version */
LatestPublicVersion?: string;
/** Publisher name */
PublisherName?: string;
/** Publisher identity */
PublisherIdentity?: IdentityProvider;
/** Auto-update enabled */
AutoUpdate?: boolean;
}
interface RequiredActivatedType {
/** Type name alias */
TypeNameAlias?: string;
/** Original type name */
OriginalTypeName?: string;
/** Publisher ID */
PublisherId?: string;
/** Supported major versions */
SupportedMajorVersions?: number[];
}
type TypeTestsStatus =
| "PASSED"
| "FAILED"
| "IN_PROGRESS"
| "NOT_TESTED";
type ProvisioningType =
| "NON_PROVISIONABLE"
| "IMMUTABLE"
| "FULLY_MUTABLE";
type DeprecatedStatus =
| "LIVE"
| "DEPRECATED";
type Visibility =
| "PUBLIC"
| "PRIVATE";
type IdentityProvider =
| "AWS_Marketplace"
| "GitHub"
| "Bitbucket";Lists registered types with filtering and pagination support.
/**
* Lists registered types with optional filtering
* Supports pagination for large result sets
*/
class ListTypesCommand {
constructor(input: ListTypesCommandInput);
}
interface ListTypesCommandInput {
/** Visibility filter */
Visibility?: Visibility;
/** Provisioning type filter */
ProvisioningType?: ProvisioningType;
/** Deprecated status filter */
DeprecatedStatus?: DeprecatedStatus;
/** Type of extension filter */
Type?: RegistryType;
/** Filter criteria */
Filters?: TypeFilters;
/** Maximum results per page */
MaxResults?: number;
/** Pagination token */
NextToken?: string;
}
interface ListTypesCommandOutput {
/** Type summaries */
TypeSummaries?: TypeSummary[];
/** Pagination token */
NextToken?: string;
}
interface TypeSummary {
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
/** Default version ID */
DefaultVersionId?: string;
/** Type ARN */
TypeArn?: string;
/** Last updated */
LastUpdated?: Date;
/** Description */
Description?: string;
/** Publisher ID */
PublisherId?: string;
/** Original type name */
OriginalTypeName?: string;
/** Public version number */
PublicVersionNumber?: string;
/** Latest public version */
LatestPublicVersion?: string;
/** Publisher identity */
PublisherIdentity?: IdentityProvider;
/** Publisher name */
PublisherName?: string;
/** Is activated */
IsActivated?: boolean;
}
interface TypeFilters {
/** Category filter */
Category?: Category;
/** Publisher ID filter */
PublisherId?: string;
/** Type name prefix filter */
TypeNamePrefix?: string;
}
type Category =
| "REGISTERED"
| "ACTIVATED"
| "THIRD_PARTY"
| "AWS_TYPES";Lists all versions of a specific type.
/**
* Lists all versions of a registered type
* Shows version history and status for each version
*/
class ListTypeVersionsCommand {
constructor(input: ListTypeVersionsCommandInput);
}
interface ListTypeVersionsCommandInput {
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
/** Type ARN */
Arn?: string;
/** Maximum results */
MaxResults?: number;
/** Pagination token */
NextToken?: string;
/** Deprecated status filter */
DeprecatedStatus?: DeprecatedStatus;
/** Publisher ID */
PublisherId?: string;
}
interface ListTypeVersionsCommandOutput {
/** Type version summaries */
TypeVersionSummaries?: TypeVersionSummary[];
/** Pagination token */
NextToken?: string;
}
interface TypeVersionSummary {
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
/** Version ID */
VersionId?: string;
/** ARN */
Arn?: string;
/** Time created */
TimeCreated?: Date;
/** Description */
Description?: string;
/** Public version number */
PublicVersionNumber?: string;
/** Is default version */
IsDefaultVersion?: boolean;
}Sets the default version for a type.
/**
* Sets the default version for a registered type
* New activations will use this version by default
*/
class SetTypeDefaultVersionCommand {
constructor(input: SetTypeDefaultVersionCommandInput);
}
interface SetTypeDefaultVersionCommandInput {
/** Type ARN */
Arn?: string;
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
/** Version ID to set as default */
VersionId?: string;
}
interface SetTypeDefaultVersionCommandOutput {
/** ARN of the type */
Arn?: string;
}Removes a type version from the CloudFormation registry.
/**
* Deregisters a type version from the CloudFormation registry
* Removes the type version but does not affect existing stacks using it
*/
class DeregisterTypeCommand {
constructor(input: DeregisterTypeCommandInput);
}
interface DeregisterTypeCommandInput {
/** Type ARN */
Arn?: string;
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
/** Version ID to deregister */
VersionId?: string;
}
interface DeregisterTypeCommandOutput {
/** ARN of the deregistered type */
Arn?: string;
}Tests a registered type with the CloudFormation registry test suite.
/**
* Tests a registered type using CloudFormation's test suite
* Validates type behavior and compliance with standards
*/
class TestTypeCommand {
constructor(input: TestTypeCommandInput);
}
interface TestTypeCommandInput {
/** Type name */
TypeName?: string;
/** Type ARN */
Arn?: string;
/** Version ID to test */
VersionId?: string;
/** Log delivery bucket */
LogDeliveryBucket?: string;
}
interface TestTypeCommandOutput {
/** Type version ARN */
TypeVersionArn?: string;
}Sets configuration data for a registered type.
/**
* Sets configuration data for a registered type
* Configures type behavior and default values
*/
class SetTypeConfigurationCommand {
constructor(input: SetTypeConfigurationCommandInput);
}
interface SetTypeConfigurationCommandInput {
/** Type ARN */
TypeArn: string;
/** Configuration data as JSON string */
Configuration: string;
/** Configuration alias */
ConfigurationAlias?: string;
}
interface SetTypeConfigurationCommandOutput {
/** Configuration ARN */
ConfigurationArn?: string;
}Retrieves configuration data for multiple types in a single operation.
/**
* Returns configuration data for specified CloudFormation extensions
* Efficiently retrieves configurations for multiple types
*/
class BatchDescribeTypeConfigurationsCommand {
constructor(input: BatchDescribeTypeConfigurationsCommandInput);
}
interface BatchDescribeTypeConfigurationsCommandInput {
/** List of type configuration identifiers */
TypeConfigurationIdentifiers: TypeConfigurationIdentifier[];
}
interface BatchDescribeTypeConfigurationsCommandOutput {
/** Configuration errors */
Errors?: BatchDescribeTypeConfigurationsError[];
/** Unprocessed type configurations */
UnprocessedTypeConfigurations?: TypeConfigurationIdentifier[];
/** Type configurations */
TypeConfigurations?: TypeConfigurationDetails[];
}
interface TypeConfigurationIdentifier {
/** Type ARN */
TypeArn?: string;
/** Type configuration alias */
TypeConfigurationAlias?: string;
/** Type configuration ARN */
TypeConfigurationArn?: string;
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
}
interface TypeConfigurationDetails {
/** Type ARN */
Arn?: string;
/** Type name */
TypeName?: string;
/** Configuration alias */
Alias?: string;
/** Configuration data */
Configuration?: string;
/** Last updated time */
LastUpdated?: Date;
/** Type configuration ARN */
TypeConfigurationArn?: string;
}
interface BatchDescribeTypeConfigurationsError {
/** Error code */
ErrorCode?: string;
/** Error message */
ErrorMessage?: string;
/** Type configuration identifier */
TypeConfigurationIdentifier?: TypeConfigurationIdentifier;
}Publishes a type to make it available publicly in the CloudFormation registry.
/**
* Publishes a type to the public CloudFormation registry
* Makes the type available to other AWS accounts
*/
class PublishTypeCommand {
constructor(input: PublishTypeCommandInput);
}
interface PublishTypeCommandInput {
/** Type of extension */
Type?: RegistryType;
/** Type ARN */
Arn?: string;
/** Type name */
TypeName?: string;
/** Public version number */
PublicVersionNumber?: string;
}
interface PublishTypeCommandOutput {
/** Public type ARN */
PublicTypeArn?: string;
}Tests a registered type to validate its implementation.
/**
* Tests a registered type to validate functionality
* Runs validation tests against the type implementation
*/
class TestTypeCommand {
constructor(input: TestTypeCommandInput);
}
interface TestTypeCommandInput {
/** Type ARN */
Arn?: string;
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
/** Version ID */
VersionId?: string;
/** Log delivery bucket */
LogDeliveryBucket?: string;
}
interface TestTypeCommandOutput {
/** Test type ARN */
TypeVersionArn?: string;
}Registers an account as a publisher in the CloudFormation registry.
/**
* Registers the account as a publisher in CloudFormation registry
* Enables publishing types to the public registry
*/
class RegisterPublisherCommand {
constructor(input: RegisterPublisherCommandInput);
}
interface RegisterPublisherCommandInput {
/** Accept terms and conditions */
AcceptTermsAndConditions?: boolean;
/** Connection ARN for identity verification */
ConnectionArn?: string;
}
interface RegisterPublisherCommandOutput {
/** Publisher ID */
PublisherId?: string;
}Retrieves information about a registered publisher.
/**
* Retrieves information about a registered publisher
* Shows publisher status and verification details
*/
class DescribePublisherCommand {
constructor(input: DescribePublisherCommandInput);
}
interface DescribePublisherCommandInput {
/** Publisher ID */
PublisherId?: string;
}
interface DescribePublisherCommandOutput {
/** Publisher ID */
PublisherId?: string;
/** Publisher status */
PublisherStatus?: PublisherStatus;
/** Identity provider */
IdentityProvider?: IdentityProvider;
/** Publisher profile */
PublisherProfile?: string;
}
type PublisherStatus =
| "VERIFIED"
| "UNVERIFIED";Sets configuration properties for a registered type.
/**
* Sets configuration properties for a registered type
* Provides runtime configuration for type behavior
*/
class SetTypeConfigurationCommand {
constructor(input: SetTypeConfigurationCommandInput);
}
interface SetTypeConfigurationCommandInput {
/** Type ARN */
TypeArn: string;
/** Configuration JSON */
Configuration: string;
/** Configuration alias */
ConfigurationAlias?: string;
/** Type name */
TypeName?: string;
/** Type of extension */
Type?: RegistryType;
}
interface SetTypeConfigurationCommandOutput {
/** Configuration ARN */
ConfigurationArn?: string;
}Retrieves configuration information for multiple types in a single operation.
/**
* Batch retrieves type configuration information
* Efficiently gets configuration for multiple types
*/
class BatchDescribeTypeConfigurationsCommand {
constructor(input: BatchDescribeTypeConfigurationsCommandInput);
}
interface BatchDescribeTypeConfigurationsCommandInput {
/** Type configuration identifiers */
TypeConfigurationIdentifiers: TypeConfigurationIdentifier[];
}
interface BatchDescribeTypeConfigurationsCommandOutput {
/** Errors encountered */
Errors?: BatchDescribeTypeConfigurationsError[];
/** Undescribed configurations */
UnprocessedTypeConfigurations?: TypeConfigurationIdentifier[];
/** Type configurations */
TypeConfigurations?: TypeConfigurationDetails[];
}
interface TypeConfigurationIdentifier {
/** Type ARN */
TypeArn?: string;
/** Type configuration alias */
TypeConfigurationAlias?: string;
/** Type configuration ARN */
TypeConfigurationArn?: string;
/** Type of extension */
Type?: RegistryType;
/** Type name */
TypeName?: string;
}
interface TypeConfigurationDetails {
/** Type ARN */
Arn?: string;
/** Type configuration alias */
Alias?: string;
/** Configuration JSON */
Configuration?: string;
/** Last updated */
LastUpdated?: Date;
/** Type ARN */
TypeArn?: string;
/** Type name */
TypeName?: string;
/** Is default configuration */
IsDefaultConfiguration?: boolean;
}
interface BatchDescribeTypeConfigurationsError {
/** Error code */
ErrorCode?: string;
/** Error message */
ErrorMessage?: string;
/** Type configuration identifier */
TypeConfigurationIdentifier?: TypeConfigurationIdentifier;
}Usage Examples:
// Complete type registration and activation workflow
async function registerAndActivateType() {
// 1. Register the type
const registerCommand = new RegisterTypeCommand({
Type: "RESOURCE",
TypeName: "MyCompany::Database::PostgreSQL",
SchemaHandlerPackage: "s3://my-handlers/postgresql-handler.zip",
ExecutionRoleArn: "arn:aws:iam::123456789012:role/PostgreSQLTypeRole",
LoggingConfig: {
LogRoleArn: "arn:aws:iam::123456789012:role/TypeLoggingRole",
LogGroupName: "/aws/cloudformation/type-logs"
}
});
const registration = await client.send(registerCommand);
console.log("Registration started:", registration.RegistrationToken);
// 2. Wait for registration to complete
let registrationComplete = false;
while (!registrationComplete) {
const statusCommand = new DescribeTypeRegistrationCommand({
RegistrationToken: registration.RegistrationToken!
});
const status = await client.send(statusCommand);
if (status.ProgressStatus === "COMPLETE") {
console.log("Registration completed:", status.TypeArn);
registrationComplete = true;
} else if (status.ProgressStatus === "FAILED") {
throw new Error("Type registration failed");
} else {
await new Promise(resolve => setTimeout(resolve, 5000));
}
}
// 3. Activate the type
const activateCommand = new ActivateTypeCommand({
Type: "RESOURCE",
TypeName: "MyCompany::Database::PostgreSQL",
ExecutionRoleArn: "arn:aws:iam::123456789012:role/PostgreSQLTypeRole"
});
const activation = await client.send(activateCommand);
console.log("Type activated:", activation.Arn);
return activation.Arn;
}
// List and describe types
const listCommand = new ListTypesCommand({
Visibility: "PRIVATE",
Type: "RESOURCE",
Filters: {
TypeNamePrefix: "MyCompany::"
}
});
const types = await client.send(listCommand);
console.log("Private types:", types.TypeSummaries);
// Get detailed type information
if (types.TypeSummaries && types.TypeSummaries.length > 0) {
const describeCommand = new DescribeTypeCommand({
TypeName: types.TypeSummaries[0].TypeName,
Type: "RESOURCE"
});
const typeDetails = await client.send(describeCommand);
console.log("Type schema:", JSON.parse(typeDetails.Schema || "{}"));
}type RegistryType =
| "RESOURCE"
| "MODULE"
| "HOOK";
type Visibility =
| "PUBLIC"
| "PRIVATE";
type ProvisioningType =
| "NON_PROVISIONABLE"
| "IMMUTABLE"
| "FULLY_MUTABLE";
interface LoggingConfig {
LogRoleArn: string;
LogGroupName: string;
}