This is the AWS CDK v2 Developer Guide. The older CDK v1 entered maintenance on June 1, 2022 and ended support on June 1, 2023.
The AWS CloudFormation Public Registry lets you manage extensions, both public and private, such as resources, modules, and
hooks that are available for use in your AWS account. You can use public resource extensions in your AWS Cloud Development Kit (AWS CDK)
applications with the CfnResource
construct.
To learn more about the AWS CloudFormation Public Registry, see Using the AWS CloudFormation registry in the AWS CloudFormation User Guide.
All public extensions published by AWS are available to all accounts in all Regions without any action on your part. However, you must activate each third-party extension you want to use, in each account and Region where you want to use it.
Note
When you use AWS CloudFormation with third-party resource types, you will incur charges. Charges are based on the number of
handler operations you run per month and handler operation duration. See CloudFormation pricing
To learn more about public extensions, see Using public extensions in CloudFormation in the AWS CloudFormation User Guide
Topics
Activate a third-party resource in your account and Region
Extensions published by AWS do not require activation. They are always available in every account and Region. You can activate a third-party extension through the AWS Management Console, via the AWS Command Line Interface, or by deploying a special AWS CloudFormation resource.
To activate a third-party extension through the AWS Management Console or see what resources are available

-
Sign in to the AWS account in which you want to use the extension, then switch to the Region where you want to use it.
-
Navigate to the CloudFormation console via the Services menu.
-
Choose Public extensions on the navigation bar, then activate the Third party radio button under Publisher. A list of the available third-party public extensions appears. (You may also choose AWS to see a list of the public extensions published by AWS, though you don't need to activate them.)
-
Browse the list and find the extension you want to activate. Alternatively, search for it, then activate the radio button in the upper right corner of the extension's card.
-
Choose the Activate button at the top of the list to activate the selected extension. The extension's Activate page appears.
-
In the Activate page, you can override the extension's default name and specify an execution role and logging configuration. You can also choose whether to automatically update the extension when a new version is released. When you have set these options as you like, choose Activate extension at the bottom of the page.
To activate a third-party extension using the AWS CLI
-
Use the
activate-type
command. Substitute the ARN of the custom type you want to use where indicated.The following is an example:
aws cloudformation activate-type --public-type-arn
public_extension_ARN
--auto-update-activated
To activate a third-party extension through CloudFormation or CDK
-
Deploy a resource of type
AWS::CloudFormation::TypeActivation
and specify the following properties:-
TypeName
- The name of the type, such asAWSQS::EKS::Cluster
. -
MajorVersion
- The major version number of the extension that you want. Omit if you want the latest version. -
AutoUpdate
- Whether to automatically update this extension when a new minor version is released by the publisher. (Major version updates require explicitly changing theMajorVersion
property.) -
ExecutionRoleArn
- The ARN of the IAM role under which this extension will run. -
LoggingConfig
- The logging configuration for the extension.
The
TypeActivation
resource can be deployed by the CDK using theCfnResource
construct. This is shown for the actual extensions in the following section. -
Add a resource from the AWS CloudFormation Public Registry to your CDK
app
Use the CfnResource
construct to include a resource from the AWS CloudFormation Public Registry in your application.
This construct is in the CDK's aws-cdk-lib
module.
For example, suppose that there is a public resource named MY::S5::UltimateBucket
that you want to use
in your AWS CDK application. This resource takes one property: the bucket name. The corresponding
CfnResource
instantiation looks like this.
const ubucket = new CfnResource(this, 'MyUltimateBucket', {
type: 'MY::S5::UltimateBucket::MODULE',
properties: {
BucketName: 'UltimateBucket'
}
});