Skip to content

Commit 575cc28

Browse files
author
AWS
committed
AWS Savings Plans Update: Add dual-stack endpoint support for Savings Plans
1 parent f25803a commit 575cc28

File tree

3 files changed

+241
-19
lines changed

3 files changed

+241
-19
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": "AWS Savings Plans",
4+
"contributor": "",
5+
"description": "Add dual-stack endpoint support for Savings Plans"
6+
}

services/savingsplans/src/main/resources/codegen-resources/endpoint-rule-set.json

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,168 @@
2929
}
3030
},
3131
"rules": [
32+
{
33+
"conditions": [
34+
{
35+
"fn": "not",
36+
"argv": [
37+
{
38+
"fn": "isSet",
39+
"argv": [
40+
{
41+
"ref": "Endpoint"
42+
}
43+
]
44+
}
45+
]
46+
},
47+
{
48+
"fn": "booleanEquals",
49+
"argv": [
50+
{
51+
"ref": "UseFIPS"
52+
},
53+
false
54+
]
55+
},
56+
{
57+
"fn": "booleanEquals",
58+
"argv": [
59+
{
60+
"ref": "UseDualStack"
61+
},
62+
true
63+
]
64+
}
65+
],
66+
"rules": [
67+
{
68+
"conditions": [
69+
{
70+
"fn": "isSet",
71+
"argv": [
72+
{
73+
"ref": "Region"
74+
}
75+
]
76+
},
77+
{
78+
"fn": "aws.partition",
79+
"argv": [
80+
{
81+
"ref": "Region"
82+
}
83+
],
84+
"assign": "PartitionResult"
85+
}
86+
],
87+
"rules": [
88+
{
89+
"conditions": [
90+
{
91+
"fn": "stringEquals",
92+
"argv": [
93+
{
94+
"fn": "getAttr",
95+
"argv": [
96+
{
97+
"ref": "PartitionResult"
98+
},
99+
"name"
100+
]
101+
},
102+
"aws"
103+
]
104+
}
105+
],
106+
"endpoint": {
107+
"url": "https://savingsplans.global.api.aws",
108+
"properties": {
109+
"authSchemes": [
110+
{
111+
"name": "sigv4",
112+
"signingName": "savingsplans",
113+
"signingRegion": "us-east-1"
114+
}
115+
]
116+
},
117+
"headers": {}
118+
},
119+
"type": "endpoint"
120+
},
121+
{
122+
"conditions": [
123+
{
124+
"fn": "booleanEquals",
125+
"argv": [
126+
{
127+
"fn": "getAttr",
128+
"argv": [
129+
{
130+
"ref": "PartitionResult"
131+
},
132+
"supportsDualStack"
133+
]
134+
},
135+
true
136+
]
137+
}
138+
],
139+
"rules": [
140+
{
141+
"conditions": [],
142+
"endpoint": {
143+
"url": "https://savingsplans.{Region}.{PartitionResult#dualStackDnsSuffix}",
144+
"properties": {},
145+
"headers": {}
146+
},
147+
"type": "endpoint"
148+
}
149+
],
150+
"type": "tree"
151+
},
152+
{
153+
"conditions": [],
154+
"error": "DualStack is enabled but this partition does not support DualStack",
155+
"type": "error"
156+
}
157+
],
158+
"type": "tree"
159+
},
160+
{
161+
"conditions": [
162+
{
163+
"fn": "not",
164+
"argv": [
165+
{
166+
"fn": "isSet",
167+
"argv": [
168+
{
169+
"ref": "Region"
170+
}
171+
]
172+
}
173+
]
174+
}
175+
],
176+
"endpoint": {
177+
"url": "https://savingsplans.global.api.aws",
178+
"properties": {
179+
"authSchemes": [
180+
{
181+
"name": "sigv4",
182+
"signingName": "savingsplans",
183+
"signingRegion": "us-east-1"
184+
}
185+
]
186+
},
187+
"headers": {}
188+
},
189+
"type": "endpoint"
190+
}
191+
],
192+
"type": "tree"
193+
},
32194
{
33195
"conditions": [
34196
{

services/savingsplans/src/main/resources/codegen-resources/endpoint-tests.json

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,6 @@
4848
"UseDualStack": false
4949
}
5050
},
51-
{
52-
"documentation": "For region us-east-1 with FIPS disabled and DualStack enabled",
53-
"expect": {
54-
"endpoint": {
55-
"url": "https://savingsplans.us-east-1.api.aws"
56-
}
57-
},
58-
"params": {
59-
"Region": "us-east-1",
60-
"UseFIPS": false,
61-
"UseDualStack": true
62-
}
63-
},
6451
{
6552
"documentation": "For region us-east-1 with FIPS disabled and DualStack disabled",
6653
"expect": {
@@ -279,21 +266,88 @@
279266
}
280267
},
281268
{
282-
"documentation": "For custom endpoint with fips disabled and dualstack enabled",
269+
"documentation": "Missing region",
270+
"expect": {
271+
"error": "Invalid Configuration: Missing Region"
272+
}
273+
},
274+
{
275+
"documentation": "For region not set with FIPS disabled and DualStack enabled",
283276
"expect": {
284-
"error": "Invalid Configuration: Dualstack and custom endpoint are not supported"
277+
"endpoint": {
278+
"properties": {
279+
"authSchemes": [
280+
{
281+
"name": "sigv4",
282+
"signingName": "savingsplans",
283+
"signingRegion": "us-east-1"
284+
}
285+
]
286+
},
287+
"url": "https://savingsplans.global.api.aws"
288+
}
289+
},
290+
"params": {
291+
"UseDualStack": true,
292+
"UseFIPS": false
293+
}
294+
},
295+
{
296+
"documentation": "For region us-east-1 with FIPS disabled and DualStack enabled",
297+
"expect": {
298+
"endpoint": {
299+
"properties": {
300+
"authSchemes": [
301+
{
302+
"name": "sigv4",
303+
"signingName": "savingsplans",
304+
"signingRegion": "us-east-1"
305+
}
306+
]
307+
},
308+
"url": "https://savingsplans.global.api.aws"
309+
}
285310
},
286311
"params": {
287312
"Region": "us-east-1",
288-
"UseFIPS": false,
289313
"UseDualStack": true,
290-
"Endpoint": "https://example.com"
314+
"UseFIPS": false
291315
}
292316
},
293317
{
294-
"documentation": "Missing region",
318+
"documentation": "For region us-west-1 with FIPS disabled and DualStack enabled",
295319
"expect": {
296-
"error": "Invalid Configuration: Missing Region"
320+
"endpoint": {
321+
"properties": {
322+
"authSchemes": [
323+
{
324+
"name": "sigv4",
325+
"signingName": "savingsplans",
326+
"signingRegion": "us-east-1"
327+
}
328+
]
329+
},
330+
"url": "https://savingsplans.global.api.aws"
331+
}
332+
},
333+
"params": {
334+
"Region": "us-west-1",
335+
"UseDualStack": true,
336+
"UseFIPS": false
337+
}
338+
},
339+
{
340+
"documentation": "Commercial region with custom SDK endpoint",
341+
"expect": {
342+
"endpoint": {
343+
"url": "https://custom.example.com"
344+
}
345+
},
346+
"params": {
347+
"Region": "us-east-1",
348+
"UseDualStack": false,
349+
"UseFIPS": false,
350+
"Endpoint": "https://custom.example.com"
297351
}
298352
}
299353
],

0 commit comments

Comments
 (0)