diff --git a/moto/ssm/models.py b/moto/ssm/models.py index c15a2047a..0f75599c3 100644 --- a/moto/ssm/models.py +++ b/moto/ssm/models.py @@ -150,19 +150,15 @@ class SimpleSystemManagerBackend(BaseBackend): 'DocumentName': kwargs['DocumentName'], 'Comment': kwargs.get('Comment'), 'ExpiresAfter': expires_after.isoformat(), - 'Parameters': { - 'string': [ - 'string', - ] - }, + 'Parameters': kwargs['Parameters'], 'InstanceIds': kwargs['InstanceIds'], 'Targets': kwargs.get('targets'), 'RequestedDateTime': now.isoformat(), 'Status': 'Success', 'StatusDetails': 'string', - 'OutputS3Region': 'string', - 'OutputS3BucketName': 'string', - 'OutputS3KeyPrefix': 'string', + 'OutputS3Region': kwargs.get('OutputS3Region'), + 'OutputS3BucketName': kwargs.get('OutputS3BucketName'), + 'OutputS3KeyPrefix': kwargs.get('OutputS3KeyPrefix'), 'MaxConcurrency': 'string', 'MaxErrors': 'string', 'TargetCount': len(instances), diff --git a/tests/test_ssm/test_ssm_boto3.py b/tests/test_ssm/test_ssm_boto3.py index c9be673ac..5d6588732 100644 --- a/tests/test_ssm/test_ssm_boto3.py +++ b/tests/test_ssm/test_ssm_boto3.py @@ -463,15 +463,27 @@ def test_add_remove_list_tags_for_resource(): @mock_ssm def test_send_command(): ssm_document = 'AWS-RunShellScript' - script = '#!/bin/bash\necho \'hello world\'' + params = {'commands': ['#!/bin/bash\necho \'hello world\'']} client = boto3.client('ssm', region_name='us-east-1') + before = datetime.datetime.now() response = client.send_command( InstanceIds=['i-123456'], DocumentName=ssm_document, TimeoutSeconds=60, - Parameters={'commands': [script]}, - OutputS3BucketName='the-bucket' + Parameters=params, + OutputS3Region='us-east-2', + OutputS3BucketName='the-bucket', + OutputS3KeyPrefix='pref' ) + cmd = response['Command'] - assert response['Command'] + cmd['CommandId'].should_not.be(None) + cmd['DocumentName'].should.equal(ssm_document) + cmd['Parameters'].should.equal(params) + + cmd['OutputS3Region'].should.equal('us-east-2') + cmd['OutputS3BucketName'].should.equal('the-bucket') + cmd['OutputS3KeyPrefix'].should.equal('pref') + + cmd['ExpiresAfter'].should.be.greater_than(before)