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 Answers
0
Accepted Answer

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

S3Bucket: !Sub ${s3Bucket}/${s3Path}/${libraryFile}
EXPERT
answered a year ago
  • 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
EXPERT
kentrad
answered a year ago
  • Thank you Kentrad! I applied join function as well. This is working too.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions