Skip to content
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

RFC 77, RFC 264: CloudFormation Registry Imports #266

Merged
merged 3 commits into from Jun 29, 2023

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Nov 5, 2020

These are two distinct RFCs for two distinct features, but we might as
well work on the docs at the same time. Hence, one PR.


By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache-2.0 license

These are two distinct RFCs for two distinct features, but we might as
well work on the docs at the same time. Hence, one PR.
Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great RFCs! Let's definitely have a discussion as part of these two RFCs around whether we want to continue to vend CFN resources as part of the AWS construct library or just use them as an implementation detail.


### README

The AWS Construct Library ships with CloudFormation resources and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think that once we have e this capability, in 3.x we will stop exporting CFN resource publicly

deploy via CloudFormation. These include:

- Applications from the Serverless Application Repository
- Applications from the AWS Service Catalog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they are called Products

# ...or don't pass anything to import all available products
$ cdk import servicecatalog
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be able to simply discover the type of import:

  1. Company::Group::Type for cfn registry
  2. SAR arn
  3. Service catalog arn


If you want to update to the latest version of the definition, you can run the same
`cdk import` command again. It will show you the changes to the the resource, before
asking you to confirm to overwrite the existing source files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice touch

asking you to confirm to overwrite the existing source files.

If you happen to be working in Java, C#, Python or Go, `cdk import` will build a
jsii bundle from the generated sources and automatically generate the corresponding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "jsii bundle" part is an non interesting detail in this readme. Just write it will generate source files in your language


The CloudFormation Registry allows publishing new resource types to user's
accounts. Consuming it as an information source is the only way to add CDK
support for resources published privately to the CloudFormation registry (see
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And publicly (like Datadog)

* Min/max array lengths
* Whether an array represents a set or sequence
* Properties that must be specified together (`dependencies`).
* Permissions required for the CRUD operations of resources (`permissions`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. TIL

* What properties are used to hold secrets/passwords/etc (`writeOnlyProperties`).
* Deprecated properties (`deprecatedProperties`).

There are things that customers are now able to specify that will pose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Customers=>resource vendors


The SAM specification has been hand-written to mimic the old CloudFormation
specification, but with extensions. This specification is not maintained
by CloudFormation and hence is not being converted to JSON schema by them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I remember SAM is also published as a json schema

resource developers and they can prevent themselves from accidentally
releasing breaking changes (reducing churn on downstream systems).
* A tool to generate code the type and resource definitions found
in the schema. This can mostly be based on `json2jsii`, although we will
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's definitely try to bake as much of the capabilities into Json2jsii so we get the most leverage for other CDKs (and jsii-based projects).

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure to take the recently launched CloudFormation modules into the cdk import feature. I'd like to be able to do something like cdk import MyCompany::S3::Bucket::MODULE

@eladb eladb mentioned this pull request Mar 11, 2021
11 tasks
@nija-at
Copy link
Contributor

nija-at commented Jul 20, 2021

@rix0rrr - can you check if this is superceded by #356.

@rix0rrr
Copy link
Contributor Author

rix0rrr commented Nov 3, 2021

@rix0rrr - can you check if this is superceded by #356.

From the title, #356 would build on the work proposed here, but the work here would also be useful to people importing constructs in their own accounts.

@eladb
Copy link
Contributor

eladb commented Nov 3, 2021

FYI, this is now being implemented and published under cdklabs/cdk-import.

@rix0rrr I am wondering if it's worth leaving this RFC open or we can merge it for now and continue iterating on the code?

@rix0rrr rix0rrr merged commit 3424eff into master Jun 29, 2023
1 check passed
@rix0rrr rix0rrr deleted the huijbers/0264-0077-cloudformation-registry branch June 29, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants