Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29243

WinRM failed to connect CIS Benchmark Windows image

$
0
0

I am trying to build a packer using base image as "CIS Microsoft Windows Server 2016 Benchmark v1.1.0.9 Level 1". I am using WinRM to connect to packer however, WinRM failed to connect and ended with an error "Too long with no output (exceeded 45m0s): context deadline exceeded" in CircleCI job.

I have checked multiple article where it has mentioned CIS images have basic authentication is disabled for WinRM protocol under GPO.

Below is my code;

"type": "amazon-ebs","ami_name": "Windows Server-2016 RCM {{user `git_sha`}} {{timestamp}}","instance_type": "r5.2xlarge","region": "eu-west-1","ami_description": "Windows Server-2016 RCM CIS Benchmark Build","force_deregister": true,"force_delete_snapshot": true,"communicator": "winrm","winrm_timeout": "12h","winrm_username": "*******","winrm_port": 22,"user_data_file": "packer-common.user_data","subnet_id": "{{user `subnet_id`}}","security_group_ids": "{{user `security_group_ids`}}","associate_public_ip_address": true,"iam_instance_profile": "{{user `iam_instance_profile`}}","source_ami_filter": {"filters": {"name": "{{user `CIS_Benchmark_Image`}}*"        },"owners": ["679593333241"],"most_recent": true    },

"packer-common.user_data" code as below;

Set-Item WSMan:\localhost\Listener\*\Port 22 -ForceSet-Item WSMan:\localhost\Service\AllowUnencrypted TrueSet-Item WSMan:\localhost\Client\Auth\Basic TrueSet-Item WSMan:\localhost\Service\Auth\Basic TrueRestart-Service WinRmNew-NetFirewallRule -DisplayName "Allow WinRM on 22" -Direction Inbound -Protocol TCP -LocalPort 22

Is there a way to connect to packer or something I need to check with "user_data_file"?

Thanks.

Regards,Sagar


Viewing all articles
Browse latest Browse all 29243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>