Skip to content

Commit 6155f4e

Browse files
author
Jue Gong
committed
Rename Fn::Size to Fn::Length
Rename Fn::Size to Fn::Length
1 parent 0bfcef5 commit 6155f4e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

RFCs/0070-Fn::Size.md renamed to RFCs/0070-Fn::Length.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# RFC for Fn::Size
1+
# RFC for Fn::Length
22

33
* **Original Author(s):**: @juegong2
44
* **Tracking Issue**: https://github.com/aws-cloudformation/cfn-language-discussion/issues/70
55

66
# Summary
77

8-
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.
99

1010
# Motivation
1111

@@ -32,15 +32,15 @@ Use `Ref` on a Parameter of type `CommaDelimitedList` or `List<Number>`
3232
"Has3InstanceTypes": {
3333
"Fn::Equals": [
3434
{
35-
"Fn::Size": {"Ref": "InstanceTypes"}
35+
"Fn::Length": {"Ref": "InstanceTypes"}
3636
},
3737
3
3838
]
3939
},
4040
"Has2NumbersInList": {
4141
"Fn::Equals": [
4242
{
43-
"Fn::Size": {"Ref": "NumberList"}
43+
"Fn::Length": {"Ref": "NumberList"}
4444
},
4545
2
4646
]
@@ -56,7 +56,7 @@ Use a hardcoded list
5656
"Has3InstanceTypes": {
5757
"Fn::Equals": [
5858
{
59-
"Fn::Size": [ "m5.large", "m5.xlarge" ]
59+
"Fn::Length": [ "m5.large", "m5.xlarge" ]
6060
},
6161
3
6262
]
@@ -67,10 +67,10 @@ Use a hardcoded list
6767

6868
# Limitation
6969

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:
7171
```json
7272
{
73-
"Fn::Size": { "Fn::Split": [":", { "Fn::GetAtt": [ "MyBucket", "Arn" ] } ] }
73+
"Fn::Length": { "Fn::Split": [":", { "Fn::GetAtt": [ "MyBucket", "Arn" ] } ] }
7474
}
7575
```
7676
because the ARN of MyBucket is not known until during provisioning.
@@ -79,7 +79,7 @@ because the ARN of MyBucket is not known until during provisioning.
7979

8080
# Details
8181

82-
`Fn::Size` is an intrinsic function that takes in a list and returns the size of the given list. The list could be:
82+
`Fn::Length` is an intrinsic function that takes in a list and returns the length of the given list. The list could be:
8383

8484
* hardcoded list in template
8585
* array generated by intrinsic functions like `Fn::Split` with parameters of hardcoded values or of `Ref` to template parameters
@@ -91,7 +91,7 @@ because the ARN of MyBucket is not known until during provisioning.
9191
* `AWS::SSM::Parameter::Value<CommaDelimitedList>`
9292
* `AWS::SSM::Parameter::Value<List<AWS-specific parameter type>>`
9393

94-
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:
9595
* Condition functions
9696
* Fn::FindInMap
9797
* Fn::Base64
@@ -101,6 +101,6 @@ Within `Fn::Size`, following intrinsic functions with parameters of hardcoded va
101101
* Fn::Sub
102102

103103
# 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?**
105105

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

Comments
 (0)