Skip to content

Commit 239ccb6

Browse files
author
awstools
committed
feat(client-marketplace-entitlement-service): Add support for Marketplace Entitlement Service dual-stack endpoints for CN and GOV regions
1 parent 82bdb1c commit 239ccb6

File tree

2 files changed

+62
-17
lines changed

2 files changed

+62
-17
lines changed

clients/client-marketplace-entitlement-service/src/endpoint/ruleset.ts

Lines changed: 18 additions & 16 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-entitlement-service.json */
88

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

codegen/sdk-codegen/aws-models/marketplace-entitlement-service.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,49 @@
259259
},
260260
"type": "endpoint"
261261
},
262+
{
263+
"conditions": [
264+
{
265+
"fn": "stringEquals",
266+
"argv": [
267+
{
268+
"fn": "getAttr",
269+
"argv": [
270+
{
271+
"ref": "PartitionResult"
272+
},
273+
"name"
274+
]
275+
},
276+
"aws-cn"
277+
]
278+
},
279+
{
280+
"fn": "booleanEquals",
281+
"argv": [
282+
{
283+
"ref": "UseFIPS"
284+
},
285+
false
286+
]
287+
},
288+
{
289+
"fn": "booleanEquals",
290+
"argv": [
291+
{
292+
"ref": "UseDualStack"
293+
},
294+
true
295+
]
296+
}
297+
],
298+
"endpoint": {
299+
"url": "https://entitlement-marketplace.{Region}.{PartitionResult#dualStackDnsSuffix}",
300+
"properties": {},
301+
"headers": {}
302+
},
303+
"type": "endpoint"
304+
},
262305
{
263306
"conditions": [
264307
{
@@ -599,7 +642,7 @@
599642
"documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled",
600643
"expect": {
601644
"endpoint": {
602-
"url": "https://entitlement.marketplace.cn-northwest-1.api.amazonwebservices.com.cn"
645+
"url": "https://entitlement-marketplace.cn-northwest-1.api.amazonwebservices.com.cn"
603646
}
604647
},
605648
"params": {

0 commit comments

Comments
 (0)