No you can't do that. As a workaround you can use the aws cli to check if
the AMI exists, if so run packer build with -exclude=amazon-ebs

On Wed, Aug 21, 2019, 23:39 Khai Do <khai...@sagebase.org> wrote:

> We are using packer with the amazon-ebs builder.  The packer build command
> throws an error when attempting to build an AMI with a name that matches an
> existing AMI on AWS.  I would like to make packer provide the same info but
> NOT fail for this use case?  Instead I would like it to just ignore and
> continue to the next image build.  Is there a way to tell packer to ignore
> builds where an AMI already exists?  something like an
> '-skip-already-exist' flag?
>
> ➜ packer --version
> 1.4.3
> ➜  packer build -var-file=../vars.json template.json
> amazon-ebs output will be in this color.
>
> ==> amazon-ebs: Prevalidating AMI Name: weechat-v1.0.0
> ==> amazon-ebs: Error: AMI Name: 'weechat-v1.0.0' is used by an existing
> AMI: ami-0ee682a1a7e3717d0
> Build 'amazon-ebs' errored: Error: AMI Name: 'weechat-v1.0.0' is used by
> an existing AMI: ami-0ee682a1a7e3717d0
>
> ==> Some builds didn't complete successfully and had errors:
> --> amazon-ebs: Error: AMI Name: 'weechat-v1.0.0' is used by an existing
> AMI: ami-0ee682a1a7e3717d0
>
> ==> Builds finished but no artifacts were created.
> ➜   echo $?
> 1
>
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/50f8f68f-aca8-43a0-9e20-7e050475a6d3%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/50f8f68f-aca8-43a0-9e20-7e050475a6d3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_z6oQcw4r3O%2Bid_2%2BG7V%2BhozTnRkZqUrcGhdBHpXo%3DEA%40mail.gmail.com.

Reply via email to