Is there anyway to pass the variable (var) defined in python idle to AWS-RunPowerShellScript commands section ?
Here is my code:
import boto3
ssm = boto3.client("ssm")
var = "test"
res = ssm.send_command(
DocumentName="AWS-RunPowerShellScript",
Targets=[
{
'Key': 'tag:test',
'Values': ['testing']
}
]
Comment="Test",
Parameters={'commands':[
'hostname',
'$var'
]
}
)
In the above code, I am defining variable var in python and the same I want to refer in the commands section of the send_command as $var but it seems like it is not working due to the remote execution. Is there any possibility to pass the variable from python to the commands section ?