Enhancement - Add policy to update rest api for apigateway (#5951)
This commit is contained in:
parent
11e2120046
commit
c875e7aa0e
@ -1070,6 +1070,8 @@ class RestAPI(CloudFormationModel):
|
||||
self.binaryMediaTypes = [value]
|
||||
if to_path(self.PROP_DISABLE_EXECUTE_API_ENDPOINT) in path:
|
||||
self.disableExecuteApiEndpoint = bool(value)
|
||||
if to_path(self.PROP_POLICY) in path:
|
||||
self.policy = value
|
||||
elif operaton == self.OPERATION_ADD:
|
||||
if to_path(self.PROP_BINARY_MEDIA_TYPES) in path:
|
||||
self.binaryMediaTypes.append(value)
|
||||
|
@ -52,6 +52,12 @@ def test_update_rest_api():
|
||||
{"op": "replace", "path": "/apiKeySource", "value": "AUTHORIZER"},
|
||||
{"op": "replace", "path": "/binaryMediaTypes", "value": "image/jpeg"},
|
||||
{"op": "replace", "path": "/disableExecuteApiEndpoint", "value": "True"},
|
||||
{
|
||||
"op": "replace",
|
||||
"path": "/policy",
|
||||
"value": '{"Version": "2012-10-17", "Statement": [{"Effect": "Allow", "Principal": "*", "Action": '
|
||||
'"execute-api:Invoke", "Resource": ["execute-api:/*"]}]}',
|
||||
},
|
||||
]
|
||||
|
||||
response = client.update_rest_api(restApiId=api_id, patchOperations=patchOperations)
|
||||
@ -65,6 +71,8 @@ def test_update_rest_api():
|
||||
"version": "V1",
|
||||
"description": "new-description",
|
||||
"apiKeySource": "AUTHORIZER",
|
||||
"policy": '{"Version": "2012-10-17", "Statement": [{"Effect": "Allow", "Principal": "*", "Action": '
|
||||
'"execute-api:Invoke", "Resource": ["execute-api:/*"]}]}',
|
||||
"endpointConfiguration": {"types": ["EDGE"]},
|
||||
"tags": {},
|
||||
"disableExecuteApiEndpoint": True,
|
||||
|
Loading…
Reference in New Issue
Block a user