Hashicorp Packer Support for Image Creation using IaC pipelines

Create a GCP (Google Cloud Platform) tool in Opsera’s Tool Registry then use it to configure a Packer pipeline.

Packer for Multicloud: GCP, AWS and Azure

GCP Tool Configuration in Tool Registry

  1. Create a new tool using GCP as Tool Identifier.

  2. In Connection tab, click the Select GCP Config File to locate a GCP configuration file in JSON format.

  3. Once the file is uploaded, click the Save button.


You can now configure your pipeline using the GPC tool.

Hashicorp Packer Pipeline Configuration

Packer GCP, Packer File, Packer AWS, Packer Azure

Packer GCP Pipeline Step

GCP Custom:

  • Git File Path - gcp

  • Packer Version - Choose the packer version used.

  • Cloud Provider - Select GCP.

  • GCP Credentials - Select the GCP configured GCP tool from the Tool Registry.

  • Packer Execution Script - Custom Script.

  • Packer Commands - With each run, edit both image_name

packer init . packer validate -var project_id=indigo-union-270905 -var image_name=customer-gcp-image . packer build -var project_id=indigo-union-270905 -var image_name=customer-gcp-image .

GCP Opsera

  • Packer Version - Choose the packer version used.

  • Cloud Provider - Select GCP.

  • GCP Credentials - Select the GCP configured GCP tool from the Tool Registry.

  • Packer Execution Script - Opsera Script.

  • Input Parameter Mapping - Select parameters added within Tool Registry - Parameters. See below

    • Parameters:

Hashicorp Packer File Pipeline Step

  • Git File Path - gcp

  • Packer Version - Choose the packer version used.

  • Cloud Provider - GCP

  • GCP Credentials - Select the GCP configured GCP tool from the Tool Registry.

  • Packer Execution Script - Opsera Script.

  • Use Variable File:

    • Variable File Details - Add Input File Name.

Hashicorp Packer AWS Pipeline Step

Custom

  • Git File Path - aws

  • Packer Version - Choose the packer version used.

  • Cloud Provider - Select AWS to use AWS cloud provider

  • AWS Credentials - Select the configured AWS tool from the Tool Registry.

  • Packer Execution Script - Custom Script

  • Packer Commands -

    packer init . packer validate -var ami_id=ami-<ID> -var app_name=customer-aws-ami . packer build -var ami_id=ami-<ID> -var app_name=customer-aws-ami .

Opsera

  • Git File Path - aws

  • Packer Version - Choose the packer version used.

  • Cloud Provider - Select AWS to use AWS cloud provider

  • AWS Credentials - Select the configured AWS tool from the Tool Registry.

  • Packer Execution Script - Opsera Script

  • Input Parameter Mapping -