any idea how I can patch ec2 windows instances with ssm with terraform tf script?
variable "instance_count" {
default = "1"
}
provider "aws" {
region = "us-west-1"
}
resource "aws_instance" "example" {
ami = "ami-0b7c10374cfb013e6"
count = "${var.instance_count}"
instance_type = "t2.micro"
key_name = "t2micro-1"
security_groups = ["${
aws_security_group.allow_rdp.name}"]
tags = { Name = "test-${count.index}"
}
}
resource "aws_security_group" "allow_rdp" {
name = "allow_rdp"
description = "Allow rdp traffic"
ingress {
from_port = 3389
# By default, the windows server listens on TCP port 3389 for RDP
to_port = 3389
protocol = "tcp"
cidr_blocks = [
"
0.0.0.0/0"]
}
}