Skip to content

Commit a7e6ac8

Browse files
author
AWS
committed
CloudWatch RUM Update: Add support for PutResourcePolicy, GetResourcePolicy and DeleteResourcePolicy to support resource based policies for AWS CloudWatch RUM
1 parent 7c2ccd4 commit a7e6ac8

File tree

2 files changed

+229
-2
lines changed

2 files changed

+229
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "CloudWatch RUM",
4+
"contributor": "",
5+
"description": "Add support for PutResourcePolicy, GetResourcePolicy and DeleteResourcePolicy to support resource based policies for AWS CloudWatch RUM"
6+
}

services/rum/src/main/resources/codegen-resources/service-2.json

Lines changed: 223 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
"endpointPrefix":"rum",
66
"jsonVersion":"1.1",
77
"protocol":"rest-json",
8+
"protocols":["rest-json"],
89
"serviceFullName":"CloudWatch RUM",
910
"serviceId":"RUM",
1011
"signatureVersion":"v4",
1112
"signingName":"rum",
12-
"uid":"rum-2018-05-10"
13+
"uid":"rum-2018-05-10",
14+
"auth":["aws.auth#sigv4"]
1315
},
1416
"operations":{
1517
"BatchCreateRumMetricDefinitions":{
@@ -111,6 +113,28 @@
111113
"documentation":"<p>Deletes an existing app monitor. This immediately stops the collection of data.</p>",
112114
"idempotent":true
113115
},
116+
"DeleteResourcePolicy":{
117+
"name":"DeleteResourcePolicy",
118+
"http":{
119+
"method":"DELETE",
120+
"requestUri":"/appmonitor/{Name}/policy",
121+
"responseCode":200
122+
},
123+
"input":{"shape":"DeleteResourcePolicyRequest"},
124+
"output":{"shape":"DeleteResourcePolicyResponse"},
125+
"errors":[
126+
{"shape":"InvalidPolicyRevisionIdException"},
127+
{"shape":"ConflictException"},
128+
{"shape":"ResourceNotFoundException"},
129+
{"shape":"InternalServerException"},
130+
{"shape":"PolicyNotFoundException"},
131+
{"shape":"ValidationException"},
132+
{"shape":"ThrottlingException"},
133+
{"shape":"AccessDeniedException"}
134+
],
135+
"documentation":"<p>Removes the association of a resource-based policy from an app monitor.</p>",
136+
"idempotent":true
137+
},
114138
"DeleteRumMetricsDestination":{
115139
"name":"DeleteRumMetricsDestination",
116140
"http":{
@@ -167,6 +191,26 @@
167191
],
168192
"documentation":"<p>Retrieves the raw performance events that RUM has collected from your web application, so that you can do your own processing or analysis of this data.</p>"
169193
},
194+
"GetResourcePolicy":{
195+
"name":"GetResourcePolicy",
196+
"http":{
197+
"method":"GET",
198+
"requestUri":"/appmonitor/{Name}/policy",
199+
"responseCode":200
200+
},
201+
"input":{"shape":"GetResourcePolicyRequest"},
202+
"output":{"shape":"GetResourcePolicyResponse"},
203+
"errors":[
204+
{"shape":"ConflictException"},
205+
{"shape":"ResourceNotFoundException"},
206+
{"shape":"InternalServerException"},
207+
{"shape":"PolicyNotFoundException"},
208+
{"shape":"ValidationException"},
209+
{"shape":"ThrottlingException"},
210+
{"shape":"AccessDeniedException"}
211+
],
212+
"documentation":"<p>Use this operation to retrieve information about a resource-based policy that is attached to an app monitor.</p>"
213+
},
170214
"ListAppMonitors":{
171215
"name":"ListAppMonitors",
172216
"http":{
@@ -217,6 +261,29 @@
217261
],
218262
"documentation":"<p>Displays the tags associated with a CloudWatch RUM resource.</p>"
219263
},
264+
"PutResourcePolicy":{
265+
"name":"PutResourcePolicy",
266+
"http":{
267+
"method":"PUT",
268+
"requestUri":"/appmonitor/{Name}/policy",
269+
"responseCode":200
270+
},
271+
"input":{"shape":"PutResourcePolicyRequest"},
272+
"output":{"shape":"PutResourcePolicyResponse"},
273+
"errors":[
274+
{"shape":"PolicySizeLimitExceededException"},
275+
{"shape":"InvalidPolicyRevisionIdException"},
276+
{"shape":"ConflictException"},
277+
{"shape":"ResourceNotFoundException"},
278+
{"shape":"InternalServerException"},
279+
{"shape":"ValidationException"},
280+
{"shape":"MalformedPolicyDocumentException"},
281+
{"shape":"ThrottlingException"},
282+
{"shape":"AccessDeniedException"}
283+
],
284+
"documentation":"<p>Use this operation to assign a resource-based policy to a CloudWatch RUM app monitor to control access to it. Each app monitor can have one resource-based policy. The maximum size of the policy is 4 KB. To learn more about using resource policies with RUM, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-resource-policies.html\">Using resource-based policies with CloudWatch RUM</a>.</p>",
285+
"idempotent":true
286+
},
220287
"PutRumEvents":{
221288
"name":"PutRumEvents",
222289
"http":{
@@ -345,6 +412,11 @@
345412
},
346413
"exception":true
347414
},
415+
"Alias":{
416+
"type":"string",
417+
"max":255,
418+
"min":1
419+
},
348420
"AppMonitor":{
349421
"type":"structure",
350422
"members":{
@@ -455,7 +527,7 @@
455527
"type":"string",
456528
"max":253,
457529
"min":1,
458-
"pattern":"^(localhost)|^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|^(?![-.])([A-Za-z0-9-\\.\\-]{0,63})((?![-])([a-zA-Z0-9]{1}|^[a-zA-Z0-9]{0,1}))\\.(?![-])[A-Za-z-0-9]{1,63}((?![-])([a-zA-Z0-9]{1}|^[a-zA-Z0-9]{0,1}))|^(\\*\\.)(?![-.])([A-Za-z0-9-\\.\\-]{0,63})((?![-])([a-zA-Z0-9]{1}|^[a-zA-Z0-9]{0,1}))\\.(?![-])[A-Za-z-0-9]{1,63}((?![-])([a-zA-Z0-9]{1}|^[a-zA-Z0-9]{0,1}))"
530+
"pattern":"^(localhost)$|^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|(?=^[a-zA-Z0-9\\.\\*-]{4,253}$)(?!.*\\.-)(?!.*-\\.)(?!.*\\.\\.)(?!.*[^\\.]{64,})^(\\*\\.)?(?![-\\.\\*])[^\\*]{1,}\\.(?!.*--)(?=.*[a-zA-Z])[^\\*]{1,}[^\\*-]$"
459531
},
460532
"AppMonitorId":{
461533
"type":"string",
@@ -827,6 +899,33 @@
827899
"members":{
828900
}
829901
},
902+
"DeleteResourcePolicyRequest":{
903+
"type":"structure",
904+
"required":["Name"],
905+
"members":{
906+
"Name":{
907+
"shape":"AppMonitorName",
908+
"documentation":"<p>The app monitor that you want to remove the resource policy from.</p>",
909+
"location":"uri",
910+
"locationName":"Name"
911+
},
912+
"PolicyRevisionId":{
913+
"shape":"PolicyRevisionId",
914+
"documentation":"<p>Specifies a specific policy revision to delete. Provide a <code>PolicyRevisionId</code> to ensure an atomic delete operation. If the revision ID that you provide doesn't match the latest policy revision ID, the request will be rejected with an <code>InvalidPolicyRevisionIdException</code> error.</p>",
915+
"location":"querystring",
916+
"locationName":"policyRevisionId"
917+
}
918+
}
919+
},
920+
"DeleteResourcePolicyResponse":{
921+
"type":"structure",
922+
"members":{
923+
"PolicyRevisionId":{
924+
"shape":"PolicyRevisionId",
925+
"documentation":"<p>The revision ID of the policy that was removed, if it had one.</p>"
926+
}
927+
}
928+
},
830929
"DeleteRumMetricsDestinationRequest":{
831930
"type":"structure",
832931
"required":[
@@ -964,6 +1063,31 @@
9641063
}
9651064
}
9661065
},
1066+
"GetResourcePolicyRequest":{
1067+
"type":"structure",
1068+
"required":["Name"],
1069+
"members":{
1070+
"Name":{
1071+
"shape":"AppMonitorName",
1072+
"documentation":"<p>The name of the app monitor that is associated with the resource-based policy that you want to view.</p>",
1073+
"location":"uri",
1074+
"locationName":"Name"
1075+
}
1076+
}
1077+
},
1078+
"GetResourcePolicyResponse":{
1079+
"type":"structure",
1080+
"members":{
1081+
"PolicyDocument":{
1082+
"shape":"String",
1083+
"documentation":"<p>The JSON policy document that you requested.</p>"
1084+
},
1085+
"PolicyRevisionId":{
1086+
"shape":"PolicyRevisionId",
1087+
"documentation":"<p>The revision ID information for this version of the policy document that you requested.</p>"
1088+
}
1089+
}
1090+
},
9671091
"ISOTimestampString":{
9681092
"type":"string",
9691093
"max":19,
@@ -1001,6 +1125,19 @@
10011125
"fault":true,
10021126
"retryable":{"throttling":false}
10031127
},
1128+
"InvalidPolicyRevisionIdException":{
1129+
"type":"structure",
1130+
"required":["message"],
1131+
"members":{
1132+
"message":{"shape":"String"}
1133+
},
1134+
"documentation":"<p>The policy revision ID that you provided doeesn't match the latest policy revision ID.</p>",
1135+
"error":{
1136+
"httpStatusCode":400,
1137+
"senderFault":true
1138+
},
1139+
"exception":true
1140+
},
10041141
"JsonValue":{"type":"string"},
10051142
"ListAppMonitorsRequest":{
10061143
"type":"structure",
@@ -1098,6 +1235,19 @@
10981235
}
10991236
}
11001237
},
1238+
"MalformedPolicyDocumentException":{
1239+
"type":"structure",
1240+
"required":["message"],
1241+
"members":{
1242+
"message":{"shape":"String"}
1243+
},
1244+
"documentation":"<p>The policy document that you specified is not formatted correctly.</p>",
1245+
"error":{
1246+
"httpStatusCode":400,
1247+
"senderFault":true
1248+
},
1249+
"exception":true
1250+
},
11011251
"MaxQueryResults":{
11021252
"type":"integer",
11031253
"max":100,
@@ -1241,6 +1391,73 @@
12411391
"max":50,
12421392
"min":0
12431393
},
1394+
"PolicyNotFoundException":{
1395+
"type":"structure",
1396+
"required":["message"],
1397+
"members":{
1398+
"message":{"shape":"String"}
1399+
},
1400+
"documentation":"<p>The resource-based policy doesn't exist on this app monitor.</p>",
1401+
"error":{
1402+
"httpStatusCode":404,
1403+
"senderFault":true
1404+
},
1405+
"exception":true
1406+
},
1407+
"PolicyRevisionId":{
1408+
"type":"string",
1409+
"max":255,
1410+
"min":1
1411+
},
1412+
"PolicySizeLimitExceededException":{
1413+
"type":"structure",
1414+
"required":["message"],
1415+
"members":{
1416+
"message":{"shape":"String"}
1417+
},
1418+
"documentation":"<p>The policy document is too large. The limit is 4 KB.</p>",
1419+
"error":{
1420+
"httpStatusCode":400,
1421+
"senderFault":true
1422+
},
1423+
"exception":true
1424+
},
1425+
"PutResourcePolicyRequest":{
1426+
"type":"structure",
1427+
"required":[
1428+
"Name",
1429+
"PolicyDocument"
1430+
],
1431+
"members":{
1432+
"Name":{
1433+
"shape":"AppMonitorName",
1434+
"documentation":"<p>The name of the app monitor that you want to apply this resource-based policy to. To find the names of your app monitors, you can use the <a href=\"https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_ListAppMonitors.html\">ListAppMonitors</a> operation.</p>",
1435+
"location":"uri",
1436+
"locationName":"Name"
1437+
},
1438+
"PolicyDocument":{
1439+
"shape":"String",
1440+
"documentation":"<p>The JSON to use as the resource policy. The document can be up to 4 KB in size. For more information about the contents and syntax for this policy, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-resource-policies.html\">Using resource-based policies with CloudWatch RUM</a>.</p>"
1441+
},
1442+
"PolicyRevisionId":{
1443+
"shape":"PolicyRevisionId",
1444+
"documentation":"<p>A string value that you can use to conditionally update your policy. You can provide the revision ID of your existing policy to make mutating requests against that policy.</p> <p>When you assign a policy revision ID, then later requests about that policy will be rejected with an <code>InvalidPolicyRevisionIdException</code> error if they don't provide the correct current revision ID.</p>"
1445+
}
1446+
}
1447+
},
1448+
"PutResourcePolicyResponse":{
1449+
"type":"structure",
1450+
"members":{
1451+
"PolicyDocument":{
1452+
"shape":"String",
1453+
"documentation":"<p>The JSON policy document that you specified.</p>"
1454+
},
1455+
"PolicyRevisionId":{
1456+
"shape":"PolicyRevisionId",
1457+
"documentation":"<p>The policy revision ID information that you specified.</p>"
1458+
}
1459+
}
1460+
},
12441461
"PutRumEventsRequest":{
12451462
"type":"structure",
12461463
"required":[
@@ -1251,6 +1468,10 @@
12511468
"UserDetails"
12521469
],
12531470
"members":{
1471+
"Alias":{
1472+
"shape":"Alias",
1473+
"documentation":"<p>If the app monitor uses a resource-based policy that requires <code>PutRumEvents</code> requests to specify a certain alias, specify that alias here. This alias will be compared to the <code>rum:alias</code> context key in the resource-based policy. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-resource-policies.html\">Using resource-based policies with CloudWatch RUM</a>.</p>"
1474+
},
12541475
"AppMonitorDetails":{
12551476
"shape":"AppMonitorDetails",
12561477
"documentation":"<p>A structure that contains information about the app monitor that collected this telemetry information.</p>"

0 commit comments

Comments
 (0)