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, Hands-On Technology Architect, Clean Air Activist.


Series NavigationTroubleshooting letsencrypt and certbot