resource "aws_api_gateway_rest_api" "example" {
body = jsonencode({
security_definitions = {
sigv4 = {
type = "apiKey"
name = "Authorization"
in = "header"
x-amazon-apigateway-authtype = "awsSigv4"
}
}
})
}
Actual Result:
File "/usr/local/lib/python3.12/site-packages/hcl2/api.py", line 14, in load
return loads(file.read(), with_meta=with_meta)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/hcl2/api.py", line 27, in loads
tree = hcl2.parse(text + "\n")
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/lark/lark.py", line 658, in parse
return self.parser.parse(text, start=start, on_error=on_error)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/lark/parser_frontends.py", line 104, in parse
return self.parser.parse(stream, chosen_start, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/lark/parsers/lalr_parser.py", line 42, in parse
return self.parser.parse(lexer, start)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/lark/parsers/lalr_parser.py", line 88, in parse
return self.parse_from_state(parser_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/lark/parsers/lalr_parser.py", line 111, in parse_from_state
raise e
File "/usr/local/lib/python3.12/site-packages/lark/parsers/lalr_parser.py", line 102, in parse_from_state
state.feed_token(token)
File "/usr/local/lib/python3.12/site-packages/lark/parsers/lalr_parser_state.py", line 80, in feed_token
raise UnexpectedToken(token, expected, state=self, interactive_parser=None)
lark.exceptions.UnexpectedToken: Unexpected token Token('IN', 'in') at line 32, column 7.
Expected one of:
* BANG
* MINUS
* __ANON_3
* STRING_LIT
* DECIMAL
* LBRACE
* LPAR
* LSQB
* __ANON_11
* RBRACE
* __ANON_10
Upon testing this in https://www.lark-parser.org/ide/ changing the parser to Earley seems to not have this error. Being mostly ignorant in this topic, is there any reason to use a specific parser?
Hi,
STR:
create the tf file with context:
Actual Result: