Created
September 22, 2017 18:32
-
-
Save lorengordon/f4ceaa95b9fe669ee533a8aa40b955c1 to your computer and use it in GitHub Desktop.
Python helper for a Terraform External provider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
class TfExternal(object): | |
"""Wrap Terraform External provider.""" | |
@staticmethod | |
def query_args(obj): | |
"""Load json object from stdin.""" | |
return {} if obj.isatty() else json.load(obj) | |
@staticmethod | |
def out_json(result): | |
"""Print result to stdout.""" | |
print(json.dumps(result)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage example: