Dear all,
I have tried to creating user credentials in AWS EC2 windows instance using Boto3. I just searched for a lot of things and tried. Below one is what I find to execute the AWS Powershell script to create a user name and password.
import boto3
ssm_client = boto3.client('ssm', region_name="us-west-2") # use region code in which you are working
response = ssm_client.send_command(
InstanceIds=[
"i-03########" # use instance id on which you want to execute, even multiple is allowd
],
DocumentName="AWS-RunPowerShellScript",
Parameters={
'commands':[
'ipconfig'
]
},
})
command_id = response['Command']['CommandId']
output = ssm_client.get_command_invocation(
CommandId=command_id,
InstanceId='i-03######',
)
print(output)
Can anyone tell me? What should I do to create a user name and password in the AWS Windows Ec2 instance?