jorgebastida/gordon

APIGateway proxy

stefreak opened this issue · 1 comments

I'm trying to use {proxy+} in APIGateway as described here: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html ("Lambda Proxy" section)

My settings.yml raises:

---
project: inquiries
default-region: eu-central-1
code-bucket: gordon-inquiries-bfec8c06
apps:
  - gordon.contrib.lambdas
  - firstapp
apigateway:
  helloapi:
    description: My first API
    resources:
      '{proxy+}':
        methods: ANY
          integration:
            lambda: firstapp.helloworld

on apply, this raises the following error:

$ gordon apply
Traceback (most recent call last):
  File "/usr/local/bin/gordon", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/gordon/bin.py", line 108, in main
    obj = options.cls(path=path, stdin=stdin, **vars(options))
  File "/usr/local/lib/python2.7/site-packages/gordon/core.py", line 382, in __init__
    super(ProjectApplyLoopBase, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/gordon/core.py", line 115, in __init__
    protocols=protocols.BASE_BUILD_PROTOCOLS
  File "/usr/local/lib/python2.7/site-packages/gordon/utils.py", line 149, in load_settings
    custom_settings = yaml.load(f) or {}
  File "/usr/local/lib/python2.7/site-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/local/lib/python2.7/site-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/local/lib/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python2.7/site-packages/yaml/parser.py", line 428, in parse_block_mapping_key
    if self.check_token(KeyToken):
  File "/usr/local/lib/python2.7/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/usr/local/lib/python2.7/site-packages/yaml/scanner.py", line 220, in fetch_more_tokens
    return self.fetch_value()
  File "/usr/local/lib/python2.7/site-packages/yaml/scanner.py", line 576, in fetch_value
    self.get_mark())
yaml.scanner.ScannerError: mapping values are not allowed here
  in "/.../settings.yml", line 14, column 22

Any idea if/how this could be done?

fixed by #110