Skip to content

Commit

Permalink
docs(client-redshift): Documentation updates for Redshift API bringin…
Browse files Browse the repository at this point in the history
…g it in line with IAM best practices.
  • Loading branch information
awstools committed Feb 24, 2023
1 parent df945f5 commit a6b3275
Show file tree
Hide file tree
Showing 5 changed files with 399 additions and 359 deletions.
2 changes: 1 addition & 1 deletion clients/client-redshift/src/endpoint/EndpointParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = <T>(
};

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

const u="fn",
v="argv",
w="ref";
const a=true,
b=false,
c="String",
d="PartitionResult",
e="tree",
f="error",
g="endpoint",
h="getAttr",
i="stringEquals",
j={"required":true,"default":false,"type":"Boolean"},
k={[w]:"Region"},
l={[w]:"Endpoint"},
m={[u]:"booleanEquals",[v]:[{[w]:"UseFIPS"},true]},
n={[u]:"booleanEquals",[v]:[{[w]:"UseDualStack"},true]},
o={},
p={[u]:"booleanEquals",[v]:[true,{[u]:h,[v]:[{[w]:d},"supportsFIPS"]}]},
q={[w]:d},
r={[u]:"booleanEquals",[v]:[true,{[u]:h,[v]:[q,"supportsDualStack"]}]},
s=[m],
const u="required",
v="fn",
w="argv",
x="ref";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e="PartitionResult",
f="getAttr",
g="stringEquals",
h={[u]:false,"type":"String"},
i={[u]:true,"default":false,"type":"Boolean"},
j={[x]:"Endpoint"},
k={[v]:"booleanEquals",[w]:[{[x]:"UseFIPS"},true]},
l={[v]:"booleanEquals",[w]:[{[x]:"UseDualStack"},true]},
m={},
n={[x]:"Region"},
o={[v]:"booleanEquals",[w]:[true,{[v]:f,[w]:[{[x]:e},"supportsFIPS"]}]},
p={[x]:e},
q={[v]:"booleanEquals",[w]:[true,{[v]:f,[w]:[p,"supportsDualStack"]}]},
r=[k],
s=[l],
t=[n];
const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:j,UseFIPS:j,Endpoint:{required:b,type:c}},rules:[{conditions:[{[u]:"aws.partition",[v]:[k],assign:d}],type:e,rules:[{conditions:[{[u]:"isSet",[v]:[l]}],type:e,rules:[{conditions:s,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:t,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:l,properties:o,headers:o},type:g}]}]},{conditions:[m,n],type:e,rules:[{conditions:[p,r],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://redshift-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:o,headers:o},type:g}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:s,type:e,rules:[{conditions:[p],type:e,rules:[{type:e,rules:[{conditions:[{[u]:i,[v]:["aws-us-gov",{[u]:h,[v]:[q,"name"]}]}],endpoint:{url:"https://redshift.{Region}.amazonaws.com",properties:o,headers:o},type:g},{endpoint:{url:"https://redshift-fips.{Region}.{PartitionResult#dnsSuffix}",properties:o,headers:o},type:g}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:t,type:e,rules:[{conditions:[r],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://redshift.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:o,headers:o},type:g}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{type:e,rules:[{conditions:[{[u]:i,[v]:[k,"us-gov-east-1"]}],endpoint:{url:"https://redshift.us-gov-east-1.amazonaws.com",properties:o,headers:o},type:g},{conditions:[{[u]:i,[v]:[k,"us-gov-west-1"]}],endpoint:{url:"https://redshift.us-gov-west-1.amazonaws.com",properties:o,headers:o},type:g},{endpoint:{url:"https://redshift.{Region}.{PartitionResult#dnsSuffix}",properties:o,headers:o},type:g}]}]}]};
const _data={version:"1.0",parameters:{Region:h,UseDualStack:i,UseFIPS:i,Endpoint:h},rules:[{conditions:[{[v]:a,[w]:[j]}],type:b,rules:[{conditions:r,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:s,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:j,properties:m,headers:m},type:d}]}]},{type:b,rules:[{conditions:[{[v]:a,[w]:t}],type:b,rules:[{conditions:[{[v]:"aws.partition",[w]:t,assign:e}],type:b,rules:[{conditions:[k,l],type:b,rules:[{conditions:[o,q],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://redshift-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:r,type:b,rules:[{conditions:[o],type:b,rules:[{type:b,rules:[{conditions:[{[v]:g,[w]:["aws-us-gov",{[v]:f,[w]:[p,"name"]}]}],endpoint:{url:"https://redshift.{Region}.amazonaws.com",properties:m,headers:m},type:d},{endpoint:{url:"https://redshift-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:s,type:b,rules:[{conditions:[q],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://redshift.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{conditions:[{[v]:g,[w]:[n,"us-gov-east-1"]}],endpoint:{url:"https://redshift.us-gov-east-1.amazonaws.com",properties:m,headers:m},type:d},{conditions:[{[v]:g,[w]:[n,"us-gov-west-1"]}],endpoint:{url:"https://redshift.us-gov-west-1.amazonaws.com",properties:m,headers:m},type:d},{endpoint:{url:"https://redshift.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
export const ruleSet: RuleSetObject = _data;
12 changes: 6 additions & 6 deletions clients/client-redshift/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ export interface AuthorizeSnapshotAccessMessage {

/**
* <p>The identifier of the cluster the snapshot was created from. This parameter is
* required if your IAM user has a policy containing a snapshot resource element that
* required if your IAM user or role has a policy containing a snapshot resource element that
* specifies anything other than * for the cluster name.</p>
*/
SnapshotClusterIdentifier?: string;
Expand Down Expand Up @@ -1468,7 +1468,7 @@ export interface DeleteClusterSnapshotMessage {

/**
* <p>The unique identifier of the cluster the snapshot was created from. This parameter
* is required if your IAM user has a policy containing a snapshot resource element that
* is required if your IAM user or role has a policy containing a snapshot resource element that
* specifies anything other than * for the cluster name.</p>
* <p>Constraints: Must be the name of valid cluster.</p>
*/
Expand Down Expand Up @@ -3482,7 +3482,7 @@ export interface CopyClusterSnapshotMessage {

/**
* <p>The identifier of the cluster the source snapshot was created from. This parameter
* is required if your IAM user has a policy containing a snapshot resource element that
* is required if your IAM user or role has a policy containing a snapshot resource element that
* specifies anything other than * for the cluster name.</p>
* <p>Constraints:</p>
* <ul>
Expand Down Expand Up @@ -3687,7 +3687,7 @@ export interface CreateClusterMessage {
NodeType: string | undefined;

/**
* <p>The user name associated with the admin user account for the cluster that is being
* <p>The user name associated with the admin user for the cluster that is being
* created.</p>
* <p>Constraints:</p>
* <ul>
Expand All @@ -3713,7 +3713,7 @@ export interface CreateClusterMessage {
MasterUsername: string | undefined;

/**
* <p>The password associated with the admin user account for the cluster that is being
* <p>The password associated with the admin user for the cluster that is being
* created.</p>
* <p>Constraints:</p>
* <ul>
Expand Down Expand Up @@ -6791,7 +6791,7 @@ export interface DescribeClusterSnapshotsMessage {
* set of records by retrying the command with the returned marker value. </p>
* <p>Default: <code>100</code>
* </p>
* <p>Constraints: minimum 20, maximum 100.</p>
* <p>Constraints: minimum 20, maximum 500.</p>
*/
MaxRecords?: number;

Expand Down
6 changes: 3 additions & 3 deletions clients/client-redshift/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2084,7 +2084,7 @@ export interface ModifyClusterMessage {
* <code>PendingModifiedValues</code> element of the operation response. </p>
* <note>
* <p>Operations never return the password, so this operation provides a way to
* regain access to the admin user account for a cluster if the password is
* regain access to the admin user for a cluster if the password is
* lost.</p>
* </note>
* <p>Default: Uses existing setting.</p>
Expand Down Expand Up @@ -2932,7 +2932,7 @@ export interface RestoreFromClusterSnapshotMessage {

/**
* <p>The name of the cluster the source snapshot was created from. This parameter is
* required if your IAM user has a policy containing a snapshot resource element that
* required if your IAM user or role has a policy containing a snapshot resource element that
* specifies anything other than * for the cluster name.</p>
*/
SnapshotClusterIdentifier?: string;
Expand Down Expand Up @@ -3324,7 +3324,7 @@ export interface RevokeSnapshotAccessMessage {

/**
* <p>The identifier of the cluster the snapshot was created from. This parameter is
* required if your IAM user has a policy containing a snapshot resource element that
* required if your IAM user or role has a policy containing a snapshot resource element that
* specifies anything other than * for the cluster name.</p>
*/
SnapshotClusterIdentifier?: string;
Expand Down

0 comments on commit a6b3275

Please sign in to comment.