Skip to content

Commit f77939d

Browse files
Add support for Dualstack endpoints
1 parent 3dbd81a commit f77939d

File tree

8 files changed

+101
-867
lines changed

8 files changed

+101
-867
lines changed

generator/ServiceModels/ecr-public/ecr-public-2020-10-30.api.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
"endpointPrefix":"api.ecr-public",
66
"jsonVersion":"1.1",
77
"protocol":"json",
8+
"protocols":["json"],
89
"serviceAbbreviation":"Amazon ECR Public",
910
"serviceFullName":"Amazon Elastic Container Registry Public",
1011
"serviceId":"ECR PUBLIC",
1112
"signatureVersion":"v4",
1213
"signingName":"ecr-public",
1314
"targetPrefix":"SpencerFrontendService",
14-
"uid":"ecr-public-2020-10-30"
15+
"uid":"ecr-public-2020-10-30",
16+
"auth":["aws.auth#sigv4"]
1517
},
1618
"operations":{
1719
"BatchCheckLayerAvailability":{

generator/ServiceModels/ecr-public/ecr-public-2020-10-30.endpoint-rule-set.json

Lines changed: 38 additions & 225 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,19 @@
77
"documentation": "The AWS region used to dispatch the request.",
88
"type": "String"
99
},
10-
"UseDualStack": {
11-
"builtIn": "AWS::UseDualStack",
12-
"required": true,
13-
"default": false,
14-
"documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
15-
"type": "Boolean"
16-
},
1710
"UseFIPS": {
1811
"builtIn": "AWS::UseFIPS",
1912
"required": true,
2013
"default": false,
2114
"documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
2215
"type": "Boolean"
2316
},
24-
"Endpoint": {
25-
"builtIn": "SDK::Endpoint",
26-
"required": false,
27-
"documentation": "Override the endpoint used to send this request",
28-
"type": "String"
17+
"UseDualStack": {
18+
"builtIn": "AWS::UseDualStack",
19+
"required": true,
20+
"default": false,
21+
"documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
22+
"type": "Boolean"
2923
}
3024
},
3125
"rules": [
@@ -35,9 +29,18 @@
3529
"fn": "isSet",
3630
"argv": [
3731
{
38-
"ref": "Endpoint"
32+
"ref": "Region"
3933
}
4034
]
35+
},
36+
{
37+
"fn": "aws.partition",
38+
"argv": [
39+
{
40+
"ref": "Region"
41+
}
42+
],
43+
"assign": "PartitionResult"
4144
}
4245
],
4346
"rules": [
@@ -53,7 +56,7 @@
5356
]
5457
}
5558
],
56-
"error": "Invalid Configuration: FIPS and custom endpoint are not supported",
59+
"error": "ECR Public does not support FIPS",
5760
"type": "error"
5861
},
5962
{
@@ -68,247 +71,57 @@
6871
]
6972
}
7073
],
71-
"error": "Invalid Configuration: Dualstack and custom endpoint are not supported",
72-
"type": "error"
73-
},
74-
{
75-
"conditions": [],
76-
"endpoint": {
77-
"url": {
78-
"ref": "Endpoint"
79-
},
80-
"properties": {},
81-
"headers": {}
82-
},
83-
"type": "endpoint"
84-
}
85-
],
86-
"type": "tree"
87-
},
88-
{
89-
"conditions": [
90-
{
91-
"fn": "isSet",
92-
"argv": [
93-
{
94-
"ref": "Region"
95-
}
96-
]
97-
}
98-
],
99-
"rules": [
100-
{
101-
"conditions": [
102-
{
103-
"fn": "aws.partition",
104-
"argv": [
105-
{
106-
"ref": "Region"
107-
}
108-
],
109-
"assign": "PartitionResult"
110-
}
111-
],
11274
"rules": [
11375
{
11476
"conditions": [
11577
{
11678
"fn": "booleanEquals",
11779
"argv": [
80+
true,
11881
{
119-
"ref": "UseFIPS"
120-
},
121-
true
122-
]
123-
},
124-
{
125-
"fn": "booleanEquals",
126-
"argv": [
127-
{
128-
"ref": "UseDualStack"
129-
},
130-
true
131-
]
132-
}
133-
],
134-
"rules": [
135-
{
136-
"conditions": [
137-
{
138-
"fn": "booleanEquals",
82+
"fn": "getAttr",
13983
"argv": [
140-
true,
14184
{
142-
"fn": "getAttr",
143-
"argv": [
144-
{
145-
"ref": "PartitionResult"
146-
},
147-
"supportsFIPS"
148-
]
149-
}
150-
]
151-
},
152-
{
153-
"fn": "booleanEquals",
154-
"argv": [
155-
true,
156-
{
157-
"fn": "getAttr",
158-
"argv": [
159-
{
160-
"ref": "PartitionResult"
161-
},
162-
"supportsDualStack"
163-
]
164-
}
165-
]
166-
}
167-
],
168-
"rules": [
169-
{
170-
"conditions": [],
171-
"endpoint": {
172-
"url": "https://api.ecr-public-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
173-
"properties": {},
174-
"headers": {}
175-
},
176-
"type": "endpoint"
177-
}
178-
],
179-
"type": "tree"
180-
},
181-
{
182-
"conditions": [],
183-
"error": "FIPS and DualStack are enabled, but this partition does not support one or both",
184-
"type": "error"
185-
}
186-
],
187-
"type": "tree"
188-
},
189-
{
190-
"conditions": [
191-
{
192-
"fn": "booleanEquals",
193-
"argv": [
194-
{
195-
"ref": "UseFIPS"
196-
},
197-
true
198-
]
199-
}
200-
],
201-
"rules": [
202-
{
203-
"conditions": [
204-
{
205-
"fn": "booleanEquals",
206-
"argv": [
207-
{
208-
"fn": "getAttr",
209-
"argv": [
210-
{
211-
"ref": "PartitionResult"
212-
},
213-
"supportsFIPS"
214-
]
85+
"ref": "PartitionResult"
21586
},
216-
true
87+
"supportsDualStack"
21788
]
21889
}
219-
],
220-
"rules": [
221-
{
222-
"conditions": [],
223-
"endpoint": {
224-
"url": "https://api.ecr-public-fips.{Region}.{PartitionResult#dnsSuffix}",
225-
"properties": {},
226-
"headers": {}
227-
},
228-
"type": "endpoint"
229-
}
230-
],
231-
"type": "tree"
232-
},
233-
{
234-
"conditions": [],
235-
"error": "FIPS is enabled but this partition does not support FIPS",
236-
"type": "error"
237-
}
238-
],
239-
"type": "tree"
240-
},
241-
{
242-
"conditions": [
243-
{
244-
"fn": "booleanEquals",
245-
"argv": [
246-
{
247-
"ref": "UseDualStack"
248-
},
249-
true
25090
]
25191
}
25292
],
25393
"rules": [
254-
{
255-
"conditions": [
256-
{
257-
"fn": "booleanEquals",
258-
"argv": [
259-
true,
260-
{
261-
"fn": "getAttr",
262-
"argv": [
263-
{
264-
"ref": "PartitionResult"
265-
},
266-
"supportsDualStack"
267-
]
268-
}
269-
]
270-
}
271-
],
272-
"rules": [
273-
{
274-
"conditions": [],
275-
"endpoint": {
276-
"url": "https://api.ecr-public.{Region}.{PartitionResult#dualStackDnsSuffix}",
277-
"properties": {},
278-
"headers": {}
279-
},
280-
"type": "endpoint"
281-
}
282-
],
283-
"type": "tree"
284-
},
28594
{
28695
"conditions": [],
287-
"error": "DualStack is enabled but this partition does not support DualStack",
288-
"type": "error"
96+
"endpoint": {
97+
"url": "https://ecr-public.{Region}.{PartitionResult#dualStackDnsSuffix}",
98+
"properties": {},
99+
"headers": {}
100+
},
101+
"type": "endpoint"
289102
}
290103
],
291104
"type": "tree"
292105
},
293106
{
294107
"conditions": [],
295-
"endpoint": {
296-
"url": "https://api.ecr-public.{Region}.{PartitionResult#dnsSuffix}",
297-
"properties": {},
298-
"headers": {}
299-
},
300-
"type": "endpoint"
108+
"error": "Dualstack is enabled but this partition does not support dualstack",
109+
"type": "error"
301110
}
302111
],
303112
"type": "tree"
113+
},
114+
{
115+
"conditions": [],
116+
"endpoint": {
117+
"url": "https://api.ecr-public.{Region}.{PartitionResult#dnsSuffix}",
118+
"properties": {},
119+
"headers": {}
120+
},
121+
"type": "endpoint"
304122
}
305123
],
306124
"type": "tree"
307-
},
308-
{
309-
"conditions": [],
310-
"error": "Invalid Configuration: Missing Region",
311-
"type": "error"
312125
}
313126
]
314127
}

0 commit comments

Comments
 (0)