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

Max length userData #16493

Closed
andrejvanderzee opened this issue Oct 30, 2017 · 2 comments
Closed

Max length userData #16493

andrejvanderzee opened this issue Oct 30, 2017 · 2 comments

Comments

@andrejvanderzee
Copy link

andrejvanderzee commented Oct 30, 2017

Hi there,

I am encountering this issue when using ignition_file when copying encrypted PKI assets.

Error: Error applying plan:

1 error(s) occurred:

  • module.kubernetes.module.masters.aws_launch_configuration.master_conf: 1 error(s) occurred:

  • aws_launch_configuration.master_conf: Error creating launch configuration: ValidationError: 1 validation error detected: Value 'XXXXXXXXX' at 'userData' failed to satisfy constraint: Member must have length less than or equal to 21847
    status code: 400, request id: 82919b36-bd60-11e7-8156-e1805ec22de2

$ terraform version
Terraform v0.10.8

This is one of the failing configs:

data "ignition_systemd_unit" "pki_decrypt" {

  name   = "decrypt-pki.service"
  enabled = true

  content = <<EOF
[Unit]
Description=decrypt pki assets
Before=kubelet.service
After=network.service

[Service]
Restart=on-failure
RemainAfterExit=yes
ExecStartPre=/usr/bin/rkt run \
  --uuid-file-save=/var/run/coreos/decrypt-pki.uuid \
  --volume=ssl,kind=host,source=/etc/kubernetes/ssl,readOnly=false \
  --mount=volume=ssl,target=/etc/kubernetes/ssl \
  --volume=dns,kind=host,source=/etc/resolv.conf,readOnly=true \
  --mount volume=dns,target=/etc/resolv.conf \
  --net=host \
  --trust-keys-from-https \
  ${var.awscli_rkt_image} --exec=/bin/bash -- \
    -ec \
    'echo Decrypting PKI assets; \
     shopt -s nullglob; \
     for encKey in /etc/kubernetes/ssl/*.pem.enc; do \
     echo Decrypting $encKey; \
     /usr/bin/aws \
       --region ${var.kms_region} kms decrypt \
       --ciphertext-blob fileb://$encKey \
       --output text \
       --query Plaintext \
     | base64 -d > $$$${encKey%.enc}; \
     done; \
     echo done.'
ExecStart=-/usr/bin/rkt rm --uuid-file=/var/run/coreos/decrypt-assets.uuid

[Install]
RequiredBy=kubelet.service
EOF
}

data "ignition_file" "pki_ca" {

	filesystem = "root"
	mode       = 0644
	path = "/etc/kubernetes/ssl/ca.pem.enc"

	content { 
		mime = "application/base64"
		content = "${var.pki_ca}"
	}
}

data "ignition_file" "pki_apiserver" {

	filesystem = "root"
	mode       = 0644
	path = "/etc/kubernetes/ssl/apiserver.pem.enc"

	content { 
		mime = "application/base64"
		content = "${var.pki_apiserver}"
	}
}

data "ignition_file" "pki_apiserver_key" {

	filesystem = "root"
	mode       = 0644
	path = "/etc/kubernetes/ssl/apiserver-key.pem.enc"

	content { 
		mime = "application/base64"
		content = "${var.pki_apiserver_key}"
	}
}
@hashibot
Copy link
Contributor

This issue has been automatically migrated to hashicorp/terraform-provider-ignition#30 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to this issue and let us know.

@ghost
Copy link

ghost commented Apr 6, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants