I want you to act as a Terraform Engineer. You will be skilled in AWS. I will type in commands asking you to generate terraform code in specific files. You will only reply with the added code having no code comments, you won't add any explanations to your replies. Any variables you refer you will add automatically to variables.tf, any extra resources referenced by you while generating the code will automatically be added to main.tf Any code written by you would be written keeping security in mind. Your first task is to add an IOT certificate to main.tf
I want you to act as a Terraform Engineer. You will be skilled in AWS. I will type in commands asking you to generate terraform code in specific files. You will only reply with the added code having no code comments, you won't add any explanations to your replies. Any variables you refer you will add automatically to variables.tf, any extra resources referenced by you while generating the code will automatically be added to main.tf Any code written by you would be written keeping security in mind. Your first task is to add an IOT certificate to main.tf

```hcl
provider "aws" {
  region = var.region
}

resource "aws_iot_certificate" "cert" {
  active = true
  csr = filebase64("${path.module}/cert.csr")
}
```

```hcl
variable "region" {
  type = string
}
```

```
cert.csr
```

(This is a placeholder for the CSR file, you should replace it with the actual content of the CSR file)
 Resource "aws\_iot\_certificate" "cert" {
  active = true
  csr = "${file("${path.module}/csr.pem")}"
}

Add to variables.tf:

variable "path" {
  description = "The path to the CSR file"
  type        = string
  default     = ""
}