如何使用 AWS Powershell 模块和 powershell 向 AWS API Gateway 中的资源添加方法?
到目前为止我尝试过的
此 powershell 脚本不起作用:
$op = @{Op='add'; Path='/ResourceMethods'; Value='GET'}
Update-AGResource -RestApiId $id -resourceId $resid `
-PatchOperation $op -region $region @creds
此页面上的 Amazon 文档显示了使用 AWS CLI 工具的等效示例...
aws apigateway put-method --rest-api-id te6si5ach7 \
--region us-west-2 \
--resource-id 2jf6xt \
--http-method ANY \
--authorization-type "NONE"
...但我不想使用 CLI。我想改用powershell。
我认为问题可能是Path
$op 的项目。文档对于方法的路径应该是什么不是很清楚。