🚀 Lanzar una instancia Windows Server como servidor web
En este paso vas a desplegar una instancia de Windows Server 2019, instalar el servidor web IIS automáticamente al arrancar y dejarla lista para recibir tráfico web.
📝 Pasos para desplegar el servidor web
Accedé a la consola de EC2 y asegurate de seleccionar la región donde querés crear la instancia.
Hacé clic en “Launch Instance” para comenzar el proceso.
En Name (Nombre), ingresá algo descriptivo, por ejemplo:
[Tus iniciales] Windows Web ServerSeleccioná la imagen de Windows Server 2019.
Elegí el tipo de instancia:
t2.mediumEn el campo Key pair (login), seleccioná el par de claves que creaste previamente para este laboratorio.
En la sección Network settings, configurá el grupo de seguridad para permitir los siguientes accesos:
- RDP (puerto 3389): desde tu IP o un rango seguro
- HTTP (puerto 80): desde Internet (0.0.0.0/0)
(Recomendado: restringí RDP solo a tu IP por seguridad)
El resto de las opciones dejalas por defecto.
Si necesitás cambiar VPC, subred o IP pública, usá el botón Edit.
⚙️ Configuración automática (User Data)
En Advanced Details (Detalles avanzados), pegá el siguiente script en el campo User data para instalar IIS y desplegar contenido de prueba automáticamente:
<powershell>
Import-Module ServerManager;
Install-WindowsFeature Web-Server -IncludeManagementTools -IncludeAllSubFeature
# Activa funcionalidades adicionales de IIS y .NET Framework
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServer
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CommonHttpFeatures
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpErrors
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpRedirect
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationDevelopment
Enable-WindowsOptionalFeature -online -FeatureName NetFx4Extended-ASPNET45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HealthAndDiagnostics
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpLogging
Enable-WindowsOptionalFeature -Online -FeatureName IIS-LoggingLibraries
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestMonitor
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpTracing
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Security
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestFiltering
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Performance
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerManagementTools
Enable-WindowsOptionalFeature -Online -FeatureName IIS-IIS6ManagementCompatibility
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Metabase
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementConsole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-BasicAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WindowsAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-StaticContent
Enable-WindowsOptionalFeature -Online -FeatureName IIS-DefaultDocument
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebSockets
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIExtensions
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIFilter
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionStatic
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45
remove-item -recurse c:\inetpub\wwwroot\*
(New-Object System.Net.WebClient).DownloadFile("https://static.us-east-1.prod.workshops.aws/public/b2083843-9bc2-4f94-bf8e-c4f6238d04f4//static/common/ec2_web_hosting/ec2-windows.zip", "c:\inetpub\wwwroot\ec2-windows.zip")
$shell = new-object -com shell.application
$zip = $shell.NameSpace("c:\inetpub\wwwroot\ec2-windows.zip")
foreach($item in $zip.items())
{
$shell.Namespace("c:\inetpub\wwwroot\").copyhere($item)
}
</powershell>Hacé clic en Launch Instance para crear la instancia.
Desde la lista de instancias, esperá a que el estado sea Running y que pase los status checks.
🌐 Acceso al sitio web
- Buscá la dirección DNS público de tu instancia (campo “Public IPv4 DNS”).
- Abrí un navegador e ingresá esa dirección para acceder al sitio web desplegado con IIS.
¡Listo! Ya tenés un servidor web Windows levantado automáticamente, con acceso remoto y una página de prueba activa.