Skip to content
/ py2hcl Public

converts python objects to HCL for use in Terraform for testing

License

Notifications You must be signed in to change notification settings

astro44/py2hcl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py2hcl

converts python objects to HCL for use in Terraform for testing, USE AT OWN RISK.

this uses a brute force approach to converting python objects into HCL...

pcl = py2hcl()
dd = {'sb_permissions': {'dynamodbs': [{'arn': 'dddddddd', 'streamspec': {'StreamEnabled': True, 'StreamViewType': 'NEW_AND_OLD_IMAGES'}, 'write_capacity': 1}], 'eid': '///Ro9'}}
dy = pcl.dumps(dd)   

above will output HCL:

sb_permissions={
        dynamodbs = [
            {arn = "dddddddd" },
            {streamspec = {
                StreamEnabled = true
                StreamViewType = "NEW_AND_OLD_IMAGES"
             }},
            {write_capacity = 1 }
         ]
        eid = "///Ro9"
}

About

converts python objects to HCL for use in Terraform for testing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages