On-Demand CFN Resource Generator
workeitel opened this issue · 2 comments
PR | Champion |
---|---|
# |
Description
Allow generating "CFN resources" (L1s) on-demand for any CloudFormation resource, including all resources published to the CloudFormation Resource Registry.
Spaces:
- Terraform
- Kubernetes
- F5
Progress
- Tracking Issue Created
- RFC PR Created
- Core Team Member Assigned
- Initial Approval / Final Comment Period
- Ready For Implementation
- implementation issue 1
- Resolved
@workeitel wrote:
Use Case
So far cfn2ts
tool was only used for generating L1 TS files for the CloudFormation resource specification. The cfn2ts
tool is hardcoded to use the cfnspec
package which has all resources checked in: https://github.com/aws/aws-cdk/blob/master/tools/cfn2ts/lib/index.ts#L1
With the latest launch of CloudFormation resource registry: https://aws.amazon.com/blogs/aws/cloudformation-update-cli-third-party-resource-support-registry/ everybody can build own CloudFormation resources (not only custom resources as before). That includes multiple steps including defining a Resource Provider Schema ( != resource specification )
Proposed Solution
The perfect scenario would be if
cfn2ts
understands the resource provider schema and I can generate L1 constructs directly based on it- OR CloudFormation supports generating resource specification out of the resource provider schema and I can use then
cfn2ts
to generate L1 constructs.
Because both solutions most likely require more time I would like to see a better way of triggering cfn2ts
in the meanwhile.
What works today:
- I write manually/generate with a custom tool a resource specification out of my resource provider schema
- I checkout the cdk repo since
cfn2ts
is not published on npm. - Manually patch this line to point to my own resource specification: https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/cfnspec/lib/index.ts#L9
- run
cfn2ts
to get my L1
Other
I suggest:
- something like
cfn2ts --cfnspec-path ../myresource.json
to override the path to the CloudFormation spec. - Publishing
cfn2ts
as a own npm package for easier consumption.