Anuj Varma Software • Cloud • Security • AI

Invalid Document Content Error in running an AWS SSM document

This entry is part 5 of 5 in the series letsencrypt

If you are using terraform to create a systems manager document and an SSM association, there are a few hiccups you might encounter

Also see this post on Systems Manager vs. User Data to configure an EC2 instance on AWS

Issue 1 – Unique SSM Doc Name

# null resource - to ensure unique SSM doc name for each run

resource "null_resource" "nullres" {

  # not spinning up anything.

  }

  # SSM doc

resource "aws_ssm_document" "my_ssm_doc" {

  name = "certbot_${null_resource.nullres.id}"

  document_type   = "Command"

  document_format = "YAML"

  content = file("./ec2_init.yaml")

}
Issue 2 – Invalid Document Content
# SSM doc
resource "aws_ssm_document" "my_ssm_doc" {

  name = "certbot_${null_resource.nullres.id}"


  document_type   = "Command"

  document_format = "YAML"

  content = file("./ec2_init.yaml")

}

 

Anuj holds professional certifications in Google Cloud, AWS as well as certifications in Docker and App Performance Tools such as New Relic. He specializes in Cloud Security, Data Encryption and Container Technologies.

Initial Consultation

Anuj Varma – who has written posts on Anuj Varma.


Series NavigationTroubleshooting letsencrypt and certbot

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.