Skip to content

Commit

Permalink
feat(client-resource-explorer-2): Resource Explorer now uses newly su…
Browse files Browse the repository at this point in the history
…pported IPv4 'amazonaws.com' endpoints by default.
  • Loading branch information
awstools committed Feb 13, 2024
1 parent 4004ff6 commit 28a14d4
Show file tree
Hide file tree
Showing 3 changed files with 342 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provi
*/
export interface ClientInputEndpointParameters {
region?: string | Provider<string>;
useDualstackEndpoint?: boolean | Provider<boolean>;
useFipsEndpoint?: boolean | Provider<boolean>;
endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;
}
Expand All @@ -19,6 +20,7 @@ export const resolveClientEndpointParameters = <T>(
): T & ClientResolvedEndpointParameters => {
return {
...options,
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
useFipsEndpoint: options.useFipsEndpoint ?? false,
defaultSigningName: "resource-explorer-2",
};
Expand All @@ -28,10 +30,12 @@ export const commonParams = {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
} as const;

export interface EndpointParameters extends __EndpointParameters {
Region?: string;
UseDualStack?: boolean;
UseFIPS?: boolean;
Endpoint?: string;
}
43 changes: 23 additions & 20 deletions clients/client-resource-explorer-2/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,27 @@ import { RuleSetObject } from "@smithy/types";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/resource-explorer-2.json */

const r="argv",
s="ref";
const a=false,
b=true,
c="isSet",
d="booleanEquals",
e="error",
f="endpoint",
g="tree",
h="PartitionResult",
i="getAttr",
j={"required":false,"type":"String"},
k={[s]:"Endpoint"},
l={},
m={[s]:h},
n={[e]:"FIPS is enabled but this partition does not support FIPS","type":e},
o=[{"fn":d,[r]:[{[s]:"UseFIPS"},true]}],
p=[{[s]:"Region"}],
q=[{"fn":d,[r]:[{"fn":i,[r]:[m,"supportsFIPS"]},true]}];
const _data={version:"1.0",parameters:{Region:j,UseFIPS:{required:b,default:a,type:"Boolean"},Endpoint:j},rules:[{conditions:[{fn:c,[r]:[k]}],rules:[{conditions:o,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:e},{endpoint:{url:k,properties:l,headers:l},type:f}],type:g},{conditions:[{fn:c,[r]:p}],rules:[{conditions:[{fn:"aws.partition",[r]:p,assign:h}],rules:[{conditions:[{fn:d,[r]:[b,{fn:i,[r]:[m,"supportsDualStack"]}]}],rules:[{conditions:o,rules:[{conditions:q,rules:[{endpoint:{url:"https://resource-explorer-2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:f}],type:g},n],type:g},{endpoint:{url:"https://resource-explorer-2.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:f}],type:g},{conditions:o,rules:[{conditions:q,rules:[{endpoint:{url:"https://resource-explorer-2-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:f}],type:g},n],type:g},{endpoint:{url:"https://resource-explorer-2.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:f}],type:g}],type:g},{error:"Invalid Configuration: Missing Region",type:e}]};
const s="required",
t="fn",
u="argv",
v="ref";
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]},
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://resource-explorer-2-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://resource-explorer-2-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://resource-explorer-2.{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://resource-explorer-2.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}]};
export const ruleSet: RuleSetObject = _data;
Loading

0 comments on commit 28a14d4

Please sign in to comment.