-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CloudFormation Registry Support #77
Comments
Representing UnionsWe have an idiom for JSON unions which is based on a class with static methods. The problem will be what name we should give the methods. For example, say a property can accept either a class MyOption {
public static string(v: string) { return new MyOption(v); }
public static boolean(v: boolean) { return new MyOption(b); }
/** @internal */
public get _value() { return this.value; }
private constructor(private readonly value: any) { }
} Then, usage will be: {
option: MyOption.string('foo'),
// or
option: MyOption.boolean(true)
} However, this becomes hairier when the union accepts multiple complex types (and possibly even a mix between complex types and primitives, collections, etc). Then it becomes hard to name the static methods. Say the schema is: Then what? -- We can always say that we fall back to idiomatic untyped JSON representation for those L1s. It's probably not going to be the majority. Alternatively, we can also add first-class support for JSON schema in jsii and use idiomatic JSON schema generators. |
Copy @awslabs/aws-cdk-team |
@workeitel wrote: Use CaseSo far 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 SolutionThe perfect scenario would be if
Because both solutions most likely require more time I would like to see a better way of triggering What works today:
OtherI suggest:
|
In the interim, I resorted to a similar method described above, and (haphazardly) transform my registry schema into a resource specification "patch", that a build tool places into |
Heavily inspired by the comments list on this RFC (aws/aws-cdk-rfcs#77) for the AWS CDK
Just curious if this is still planned or maybe already implemented and i missed it. |
https://github.com/cdklabs/cdk-import/ They are generated and published as separate libs. |
Implemented via https://github.com/cdklabs/cdk-cloudformation |
Description
This proposal is to stop generating the CloudFormation Resources (also known as
Cfn*
classes / L1 Constructs) from the legacy CloudFormation Resource Specification document, and instead to leverage the improved schema that is provided as part of the CloudFormation Registry.We recommend to use the
import
terminology andimports/
directory to align with cdk8s.The CloudFormation resource spec is evolving and plans to support arbitrary JSON schema for resource properties. This will require that we will be able to generate code that models things like JSON unions (what else?).
Roles
Workflow
status/proposed
)status/review
)api-approved
applied to pull request)status/final-comments-period
)status/approved
)status/planning
)status/implementing
)status/done
)The text was updated successfully, but these errors were encountered: