diff --git a/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts b/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts index c19361247bf09..aad5c653c3693 100644 --- a/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts +++ b/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts @@ -634,7 +634,11 @@ export class CfnInclude extends core.CfnElement { l1Instance = this.createNestedStack(logicalId, cfnParser); } else { const l1ClassFqn = cfn_type_to_l1_mapping.lookup(resourceAttributes.Type); - if (l1ClassFqn) { + // The AWS::CloudFormation::CustomResource type corresponds to the CfnCustomResource class. + // Unfortunately, it's quite useless; it only has a single property, ServiceToken. + // For that reason, even the CustomResource class from @core doesn't use it! + // So, special-case the handling of this one resource type + if (l1ClassFqn && resourceAttributes.Type !== 'AWS::CloudFormation::CustomResource') { const options: cfn_parse.FromCloudFormationOptions = { parser: cfnParser, }; diff --git a/packages/@aws-cdk/cloudformation-include/test/test-templates/custom-resource-with-attributes.json b/packages/@aws-cdk/cloudformation-include/test/test-templates/custom-resource-with-attributes.json index 716224153dbb9..c490a16515944 100644 --- a/packages/@aws-cdk/cloudformation-include/test/test-templates/custom-resource-with-attributes.json +++ b/packages/@aws-cdk/cloudformation-include/test/test-templates/custom-resource-with-attributes.json @@ -27,9 +27,9 @@ "DependsOn": [ "CustomResource" ] }, "CustomResource": { - "Type": "AWS::MyService::AnotherCustom", + "Type": "AWS::CloudFormation::CustomResource", "Properties": { - "CustomProp": "CustomValue", + "ServiceToken": "CustomValue", "CustomFuncProp": { "Ref": "AWS::NoValue" }