I am using AWS SSM send-command to run a PowerShell script on an AWS instance.
The following commanad works fine in a command shell but when called in Terraform gets an error.
aws ssm send-command --instance-ids ${self.id} --document-name AWS-RunPowerShellScript --parameters commands='C:\\Installers\\bootstrap_test.ps1 test' --output-s3-bucket-name ellucian-ecrm-lab --output-s3-key-prefix bootstraplogsst'
when called in Terraform using:
provisioner "local-exec" {
command = "aws ssm send-command --instance-ids ${self.id} --document-name AWS-RunPowerShellScript --parameters commands='C:\\Installers\\bootstrap_test.ps1 test' --output-s3-bucket-name ellucian-ecrm-lab --output-s3-key-prefix bootstraplogs" }
The error returned is:
exit status 255. Output: usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
Unknown options: test'
So I don't thing Terraform is parsing the string the way AWS needs it. what can I do to format this string correctly in Terraform?
Thanks!