Ydrab
Ydrab

Reputation: 31

How to just just one packer build

Sorry if this is a silly question but I am new to packer and haven't been able to find the answer.

In my root directory I have 4 files.

be.pkr.hcl
data.pkr.hcl
fe.pkr.hcl
variables.pkr.hcl

I have been running this command so far which builds both of by builds

packer build .

My question is how can I just run one of my builds? I know I can copy my variables and data into each build but is there a better way so I can include them and run this for example

packer build fe.pkr.hcl

Upvotes: 1

Views: 2693

Answers (1)

Matthew Schuchard
Matthew Schuchard

Reputation: 28854

You would use the only argument to packer build for this. You can specify the build argument names like -only=amazon-ebs.my_ami if you do not rename the build in your template, or otherwise specify multiple kv pairs within the block.

Upvotes: 2

Related Questions