Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected EOF #17

Open
bantl23 opened this issue Jun 25, 2021 · 1 comment
Open

Unexpected EOF #17

bantl23 opened this issue Jun 25, 2021 · 1 comment

Comments

@bantl23
Copy link

bantl23 commented Jun 25, 2021

I'm sure I'm just not configured correctly but I'm trying to copy over tags. I'm getting the below error message when ami-copy is executed, it's a little cryptic so I'm not sure what is wrong. Any thoughts? Below is a redacted snip of the code.

Error Message:

==> amazon-ebs.proxy: Running post-processor:  (type ami-copy)
Build 'amazon-ebs.proxy' errored after 18 minutes 11 seconds: 1 error(s) occurred:

* Post-processor failed: unexpected EOF

==> Wait completed after 18 minutes 11 seconds

==> Some builds didn't complete successfully and had errors:
--> amazon-ebs.proxy: 1 error(s) occurred:

* Post-processor failed: unexpected EOF

==> Builds finished but no artifacts were created.

proxy.pkr.hcl:

packer {
  required_plugins {
    ami-copy = {
      version = ">=v1.7.0"
      source  = "github.com/martinbaillie/ami-copy"
    }
  }
}

variable "aws_access_key_id" {
  type    = string
  default = "${env("AWS_ACCESS_KEY_ID")}"
}

variable "aws_secret_access_key" {
  type    = string
  default = "${env("AWS_SECRET_ACCESS_KEY")}"
}

variable "aws_session_token" {
  type    = string
  default = "${env("AWS_SESSION_TOKEN")}"
}

variable "aws_ami_users" {
  default = <redacted>
}

variable "aws_ami_regions" {
  default = <redacted>
}

data "amazon-ami" "source" {
  access_key  = "${var.aws_access_key_id}"
  secret_key  = "${var.aws_secret_access_key}"
  token       = "${var.aws_session_token}"
  region      = <redacted>
  owners      = <redacted>
  filters = {
    architecture        = <redacted>
    name                = <redacted>
    root-device-type    = <redacted>
    virtualization-type = <redacted>
  }
  most_recent = true
}

source "amazon-ebs" "proxy" {
  access_key                  = "${var.aws_access_key_id}"
  secret_key                  = "${var.aws_secret_access_key}"
  token                       = "${var.aws_session_token}"
  region                      = <redacted>
  vpc_id                      = <redacted>
  subnet_id                   = <redacted>
  security_group_id           = <redacted>
  ami_name                    = "daphne-${var.type}-proxy ubuntu ${legacy_isotime("20060102T150405.999999999")}"
  ami_regions                 = "${var.aws_ami_regions}"
  ami_users                   = "${var.aws_ami_users}"
  source_ami                  = "${data.amazon-ami.source.id}"
  ssh_username                = <redacted>
  instance_type               = <redacted>
  associate_public_ip_address = true

  tags = {
    OS_Version      = <redacted>
    OperatingSystem = <redacted>
    Project         = <redacted>
    Usage           = <redacted>
    SourceAMI       = "{{ .SourceAMI }}"
  }

  run_tags = {
    OS_Version      = <redacted>
    OperatingSystem = <redacted>
    Project         = <redacted>
    Usage           = <redacted>
    SourceAMI       = "{{ .SourceAMI }}"
  }
}

build {
  sources = ["source.amazon-ebs.proxy"]

  post-processor "ami-copy" {
    ami_users    = "${var.aws_ami_users}"
  }
}
@bantl23
Copy link
Author

bantl23 commented Jun 25, 2021

Also here is the packer version Packer v1.7.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant