Terraform Provider using the Microsoft IIS Administration API. Enables the management of Application Pools, Directories and Websites in an IIS Server with IIS Administration API installed.
provider "iis" {
access_key = "your access key"
host = "https://localhost:55539"
}
resource "iis_application_pool" "name" {
name = "AppPool" // Name of the Application Pool
}
resource "iis_file" "name" {
name = "name.of.your.directory"
physical_path = "%systemdrive%\\inetpub\\your_app" // full path to directory
type = "directory" // can also be "file"
parent = "parent_id" // id of the parent folder
}
data "iis_website" "website-domain-com" {
name = "website.domain.com"
physical_path = "%systemdrive%\\inetpub\\your_app" // full path to website folder
application_pool = iis_application_pool.name.id
binding {
protocol = "http"
port = 80
ip_address = "*"
hostname = "website.domain.com"
}
}