terraformhandler.py
def resourceInstanceOutput(self, instanceid, instancetype, imageid, subnetid, tags):
        """ Terraform configuration snippet for Resource / Instances Section """
        resourceStr = ""
        # need instance_type, ami_type, subnet needs to be pulled
        # needs 3 values instance_type (as variable?)
        # need Name?tags?
        # instanceType?

        resourceStr = """resource "{resource}" "{resourceName}" {{
            instance_type = "{instanceType}"
            ami = "{imageid}"
            subnet_id = "${{aws_subnet.{subnetid}.id}}"
            tags = {{
                Name = "{tags}"
            }}
        }}\n""".format(
            resource="aws_instance",
            resourceName=instanceid,
            instanceType=instancetype,
            imageid=imageid,
            subnetid=subnetid,
            tags=tags,
        )
        print(resourceStr)
        return resourceStr
 Terraform configuration snippet for Resource / Instances Section 
Terraform configuration snippet for Resource / Instances Section
Terraform configuration snippet for Resource / Instances Section
def resourceInstanceOutput(self, instanceid, instancetype, imageid, subnetid, tags):
        resourceStr = ""
        resourceStr = """resource "{resource}" "{resourceName}" {{
            instance_type = "{instanceType}"
            ami = "{imageid}"
            subnet_id = "${{aws_subnet.{subnetid}.id}}"
            tags = {{
                Name = "{tags}"
            }}
        }}\n""".format(
            resource="aws_instance",
            resourceName=instanceid,
            instanceType=instancetype,
            imageid=imageid,
            subnetid=subnetid,
            tags=tags,
        )
        print(resourceStr)
        return resourceStr
def resourceInstanceOutput ( self , instanceid , instancetype , imageid , subnetid , tags ) : resourceStr = "" resourceStr = """resource "{resource}" "{resourceName}" {{
            instance_type = "{instanceType}"
            ami = "{imageid}"
            subnet_id = "${{aws_subnet.{subnetid}.id}}"
            tags = {{
                Name = "{tags}"
            }}
        }}\n""" . format ( resource = "aws_instance" , resourceName = instanceid , instanceType = instancetype , imageid = imageid , subnetid = subnetid , tags = tags , ) print ( resourceStr ) return resourceStr
Terraform configuration snippet for Resource / Instances Section
Terraform configuration snippet for Resource / Instances Section
""" Terraform configuration snippet for Resource / Instances Section """ # need instance_type, ami_type, subnet needs to be pulled # needs 3 values instance_type (as variable?) # need Name?tags? # instanceType?
self
instanceid
instancetype
imageid
subnetid
tags