Skip to content

Commit b555094

Browse files
authored
DOC-169 CFn: support custom resource types in registry (#623)
1 parent a870549 commit b555094

1 file changed

Lines changed: 49 additions & 1 deletion

File tree

src/content/docs/aws/services/cloudformation.mdx

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,52 @@ awslocal cloudformation delete-stack \
122122
--stack-name cfn-quickstart-stack
123123
```
124124

125+
## Registry Extensions
126+
127+
LocalStack supports the execution of private CloudFormation registry extensions — custom resource types packaged with the [CloudFormation CLI](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html) and registered in your account's CloudFormation registry.
128+
129+
Registry extensions work similarly to [custom resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html), with one key difference: the Lambda function that handles their lifecycle is not directly managed by the user.
130+
When a private extension is activated, LocalStack deploys and invokes the embedded handler Lambda internally, giving you full local emulation of the extension's Create, Read, Update, Delete, and List (CRUDL) lifecycle.
131+
132+
### Registering and using a private extension
133+
134+
Build and package your extension using the CloudFormation CLI, then upload the package to S3 and register the type:
135+
136+
```bash
137+
awslocal cloudformation register-type \
138+
--type RESOURCE \
139+
--type-name MyOrg::MyService::MyResource \
140+
--schema-handler-package s3://my-bucket/my-extension.zip
141+
```
142+
143+
You can then reference the registered type in a template like any built-in resource type:
144+
145+
```yaml
146+
Resources:
147+
MyCustomResource:
148+
Type: MyOrg::MyService::MyResource
149+
Properties:
150+
SomeProperty: value
151+
```
152+
153+
When the stack is deployed, LocalStack routes each lifecycle operation to the handler Lambda that was deployed from the extension package.
154+
155+
### Supported package formats
156+
157+
LocalStack currently resolves the handler artifact from the following formats inside the extension ZIP package:
158+
159+
| Format | Description |
160+
|:-------|:------------|
161+
| `ResourceProvider.zip` | Python or Node.js handler produced by the CloudFormation CLI |
162+
| Single JAR file | Java-based resource provider handler |
163+
164+
Support for additional payload formats will be added in future releases.
165+
166+
:::note
167+
Extension packages must target a currently supported Lambda runtime.
168+
Python 3.9 is no longer supported; use Python 3.12 or another supported runtime when building your extension.
169+
:::
170+
125171
## Resource Browser
126172

127173
The LocalStack Web Application provides a Resource Browser for managing CloudFormation stacks to manage your AWS resources locally.
@@ -143,6 +189,7 @@ The following code snippets and sample applications provide practical examples o
143189
- [Serverless Container-based APIs with Amazon ECS & API Gateway](https://github.com/localstack/serverless-api-ecs-apigateway-sample)
144190
- [Deploying containers on ECS clusters using ECR and Fargate](/aws/tutorials/ecs-ecr-container-app/)
145191
- [Messaging Processing application with SQS, DynamoDB, and Fargate](https://github.com/localstack/sqs-fargate-ddb-cdk-go)
192+
- [CloudFormation Registry Extension demo](https://github.com/localstack-samples/cloudformation-registry-demo)
146193

147194
## Best practices
148195

@@ -229,6 +276,7 @@ Feel free to contribute by [creating a new GitHub issue](https://github.com/loca
229276
| Nested stacks | Partial |
230277
| StackSets | Partial |
231278
| Intrinsic Functions | Partial |
279+
| Registry extension execution | Partial |
232280

233281
:::note
234282
Currently, support for `UPDATE` operations on resources is limited.
@@ -290,4 +338,4 @@ See [Best practices](#best-practices) for details.
290338

291339
## API Coverage
292340

293-
<FeatureCoverage service="cloudformation" client:load />
341+
<FeatureCoverage service="cloudformation" client:load />

0 commit comments

Comments
 (0)