Skip to content

Commit 088694d

Browse files
author
awstools
committed
feat(client-marketplace-metering): Add support for Marketplace Metering Service dual-stack endpoints for CN regions
1 parent 73b26af commit 088694d

File tree

2 files changed

+106
-19
lines changed

2 files changed

+106
-19
lines changed

clients/client-marketplace-metering/src/endpoint/ruleset.ts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { RuleSetObject } from "@smithy/types";
66
or see "smithy.rules#endpointRuleSet"
77
in codegen/sdk-codegen/aws-models/marketplace-metering.json */
88

9-
const v="required",
10-
w="fn",
11-
x="argv",
12-
y="ref";
9+
const w="required",
10+
x="fn",
11+
y="argv",
12+
z="ref";
1313
const a=true,
1414
b=false,
1515
c="isSet",
@@ -18,18 +18,19 @@ e="error",
1818
f="endpoint",
1919
g="tree",
2020
h="PartitionResult",
21-
i="getAttr",
22-
j={[v]:true,"default":false,"type":"Boolean"},
23-
k={[v]:false,"type":"String"},
24-
l={[y]:"Endpoint"},
25-
m={[w]:d,[x]:[{[y]:"UseFIPS"},true]},
26-
n={[w]:d,[x]:[{[y]:"UseDualStack"},true]},
27-
o={[y]:"UseDualStack"},
21+
i="stringEquals",
22+
j={[w]:true,"default":false,"type":"Boolean"},
23+
k={[w]:false,"type":"String"},
24+
l={[z]:"Endpoint"},
25+
m={[x]:d,[y]:[{[z]:"UseFIPS"},true]},
26+
n={[x]:d,[y]:[{[z]:"UseDualStack"},true]},
27+
o={[z]:"UseDualStack"},
2828
p={},
29-
q={[y]:h},
30-
r={[w]:d,[x]:[{[y]:"UseFIPS"},false]},
31-
s={[w]:i,[x]:[q,"supportsFIPS"]},
32-
t={[w]:d,[x]:[true,{[w]:i,[x]:[q,"supportsDualStack"]}]},
33-
u=[{[y]:"Region"}];
34-
const _data={version:"1.0",parameters:{UseDualStack:j,UseFIPS:j,Endpoint:k,Region:k},rules:[{conditions:[{[w]:c,[x]:[l]}],rules:[{conditions:[m],error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:e},{rules:[{conditions:[n],error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:e},{endpoint:{url:l,properties:p,headers:p},type:f}],type:g}],type:g},{rules:[{conditions:[{[w]:c,[x]:u}],rules:[{conditions:[{[w]:"aws.partition",[x]:u,assign:h}],rules:[{conditions:[{[w]:"stringEquals",[x]:[{[w]:i,[x]:[q,"name"]},"aws"]},r,n],endpoint:{url:"https://metering-marketplace.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:p,headers:p},type:f},{conditions:[m,n],rules:[{conditions:[{[w]:d,[x]:[a,s]},t],rules:[{endpoint:{url:"https://metering.marketplace-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:p,headers:p},type:f}],type:g},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:e}],type:g},{conditions:[m,{[w]:d,[x]:[o,b]}],rules:[{conditions:[{[w]:d,[x]:[s,a]}],rules:[{endpoint:{url:"https://metering.marketplace-fips.{Region}.{PartitionResult#dnsSuffix}",properties:p,headers:p},type:f}],type:g},{error:"FIPS is enabled but this partition does not support FIPS",type:e}],type:g},{conditions:[r,n],rules:[{conditions:[t],rules:[{endpoint:{url:"https://metering.marketplace.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:p,headers:p},type:f}],type:g},{error:"DualStack is enabled but this partition does not support DualStack",type:e}],type:g},{endpoint:{url:"https://metering.marketplace.{Region}.{PartitionResult#dnsSuffix}",properties:p,headers:p},type:f}],type:g}],type:g},{error:"Invalid Configuration: Missing Region",type:e}],type:g}]};
29+
q={[x]:"getAttr",[y]:[{[z]:h},"name"]},
30+
r={[x]:d,[y]:[{[z]:"UseFIPS"},false]},
31+
s={"url":"https://metering-marketplace.{Region}.{PartitionResult#dualStackDnsSuffix}","properties":{},"headers":{}},
32+
t={[x]:"getAttr",[y]:[{[z]:h},"supportsFIPS"]},
33+
u={[x]:d,[y]:[true,{[x]:"getAttr",[y]:[{[z]:h},"supportsDualStack"]}]},
34+
v=[{[z]:"Region"}];
35+
const _data={version:"1.0",parameters:{UseDualStack:j,UseFIPS:j,Endpoint:k,Region:k},rules:[{conditions:[{[x]:c,[y]:[l]}],rules:[{conditions:[m],error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:e},{rules:[{conditions:[n],error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:e},{endpoint:{url:l,properties:p,headers:p},type:f}],type:g}],type:g},{rules:[{conditions:[{[x]:c,[y]:v}],rules:[{conditions:[{[x]:"aws.partition",[y]:v,assign:h}],rules:[{conditions:[{[x]:i,[y]:[q,"aws"]},r,n],endpoint:s,type:f},{conditions:[{[x]:i,[y]:[q,"aws-cn"]},r,n],endpoint:s,type:f},{conditions:[{[x]:i,[y]:[q,"aws-us-gov"]},r,n],endpoint:s,type:f},{conditions:[m,n],rules:[{conditions:[{[x]:d,[y]:[a,t]},u],rules:[{endpoint:{url:"https://metering.marketplace-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:p,headers:p},type:f}],type:g},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:e}],type:g},{conditions:[m,{[x]:d,[y]:[o,b]}],rules:[{conditions:[{[x]:d,[y]:[t,a]}],rules:[{endpoint:{url:"https://metering.marketplace-fips.{Region}.{PartitionResult#dnsSuffix}",properties:p,headers:p},type:f}],type:g},{error:"FIPS is enabled but this partition does not support FIPS",type:e}],type:g},{conditions:[r,n],rules:[{conditions:[u],rules:[{endpoint:{url:"https://metering.marketplace.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:p,headers:p},type:f}],type:g},{error:"DualStack is enabled but this partition does not support DualStack",type:e}],type:g},{endpoint:{url:"https://metering.marketplace.{Region}.{PartitionResult#dnsSuffix}",properties:p,headers:p},type:f}],type:g}],type:g},{error:"Invalid Configuration: Missing Region",type:e}],type:g}]};
3536
export const ruleSet: RuleSetObject = _data;

codegen/sdk-codegen/aws-models/marketplace-metering.json

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,92 @@
225225
},
226226
"type": "endpoint"
227227
},
228+
{
229+
"conditions": [
230+
{
231+
"fn": "stringEquals",
232+
"argv": [
233+
{
234+
"fn": "getAttr",
235+
"argv": [
236+
{
237+
"ref": "PartitionResult"
238+
},
239+
"name"
240+
]
241+
},
242+
"aws-cn"
243+
]
244+
},
245+
{
246+
"fn": "booleanEquals",
247+
"argv": [
248+
{
249+
"ref": "UseFIPS"
250+
},
251+
false
252+
]
253+
},
254+
{
255+
"fn": "booleanEquals",
256+
"argv": [
257+
{
258+
"ref": "UseDualStack"
259+
},
260+
true
261+
]
262+
}
263+
],
264+
"endpoint": {
265+
"url": "https://metering-marketplace.{Region}.{PartitionResult#dualStackDnsSuffix}",
266+
"properties": {},
267+
"headers": {}
268+
},
269+
"type": "endpoint"
270+
},
271+
{
272+
"conditions": [
273+
{
274+
"fn": "stringEquals",
275+
"argv": [
276+
{
277+
"fn": "getAttr",
278+
"argv": [
279+
{
280+
"ref": "PartitionResult"
281+
},
282+
"name"
283+
]
284+
},
285+
"aws-us-gov"
286+
]
287+
},
288+
{
289+
"fn": "booleanEquals",
290+
"argv": [
291+
{
292+
"ref": "UseFIPS"
293+
},
294+
false
295+
]
296+
},
297+
{
298+
"fn": "booleanEquals",
299+
"argv": [
300+
{
301+
"ref": "UseDualStack"
302+
},
303+
true
304+
]
305+
}
306+
],
307+
"endpoint": {
308+
"url": "https://metering-marketplace.{Region}.{PartitionResult#dualStackDnsSuffix}",
309+
"properties": {},
310+
"headers": {}
311+
},
312+
"type": "endpoint"
313+
},
228314
{
229315
"conditions": [
230316
{
@@ -565,7 +651,7 @@
565651
"documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled",
566652
"expect": {
567653
"endpoint": {
568-
"url": "https://metering.marketplace.cn-northwest-1.api.amazonwebservices.com.cn"
654+
"url": "https://metering-marketplace.cn-northwest-1.api.amazonwebservices.com.cn"
569655
}
570656
},
571657
"params": {
@@ -617,7 +703,7 @@
617703
"documentation": "For region us-gov-west-1 with FIPS disabled and DualStack enabled",
618704
"expect": {
619705
"endpoint": {
620-
"url": "https://metering.marketplace.us-gov-west-1.api.aws"
706+
"url": "https://metering-marketplace.us-gov-west-1.api.aws"
621707
}
622708
},
623709
"params": {

0 commit comments

Comments
 (0)