简体   繁体   English

AWS Distributor - 如何创建灵活的 SSM Distributor Package?

[英]AWS Distributor - How to create a flexible SSM Distributor Package?

I have created an AWS Systems Manager Distributor Package.我创建了一个 AWS Systems Manager 分销商 Package。 It is very specific to my environment.它非常适合我的环境。 I would like to generalize it.我想概括一下。 In the install.ps1 file I currently have:在我目前拥有的install.ps1文件中:

msiexec /i mymsi.msi PARM1="TEST-1" PARM2="360fc9f925458cd2039a299" /qn /L*v myinstall.log

I would like to generalize this such that my install.ps1 file would look something like this:我想概括一下,这样我的install.ps1文件看起来像这样:

msiexec /i mymsi.msi var1="{MYPARM1}" var2="{MYPARM2}" /qn /L*v myinstall.log

Then when performing the distribution, I would include MYPARM1, MYPARM2 as part of the distribution.然后在执行分发时,我会将 MYPARM1、MYPARM2 作为分发的一部分。 This would allow a public distribution of the product to various customers who are provided values for MYPARM1, MYPARM2这将允许将产品公开分发给获得 MYPARM1、MYPARM2 值的各种客户

I think these parameter values would go in the "Additional Arguments" section when using the AWS Console to Install the Distributor我认为在使用 AWS 控制台安装分发器时,这些参数值会在“附加参数”部分中的 go

This required reverse-engineering a third-party add-in:这需要对第三方加载项进行逆向工程:

1-within the *.ps1 files parameters are read. 1-在 *.ps1 文件中读取参数。 The parms must have a prefix of SSM参数必须具有 SSM 前缀

Example install.ps1 :示例install.ps1

$MYPARM1=$env:SSM_MYPARM1
$MYPARM2=$env:SSM_MYPARM2
msiexec /i mymsi.msi var1=$MYPARM1 var2=$MYPARM2 /qn /L*v myinstall.log

2 - When supplying Additional Arguments to the AWS portal, provide the following 2 - 向 AWS 门户提供额外的 Arguments时,请提供以下信息

{
    "SSM_MYPARM1": "value1",
    "SSM_MYPARM2": "value2"
}

When the * .ps1 file is invoked, the values are read from Additional Arguments and can be used in the script.调用 * .ps1文件时,会从Additional Arguments读取值,并可在脚本中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM