workspace#

packer_ami_workflow.workspace.filter_packer_files(path: Path) bool[source]#

Identify whether it is a .pkr.hcl or .pkrvars.hcl file.

class packer_ami_workflow.workspace.Workspace(name: str, dir_root: Path)[source]#
Parameters:
  • name – The name of the workspace. This is the prefix of all HCL file.

  • dir_root – The root directory of the workspace.

The workspace has to follow the following directory structure:

/workflow/
/workflow/find_root_base_image_id.py
/workflow/workflow_param.json
/workflow/step1/
/workflow/step1/templates/
/workflow/step1/templates/.pkr.hcl
/workflow/step1/templates/.pkrvars.hcl
/workflow/step1/templates/.variables.pkr.hcl
/workflow/step1/.gitignore
/workflow/step1/packer_build.py
property dir_templates: Path#

This is the directory where all the packer template source code are stored.

property path_pkr_hcl_tpl: Path#

The path to the .pkr.hcl jinja2 template file.

property path_pkrvars_hcl_tpl: Path#

The path to the .pkrvars.hcl jinja2 template file.

property path_variables_pkr_hcl_tpl: Path#

The path to the .variables.pkr.hcl jinja2 template file.

property path_pkr_hcl: Path#

The path to the rendered .pkr.hcl file.

property path_pkrvars_hcl: Path#

The path to the rendered .pkrvars.hcl file.

property path_variables_pkr_hcl: Path#

The path to the rendered .variables.pkr.hcl file.