This template creates an EC2 instance and associates it with a License Manager configuration.

Terraform Template

data "aws_ami" "example" {

  filter {
    name = "name"
    values = ["amzn-ami-vpc-nat*"]
  }
  most_recent = true
  owners = ["amazon"]
}

resource "aws_instance" "example" {
  ami = data.aws_ami.example.id
  instance_type = "t2.micro"
}

resource "aws_licensemanager_association" "example" {
  license_configuration_arn = aws_licensemanager_license_configuration.example.arn
  resource_arn = aws_instance.example.arn
}

resource "aws_licensemanager_license_configuration" "example" {
  license_counting_type = "Instance"
  name = "Example"
  license_count = 
}