You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will support an intrinsic function called `Fn::Size` that will return the number of elements in a given list.
8
+
We will support an intrinsic function called `Fn::Length` that will return the number of elements in a given list.
9
9
10
10
# Motivation
11
11
@@ -32,15 +32,15 @@ Use `Ref` on a Parameter of type `CommaDelimitedList` or `List<Number>`
32
32
"Has3InstanceTypes": {
33
33
"Fn::Equals": [
34
34
{
35
-
"Fn::Size": {"Ref": "InstanceTypes"}
35
+
"Fn::Length": {"Ref": "InstanceTypes"}
36
36
},
37
37
3
38
38
]
39
39
},
40
40
"Has2NumbersInList": {
41
41
"Fn::Equals": [
42
42
{
43
-
"Fn::Size": {"Ref": "NumberList"}
43
+
"Fn::Length": {"Ref": "NumberList"}
44
44
},
45
45
2
46
46
]
@@ -56,7 +56,7 @@ Use a hardcoded list
56
56
"Has3InstanceTypes": {
57
57
"Fn::Equals": [
58
58
{
59
-
"Fn::Size": [ "m5.large", "m5.xlarge" ]
59
+
"Fn::Length": [ "m5.large", "m5.xlarge" ]
60
60
},
61
61
3
62
62
]
@@ -67,10 +67,10 @@ Use a hardcoded list
67
67
68
68
# Limitation
69
69
70
-
`Fn::Size` will not work with lists that are dynamically generated at provisinoing time. For example, assuming MyBucket is the logical id of a AWS::S3::Bucket resource, the following is not supported:
70
+
`Fn::Length` will not work with lists that are dynamically generated at provisinoing time. For example, assuming MyBucket is the logical id of a AWS::S3::Bucket resource, the following is not supported:
Within `Fn::Size`, following intrinsic functions with parameters of hardcoded values or of `Ref` to template parameters will be supported:
94
+
Within `Fn::Length`, following intrinsic functions with parameters of hardcoded values or of `Ref` to template parameters will be supported:
95
95
* Condition functions
96
96
* Fn::FindInMap
97
97
* Fn::Base64
@@ -101,6 +101,6 @@ Within `Fn::Size`, following intrinsic functions with parameters of hardcoded va
101
101
* Fn::Sub
102
102
103
103
# FAQ
104
-
1.**Will the CloudFormation Linter (cfn-lint) support validations regarding Fn::Size?**
104
+
1.**Will the CloudFormation Linter (cfn-lint) support validations regarding Fn::Length?**
105
105
106
-
Yes. cfn-lint will be updated to validate if the parameter of Fn::Size is a list. It will also validate if it is used for integer-type resource properties or function parameters.
106
+
Yes. cfn-lint will be updated to validate if the parameter of Fn::Length is a list. It will also validate if it is used for integer-type resource properties or function parameters.
0 commit comments