elijahchancey/pretty_cloudformation

Sort Elastic Beanstalk OptionSettings

Opened this issue · 0 comments

Input Example:

Resources:
  ConfigurationTemplate:
    Properties:
      ApplicationName:
        Ref: GithubRepo
      Description: 'AWS ElasticBeanstalk Configuration Template'
      OptionSettings:
      - Namespace: aws:elasticbeanstalk:application:environmentB
        OptionName: EnvironmentName
        Value: 'blah'
      - Namespace: aws:elasticbeanstalk:application:environmentA
        OptionName: Region
        Value: 'blah'
      - Namespace: aws:elasticbeanstalk:application:environmentA
        OptionName: Application
        Value: 'blah'

Output Example:

Resources:
  ConfigurationTemplate:
    Properties:
      ApplicationName:
        Ref: GithubRepo
      Description: 'AWS ElasticBeanstalk Configuration Template'
      OptionSettings:
      - Namespace: aws:elasticbeanstalk:application:environmentA
        OptionName: Application
        Value: 'blah'
      - Namespace: aws:elasticbeanstalk:application:environmentA
        OptionName: Region
        Value: 'blah'
      - Namespace: aws:elasticbeanstalk:application:environmentB
        OptionName: EnvironmentName
        Value: 'blah'
  1. Under OptionSettings, the Objects are sorted by Namespace values (aws:elasticbeanstalk:application:environmentA)
  2. If there are multiple Objects with the same Namespace value, then those objects should be sorted by the OptionName.