aws / aws/aws-toolkit-visual-studio
CloudFormation template error: Custom Resource is an unknown resource for this template
- Dominant language
- No language data
- Stars
- 135
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Referencing a Custom resource with a custom type in a JSON CloudFormation template shows an error that the resources is an unknown resource for this template. Using AWS::CloudFormation::CustomResource works without an error.
**To Reproduce**
Shows Error:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
},
"Conditions": {
"MyCondition": {
"Fn::Equals": [{
"Fn::GetAtt": [
"InitGetValueSSM",
"Value"
]
},
"VALUE1"
]
}
},
"Resources": {
"InitGetValueSSM": {
"Type": "Custom::GetValueSSM",
"Properties": {
"ServiceToken": "{{resolve:ssm:/myval:1}}",
"ParameterName": "myparam"
}
}
},
"Outputs": {}
}
Shows no error:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
},
"Conditions": {
"MyCondition": {
"Fn::Equals": [{
"Fn::GetAtt": [
"InitGetValueSSM",
"Value"
]
},
"VALUE1"
]
}
},
"Resources": {
"InitGetValueSSM": {
"Type": "AWS::CloudFormation::CustomResource",
"Properties": {
"ServiceToken": "{{resolve:ssm:/myval:1}}",
"ParameterName": "myparam"
}
}
},
"Outputs": {}
}
**Expected behavior**
No error should be shown in the template when using custom resource type names
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html
**Screenshots**
**Computer (please complete the following information):**
- Windows Version: 10
- Visual Studio Version: 2022 Enterprise
- AWS Toolkit for Visual Studio Version: 1.29.0.0
**Additional context**
Contributor guide
Research direction
The issue provides two JSON CloudFormation templates and an AWS documentation link; begin by reproducing the validation error with the custom Custom::GetValueSSM type and compare it with AWS::CloudFormation::CustomResource. Done means the template validator accepts custom resource type names without an unknown-resource error while preserving validation of the rest of the template.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100