eugene-manuilov / cfpack

A CLI tool that helps to build CloudFormation template using multiple smaller templates.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YAMLException with !Sub

IPWright83 opened this issue · comments

I seem to get an error trying to process my CloudFormation to do with the Sub command.

├─ Error processing /home/iw651/src/prototypes/esg-app-cms/cloudformation/cf/s3.yml template: YAMLException: unknown tag !<!Sub> at line 18, column 7:
│ PublicAccessBlockConfiguration:

The YAML I'm trying to process is like:

---
AWSTemplateFormatVersion: "2010-09-09"
Transform: "AWS::Serverless-2016-10-31"

Parameters:
  EnvType:
    Type: String
    Default: "dev"

Resources:
  StrapiCMSAssetBucket:
    Type: "AWS::S3::Bucket"
    DeletionPolicy: Retain
    Properties:
      BucketName: !Sub
        - "my-test-strapi-assets-${EnvType}"
        - EnvType: !Ref EnvType

Fixed this by using Fn::Sub: