Skip to content

Commit

Permalink
feat(client-iotsecuretunneling): Adds dualstack endpoint support for …
Browse files Browse the repository at this point in the history
…IoT Secure Tunneling
  • Loading branch information
awstools committed Jan 6, 2025
1 parent 0cdf2e3 commit 513f9c4
Show file tree
Hide file tree
Showing 2 changed files with 561 additions and 66 deletions.
37 changes: 22 additions & 15 deletions clients/client-iotsecuretunneling/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,34 @@ import { RuleSetObject } from "@smithy/types";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/iotsecuretunneling.json */

const s="required",
t="fn",
u="argv",
v="ref";
const x="required",
y="fn",
z="argv",
A="ref",
B="properties",
C="headers";
const a=true,
b="isSet",
c="booleanEquals",
d="error",
e="endpoint",
f="tree",
g="PartitionResult",
h={[s]:false,"type":"String"},
i={[s]:true,"default":false,"type":"Boolean"},
j={[v]:"Endpoint"},
k={[t]:c,[u]:[{[v]:"UseFIPS"},true]},
l={[t]:c,[u]:[{[v]:"UseDualStack"},true]},
h={[x]:false,"type":"String"},
i={[x]:true,"default":false,"type":"Boolean"},
j={[A]:"Endpoint"},
k={[y]:c,[z]:[{[A]:"UseFIPS"},true]},
l={[y]:c,[z]:[{[A]:"UseDualStack"},true]},
m={},
n={[t]:"getAttr",[u]:[{[v]:g},"supportsFIPS"]},
o={[t]:c,[u]:[true,{[t]:"getAttr",[u]:[{[v]:g},"supportsDualStack"]}]},
p=[k],
q=[l],
r=[{[v]:"Region"}];
const _data={version:"1.0",parameters:{Region:h,UseDualStack:i,UseFIPS:i,Endpoint:h},rules:[{conditions:[{[t]:b,[u]:[j]}],rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:d},{endpoint:{url:j,properties:m,headers:m},type:e}],type:f},{conditions:[{[t]:b,[u]:r}],rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:g}],rules:[{conditions:[k,l],rules:[{conditions:[{[t]:c,[u]:[a,n]},o],rules:[{endpoint:{url:"https://api.tunneling.iot-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:d}],type:f},{conditions:p,rules:[{conditions:[{[t]:c,[u]:[n,a]}],rules:[{endpoint:{url:"https://api.tunneling.iot-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:d}],type:f},{conditions:q,rules:[{conditions:[o],rules:[{endpoint:{url:"https://api.tunneling.iot.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:d}],type:f},{endpoint:{url:"https://api.tunneling.iot.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}]};
n={[y]:"getAttr",[z]:[{[A]:g},"supportsFIPS"]},
o={[y]:c,[z]:[true,{[y]:"getAttr",[z]:[{[A]:g},"supportsDualStack"]}]},
p={"url":"https://api.iot-tunneling-fips.{Region}.api.aws",[B]:{},[C]:{}},
q={"url":"https://api.iot-tunneling.{Region}.api.aws",[B]:{},[C]:{}},
r=[k],
s=[l],
t=[{[A]:"Region"}],
u=[{[y]:"stringEquals",[z]:["aws",{[y]:"getAttr",[z]:[{[A]:g},"name"]}]}],
v=[{[y]:"stringEquals",[z]:["aws-cn",{[y]:"getAttr",[z]:[{[A]:g},"name"]}]}],
w=[{[y]:"stringEquals",[z]:["aws-us-gov",{[y]:"getAttr",[z]:[{[A]:g},"name"]}]}];
const _data={version:"1.0",parameters:{Region:h,UseDualStack:i,UseFIPS:i,Endpoint:h},rules:[{conditions:[{[y]:b,[z]:[j]}],rules:[{conditions:r,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{conditions:s,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:d},{endpoint:{url:j,[B]:m,[C]:m},type:e}],type:f},{conditions:[{[y]:b,[z]:t}],rules:[{conditions:[{[y]:"aws.partition",[z]:t,assign:g}],rules:[{conditions:[k,l],rules:[{conditions:[{[y]:c,[z]:[a,n]},o],rules:[{conditions:u,endpoint:p,type:e},{conditions:v,endpoint:{url:"https://api.iot-tunneling-fips.{Region}.api.amazonwebservices.com.cn",[B]:m,[C]:m},type:e},{conditions:w,endpoint:p,type:e},{endpoint:{url:"https://api.tunneling.iot-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",[B]:m,[C]:m},type:e}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:d}],type:f},{conditions:r,rules:[{conditions:[{[y]:c,[z]:[n,a]}],rules:[{endpoint:{url:"https://api.tunneling.iot-fips.{Region}.{PartitionResult#dnsSuffix}",[B]:m,[C]:m},type:e}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:d}],type:f},{conditions:s,rules:[{conditions:[o],rules:[{conditions:u,endpoint:q,type:e},{conditions:v,endpoint:{url:"https://api.iot-tunneling.{Region}.api.amazonwebservices.com.cn",[B]:m,[C]:m},type:e},{conditions:w,endpoint:q,type:e},{endpoint:{url:"https://api.tunneling.iot.{Region}.{PartitionResult#dualStackDnsSuffix}",[B]:m,[C]:m},type:e}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:d}],type:f},{endpoint:{url:"https://api.tunneling.iot.{Region}.{PartitionResult#dnsSuffix}",[B]:m,[C]:m},type:e}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}]};
export const ruleSet: RuleSetObject = _data;
Loading

0 comments on commit 513f9c4

Please sign in to comment.