Yaml template validation issue with template Parameters

0

I have parameter variables. how to refer to multiple ref variables in one line? Parameter:

 s3Bucket:
    Type: String
    Description: -------
    Default: '...'
 s3Path:
     Type: String
     Description: -------
     Default: '...'
 libraryFile:
     Type: String
     Description: ------
     Default: '...'

S3Bucket: !Ref s3Bucket S3Key: !Ref s3Path/libraryFile

S3Key is throwing validation error.

2 個答案
0
已接受的答案

If I understand your question correctly, it's Fn::Sub that you're after. e.g:

S3Bucket: !Sub ${s3Bucket}/${s3Path}/${libraryFile}
專家
已回答 1 年前
  • Thank you! This is exactly what I was looking for. It worked fine.

0

Take a look at the Fn::Join function. You can build your full S3Key using this.

S3Key: !Join
  -- '/'
    - !Ref s3Path
    - !Ref libraryFile
profile pictureAWS
專家
kentrad
已回答 1 年前
  • Thank you Kentrad! I applied join function as well. This is working too.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南