-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Support for custom resources #10
Comments
If I understand the code in 6d689c3 correct, it looks for For my custom resources it looks more like this: {
"Resources": {
"TestKeyPairEC2KeyPairtestkeypair8B76C420": {
"Type": "Custom::EC2-Key-Pair",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"EC2KeyNameManagerLambdaBE629145",
"Arn"
]
},
"Name": "test-key-pair",
"Description": "A test Key Pair",
"KmsPrivate": "alias/aws/secretsmanager",
"KmsPublic": "alias/aws/secretsmanager",
"StorePublicKey": false,
"ExposePublicKey": true,
"RemoveKeySecretsAfterDays": 0,
"SecretPrefix": "ec2-ssh-key/",
"StackName": "EC2KeyPair",
"Tags": {
"a": "b",
"c": "d",
"CreatedByCfnCustomResource": "CFN::Resource::Custom::EC2-Key-Pair",
"Hello": "World"
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete",
"Metadata": {
"aws:cdk:path": "EC2KeyPair/Test-Key-Pair/EC2-Key-Pair-test-key-pair/Default"
}
}
...
} This is from one of my custom constructs cdk-ec2-key-pair. |
cdk-dia generates a diagram from the construct-tree ( looks like the CDK team built a "custom resource framework" and it's being processed after the construct-tree is generated. What would your best-case diagram for the construct look like? In my opinion, constructs should usually be collapsed by default so the diagram contains one node/icon with a label "test-key-pair custom resource" and the construct's implementation is abstracted (the user used a construct library). reaching this result with your construct is tricky because some of the resources are binded to the construct (e.g. Additionally, in order to collapse constructs I used a convention used by cdk where the "main" resource of each construct is has the id When one uses cdk-dia with the --collapsed false flag then the construct should be a cluster (basically a frame) with all provisioned resources inside it. |
I tried cdk-dia today and it looks great. One thing I noticed is, it skips custom resources.
Already tried to look into this but it appears this is not so easy to implement. I haven't figured out where custom resources are filtered from generation. Adding them to the
awsResouceIconMatches.json
seems to not fix it (it would not be a solution anyway, since the name isn't static. Just did that for a quick test) Somehow they're filtered before they reach theAwsIconSupplier.matchIcon()
call but I was not able to figure out how this morning.The text was updated successfully, but these errors were encountered: