Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cf-lint throws an error on valid values for Elasticache Readenpoint address #3635

Closed
krishnakokila1990 opened this issue Aug 29, 2024 · 1 comment · Fixed by #3639
Closed
Labels
bug Something isn't working

Comments

@krishnakokila1990
Copy link

CloudFormation Lint Version

v1.11.0

What operating system are you using?

Windows

Describe the bug

Below is the yaml I am using for CLoudwatch alarm

Type: AWS::CloudWatch::Alarm
DependsOn: ElasticacheRedis
Properties:
Dimensions:
- Name: CacheClusterId
Value: !Select [ 0, !Split [ "." , !Select [ 1, !Split [ "[", !Select [ 0, !Split [ " " , !GetAtt ElasticacheRedis.ReadEndPoint.Addresses ] ] ] ] ] ]

cfn-lint throws an error that
E1017 {'Fn::GetAtt': ['ElasticacheRedis', 'ReadEndPoint.Addresses']} is not of type 'string'

I am sure this was working a while back

Note: I have trimmed the content and just left the problematic line

Expected behavior

There should not be any lint errors

Reproduction template

Type: AWS::CloudWatch::Alarm
DependsOn: ElasticacheRedis
Properties:
Dimensions:
- Name: CacheClusterId
Value: !Select [ 0, !Split [ "." , !Select [ 1, !Split [ "[", !Select [ 0, !Split [ " " , !GetAtt ElasticacheRedis.ReadEndPoint.Addresses ] ] ] ] ] ]

@kddejong
Copy link
Contributor

This should work and is a bug in cfn-lint. Oddly enough !Select [ 1 , !GetAtt ElasticacheRedis.ReadEndPoint.Addresses ] fails with Template error: Fn::Select requires a list argument with two elements: an integer index and a list

Even though that attribute is an array of strings its combined on the GetAtt to a string with spaces and a comma and brackets.

[aaaaa-001.aaaaa.aaaaa.use1.cache.amazonaws.com, aaaaa-002.aaaaa.aaaaa.use1.cache.amazonaws.com]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants