def get_target_resources(self, resources): """ Get list of terraform targets arguments to be supplied to terraform command Args: resources (list): List of resources if there are targets else None Returns: targets (list / none): list of resources to be added as targets if there is any else None """ if resources: targets = [] for resource in resources: # DO NOT process this resource as its definiiton asked to skip if resource.PROCESS is False: continue if BaseTerraformVariable not in inspect.getmro( resource.__class__ ) and TerraformData not in inspect.getmro(resource.__class__): targets.append(get_terraform_resource_path(resource)) return targets return None
def get_taint_resources(self, resources): taint_resources = [] for resource in resources: if TerraformResource in inspect.getmro(resource.__class__): taint_resources.append(get_terraform_resource_path(resource)) return taint_resources
def get_terraform_resource_path(cls): """ Get path of the resource class Returns: path (str): path of the resource class """ return get_terraform_resource_path(cls)
def get_target_resources(self, resources): if resources: targets = [] for resource in resources: # DO NOT process this resource as its definiiton asked to skip if resource.PROCESS is False: continue if BaseTerraformVariable not in inspect.getmro(resource.__class__) and TerraformData not in inspect.getmro(resource.__class__): targets.append(get_terraform_resource_path(resource)) return targets return None
def get_taint_resources(self, resources): """ Get list of terraform resources to be tainted Args: resources (list): List of resources Returns: taint_resources (list): List of resources to be tainted """ taint_resources = [] for resource in resources: if TerraformResource in inspect.getmro(resource.__class__): taint_resources.append(get_terraform_resource_path(resource)) return taint_resources
def get_target_resources(self, resources): """ Get list of terraform targets arguments to be supplied to terraform command Args: resources (list): List of resources if there are targets else None Returns: targets (list / none): list of resources to be added as targets if there is any else None """ if resources: targets = [] for resource in resources: if BaseTerraformVariable not in inspect.getmro(resource.__class__) and TerraformData not in inspect.getmro(resource.__class__): targets.append(get_terraform_resource_path(resource)) return targets return None
def get_terraform_resource_path(cls): return get_terraform_resource_path(cls)