Hi,
We are trying to install the latest windows NVIDIA windows driver for our custom AMI. We are doing this via packer which is running a powershell script.
This is using the guidelines recommended here in option 4.
When the script runs on the ec2 instance, we're getting a 404. But when we check that url on our own machines, it's fine. The bucket in question is supposed to be publicly accessible, and I can download it from plenty of other machines.
Here's the log from packer:
Downloading https://ec2-windows-nvidia-drivers.s3.amazonaws.com/latest/537.13_grid_win10_win11_server2019_server2022_dch_64bit_international_aws_swl.exe latest/537.70_grid_win10_win11_server2019_server2022_dch_64bit_international_aws_swl.exe to C:\Users\Administrator\Downloads\NVIDIA\installer.exe
Directory: C:\Users\Administrator\Downloads
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 11/1/2023 11:47 AM NVIDIA
Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (404) Not Found."
This is the code:
$ErrorActionPreference = "Stop"
$ProgressPreference = 'SilentlyContinue'
Write-Output "Beginning Nvidia driver installation"
$wc = New-Object net.webclient
$Bucket = "ec2-windows-nvidia-drivers"
$KeyPrefix = "latest"
$LocalDirectory = "$home\Downloads\NVIDIA"
$LocalInstallerPath = "$LocalDirectory\installer.exe"
$Objects = aws s3api list-objects --bucket $Bucket --prefix $KeyPrefix --no-sign --output json | ConvertFrom-Json
$InstallerExeKey = ($Objects.Contents | Where-Object { $_.Key -like "*.exe" }).Key
$InstallerUrl = "https://$Bucket.s3.amazonaws.com/$InstallerExeKey"
Write-Output "Downloading $InstallerUrl to $LocalInstallerPath"
New-Item -ItemType Directory -Path "$LocalDirectory" -Force
$wc.DownloadFile("$InstallerUrl", "$LocalInstallerPath")
Any idea what the issue might be?
We've made sure our Iam role has s3 access, etc (even though we're downloading via http).