我正在研究AWS系统管理器,我用它将我的软件推送到使用分发服务器的实例,在系统管理器下。
分发服务器创建一个package.The包将包含我的安装脚本、卸载脚本和.exe文件,我将把整个包保存为系统管理器维护的SSM文档。
如果我有两个AWS帐户,我的问题是:
A account -我创建了一个包的帐户(美东-1)
B帐户-正在运行的实例。
我想把包推到'A‘来解释'B’实例。
我必须用我的python code.So来完成这个操作,我使用了boto3。
def runcommand(self,instanceid):
try:
response = self.ssmclient.send_command(
InstanceIds=[instanceid,],
DocumentName='AWS-ConfigureAWSPackage',
TimeoutSeconds=600,
Parameters={
'action': ['Install'],
'installationType':['Uninstall and reinstall'],
'name':['arn:aws:ssm:us-east-1:accnumber:document/SSMDistributorPackage']
},
OutputS3Region='ap-southeast-2',
OutputS3BucketName='output',
OutputS3KeyPrefix='abcd',
)
print("Successfully pushed the agent....")
except Exception as e:
print("The error while running command:::::",str(e))
print("response(send_command)::::",response)但是它会引发错误,如无效文档:跨区域arn不支持。
我怎么才能解决这个问题?
是否可以使这个包得到所有aws帐户的支持?
发布于 2020-06-06 08:16:14
SSM文档可以是跨账户共享。
但是,此错误不是交叉帐户错误。它是指将SSM文档从一个区域引用到另一个区域。
由于客户端和实例在ap-southeast-2中,但文档位于us-east-1中,因此需要在ap-southeast-2区域中创建文档。
https://stackoverflow.com/questions/62229041
复制相似问题