mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
feat(cloudwatch-logs): add resource policy actions (#2574)
This commit is contained in:
1 parent
247bd590bc
commit
859db2f352
5 files changed
+130
-1
No files matched your search
+22
@@ -145,6 +145,28 @@ class CloudWatchLogsHandlerTest {
|
||||
assertTrue(group.path("deletionProtectionEnabled").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
void putResourcePolicyIsReturnedByDescribeResourcePolicies() {
|
||||
String document = "{\"Version\":\"2012-10-17\",\"Statement\":[]}";
|
||||
ObjectNode put = MAPPER.createObjectNode();
|
||||
put.put("policyName", "delivery-policy");
|
||||
put.put("policyDocument", document);
|
||||
|
||||
JsonNode created = (JsonNode) handler.handle("PutResourcePolicy", put, REGION).getEntity();
|
||||
|
||||
assertEquals("delivery-policy", created.path("resourcePolicy").path("policyName").asText());
|
||||
assertEquals(document, created.path("resourcePolicy").path("policyDocument").asText());
|
||||
assertTrue(created.path("resourcePolicy").path("lastUpdatedTime").asLong() > 0);
|
||||
|
||||
JsonNode described = (JsonNode) handler.handle(
|
||||
"DescribeResourcePolicies", MAPPER.createObjectNode(), REGION).getEntity();
|
||||
assertEquals(1, described.path("resourcePolicies").size());
|
||||
assertEquals("delivery-policy",
|
||||
described.path("resourcePolicies").get(0).path("policyName").asText());
|
||||
assertEquals(document,
|
||||
described.path("resourcePolicies").get(0).path("policyDocument").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
void putLogGroupDeletionProtectionPersistsByName() {
|
||||
ObjectNode request = MAPPER.createObjectNode();
|
||||
|
||||
Reference in new issue
Block a user