0

如何使用 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 的项目。文档对于方法的路径应该是什么不是很清楚。

4

1 回答 1

1

我已经解决了。

Update-AGResource 是添加方法的错误 cmdlet。正确的 cmdlet 是Write-AGMethod

于 2018-08-23T00:18:09.540 回答