terraformhandler.py
def resourceOutput(self, resourceType, resourceName, varName, resourceTag, vpcid):
        """ Terraform configuration snippet for Resource Section """
        resourceStr = ""
        if resourceType == "vpc":
            resourceStr = """resource "{resource}" "{resource_name}" {{
                cidr_block = "${{var.var_{varName}}}"
                tags = {{
                    Name = "{tags}"
                }}
            }}\n""".format(
                resource="aws_vpc",
                varName=varName,
                resource_name=resourceName,
                tags=resourceTag,
            )
        elif resourceType == "subnet":
            resourceStr = """resource "{resource}" "{resource_name}" {{
                vpc_id = "${{aws_vpc.{vpcid}.id}}"
                cidr_block = "${{var.var_{varName}}}"
                tags = {{
                    Name = "{tags}"
                }}
            }}\n""".format(
                resource="aws_subnet",
                vpcid=vpcid,
                varName=varName,
                resource_name=varName,
                tags=resourceTag,
            )
        # print (resourceStr)
        return resourceStr
 Terraform configuration snippet for Resource Section 
Terraform configuration snippet for Resource Section
Terraform configuration snippet for Resource Section
def resourceOutput(self, resourceType, resourceName, varName, resourceTag, vpcid):
        resourceStr = ""
        if resourceType == "vpc":
            resourceStr = """resource "{resource}" "{resource_name}" {{
                cidr_block = "${{var.var_{varName}}}"
                tags = {{
                    Name = "{tags}"
                }}
            }}\n""".format(
                resource="aws_vpc",
                varName=varName,
                resource_name=resourceName,
                tags=resourceTag,
            )
        elif resourceType == "subnet":
            resourceStr = """resource "{resource}" "{resource_name}" {{
                vpc_id = "${{aws_vpc.{vpcid}.id}}"
                cidr_block = "${{var.var_{varName}}}"
                tags = {{
                    Name = "{tags}"
                }}
            }}\n""".format(
                resource="aws_subnet",
                vpcid=vpcid,
                varName=varName,
                resource_name=varName,
                tags=resourceTag,
            )
        return resourceStr
def resourceOutput ( self , resourceType , resourceName , varName , resourceTag , vpcid ) : resourceStr = "" if resourceType == "vpc" : resourceStr = """resource "{resource}" "{resource_name}" {{
                cidr_block = "${{var.var_{varName}}}"
                tags = {{
                    Name = "{tags}"
                }}
            }}\n""" . format ( resource = "aws_vpc" , varName = varName , resource_name = resourceName , tags = resourceTag , ) elif resourceType == "subnet" : resourceStr = """resource "{resource}" "{resource_name}" {{
                vpc_id = "${{aws_vpc.{vpcid}.id}}"
                cidr_block = "${{var.var_{varName}}}"
                tags = {{
                    Name = "{tags}"
                }}
            }}\n""" . format ( resource = "aws_subnet" , vpcid = vpcid , varName = varName , resource_name = varName , tags = resourceTag , ) return resourceStr
Terraform configuration snippet for Resource Section
Terraform configuration snippet for Resource Section
""" Terraform configuration snippet for Resource Section """ # print (resourceStr)
self
resourceType
resourceName
varName
resourceTag
vpcid