E3012 "String" recommended for an external template parameter where type is "Number"
See original GitHub issuecfn-lint version: 0.18.0
I define some of my template with sub-templates and everything is packaged with that kind of command line
aws cloudformation package --template-file ./sources/template-source.yaml --s3-bucket my-bucket-build --output-template-file final-template.yaml
In template-source
I have a resource which type is AWS::CloudFormation::Stack
.
It’s definition looks like that :
ManagerService:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: ../../../common/service.yaml
Parameters:
Cluster: !Ref Cluster
DesiredCount: 1
Here is the definition of the parameter in my service
template :
Parameters:
Cluster:
Description: Please provide the ECS Cluster ID that this service should run on
Type: String
DesiredCount:
Description: How many instances of this task should we run across our cluster?
Type: Number
Default: 1
And cfn-lint return the following error :
cfn-lint source-template.yaml
E3012 Property Resources/ManagerService/Properties/Parameters/DesiredCount should be of type String
It says that type should be a String, but the type in the template is define as Number. Am I missing something ?
Thanks for your help
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
E3012 "String" recommended for an external template ...
In template-source I have a resource which type is AWS::CloudFormation::Stack . It's definition looks like that : ManagerService: Type: AWS:: ...
Read more >Parameters - AWS CloudFormation
Use parameters to pass values to your template when creating or updating a stack so that you can customize each stack deployment.
Read more >Template parameters and template arguments
A non-type template parameter must have a structural type, which is one of the following types (optionally cv-qualified, the qualifiers are ...
Read more >How to create function in TypeScript based on another, but ...
Here's one way. We define a type that describes the selectFromObj function where the object type T is fixed, but the return type...
Read more >Templates - Azure Pipelines | Microsoft Learn
Parameter data types ; number, may be restricted to values: , otherwise any number-like string is accepted ; boolean, true or false ;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For the moment, I’ve disabled the check with the follwing
.cfnlintrc
file :@kddejong List parameters do not pass through to sub stacks successfully. If you have a CommaDelimitedList type in your main stack and you attempt pass it through to a CommaDelimitedList in the sub stack, you will get a failure. Only types that can be coerced to strings can be passed through to a substack, like numbers and booleans.
The only way to pass a list through is to
!Join [',', !Ref MyList]
as you pass it through to the sub stack.I think configuring
E3012
withstrict: False
would do the trick here.