2
votes

I am using the aws eb deploy command on ubuntu to deploy a cloudformation script shown below. I get an error shown below.

Note: My other cloudformation scripts work without any problems.

Error Invalid Yaml: mapping values are not allowed here in "" CacheSecurityGroupName: Ref: "CacheSecurityGroup" ^, JSON exception: Invalid JSON: Unexpected character (R) at position 0.. Update the configuration file. ERROR: Failed to deploy application.

Resources:
  CacheSecurityGroupIngress:
    Type: "AWS::ElastiCache::SecurityGroupIngress"
    Properties:
      CacheSecurityGroupName: Ref: "CacheSecurityGroup"
      EC2SecurityGroupName: Ref: "AWSEBSecurityGroup"

Looking for pointers to solve the issue

1

1 Answers

3
votes

You should either use the full Ref function form in a new line, like this:

Resources:
  CacheSecurityGroupIngress:
    Type: "AWS::ElastiCache::SecurityGroupIngress"
    Properties:
      CacheSecurityGroupName:
        Ref: "CacheSecurityGroup"
      EC2SecurityGroupName:
        Ref: "AWSEBSecurityGroup"

...or the short form, like this:

Resources:
  CacheSecurityGroupIngress:
    Type: "AWS::ElastiCache::SecurityGroupIngress"
    Properties:
      CacheSecurityGroupName: !Ref "CacheSecurityGroup"
      EC2SecurityGroupName: !Ref "AWSEBSecurityGroup"