Skip to content

Commit 821af90

Browse files
Gadam8adam.gloyneasyncapi-bot
authored
feat: extend aws policy configuration (#553)
feat: extend aws policy configuration --------- Co-authored-by: adam.gloyne <[email protected]> Co-authored-by: asyncapi-bot <[email protected]>
1 parent d83cc02 commit 821af90

File tree

4 files changed

+1181
-0
lines changed

4 files changed

+1181
-0
lines changed

bindings/sns/0.2.0/channel.json

+226
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://asyncapi.com/bindings/sns/0.2.0/channel.json",
4+
"title": "Channel Schema",
5+
"description": "This object contains information about the channel representation in SNS.",
6+
"type": "object",
7+
"additionalProperties": false,
8+
"patternProperties": {
9+
"^x-[\\w\\d\\.\\x2d_]+$": {
10+
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
11+
}
12+
},
13+
"properties": {
14+
"name": {
15+
"type": "string",
16+
"description": "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations."
17+
},
18+
"ordering": {
19+
"$ref": "http://asyncapi.com/bindings/sns/0.2.0/channel.json#/definitions/ordering"
20+
},
21+
"policy": {
22+
"$ref": "http://asyncapi.com/bindings/sns/0.2.0/channel.json#/definitions/policy"
23+
},
24+
"tags": {
25+
"type": "object",
26+
"description": "Key-value pairs that represent AWS tags on the topic."
27+
},
28+
"bindingVersion": {
29+
"type": "string",
30+
"description": "The version of this binding.",
31+
"default": "latest"
32+
}
33+
},
34+
"required": [
35+
"name"
36+
],
37+
"definitions": {
38+
"ordering": {
39+
"type": "object",
40+
"description": "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.",
41+
"patternProperties": {
42+
"^x-[\\w\\d\\.\\x2d_]+$": {
43+
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
44+
}
45+
},
46+
"properties": {
47+
"type": {
48+
"type": "string",
49+
"description": "Defines the type of SNS Topic.",
50+
"enum": [
51+
"standard",
52+
"FIFO"
53+
]
54+
},
55+
"contentBasedDeduplication": {
56+
"type": "boolean",
57+
"description": "True to turn on de-duplication of messages for a channel."
58+
}
59+
},
60+
"required": [
61+
"type"
62+
]
63+
},
64+
"policy": {
65+
"type": "object",
66+
"description": "The security policy for the SNS Topic.",
67+
"patternProperties": {
68+
"^x-[\\w\\d\\.\\x2d_]+$": {
69+
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
70+
}
71+
},
72+
"properties": {
73+
"statements": {
74+
"type": "array",
75+
"description": "An array of statement objects, each of which controls a permission for this topic",
76+
"items": {
77+
"$ref": "http://asyncapi.com/bindings/sns/0.2.0/channel.json#/definitions/statement"
78+
}
79+
}
80+
},
81+
"required": [
82+
"statements"
83+
]
84+
},
85+
"statement": {
86+
"type": "object",
87+
"patternProperties": {
88+
"^x-[\\w\\d\\.\\x2d_]+$": {
89+
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
90+
}
91+
},
92+
"properties": {
93+
"effect": {
94+
"type": "string",
95+
"enum": [
96+
"Allow",
97+
"Deny"
98+
]
99+
},
100+
"principal": {
101+
"description": "The AWS account(s) or resource ARN(s) that this statement applies to.",
102+
"oneOf": [
103+
{
104+
"type": "string"
105+
},
106+
{
107+
"type": "object",
108+
"properties": {
109+
"AWS": {
110+
"oneOf": [
111+
{
112+
"type": "string"
113+
},
114+
{
115+
"type": "array",
116+
"items": {
117+
"type": "string"
118+
}
119+
}
120+
]
121+
}
122+
},
123+
"required": [
124+
"AWS"
125+
],
126+
"additionalProperties": false
127+
},
128+
{
129+
"type": "object",
130+
"properties": {
131+
"Service": {
132+
"oneOf": [
133+
{
134+
"type": "string"
135+
},
136+
{
137+
"type": "array",
138+
"items": {
139+
"type": "string"
140+
}
141+
}
142+
]
143+
}
144+
},
145+
"required": [
146+
"Service"
147+
],
148+
"additionalProperties": false
149+
}
150+
]
151+
},
152+
"action": {
153+
"description": "The SNS permission(s) being allowed or denied e.g. sns:Publish",
154+
"oneOf": [
155+
{
156+
"type": "string"
157+
},
158+
{
159+
"type": "array",
160+
"items": {
161+
"type": "string"
162+
}
163+
}
164+
]
165+
},
166+
"resource": {
167+
"description": "The resource(s) that this policy applies to.",
168+
"oneOf": [
169+
{
170+
"type": "string"
171+
},
172+
{
173+
"type": "array",
174+
"items": {
175+
"type": "string"
176+
}
177+
}
178+
]
179+
},
180+
"condition": {
181+
"description": "Specific circumstances under which the policy grants permission",
182+
"type": "object",
183+
"patternProperties": {
184+
".*": {
185+
"type": "object",
186+
"patternProperties": {
187+
".*": {
188+
"oneOf": [
189+
{
190+
"type": "string"
191+
},
192+
{
193+
"type": "array",
194+
"items": {
195+
"type": "string"
196+
}
197+
}
198+
]
199+
}
200+
}
201+
}
202+
}
203+
}
204+
},
205+
"required": [
206+
"effect",
207+
"principal",
208+
"action"
209+
]
210+
}
211+
},
212+
"examples": [
213+
{
214+
"name": "my-sns-topic",
215+
"policy": {
216+
"statements": [
217+
{
218+
"effect": "Allow",
219+
"principal": "*",
220+
"action": "SNS:Publish"
221+
}
222+
]
223+
}
224+
}
225+
]
226+
}

0 commit comments

Comments
 (0)