Skip to content

Commit 2df9c49

Browse files
author
awstools
committed
feat(client-pi): Performance Insights added a new input parameter called AuthorizedActions to support the fine-grained access feature. Performance Insights also restricted the acceptable input characters.
1 parent 1312268 commit 2df9c49

File tree

6 files changed

+105
-23
lines changed

6 files changed

+105
-23
lines changed

clients/client-pi/src/commands/DescribeDimensionKeysCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export interface DescribeDimensionKeysCommandOutput extends DescribeDimensionKey
4848
* PeriodInSeconds: Number("int"),
4949
* GroupBy: { // DimensionGroup
5050
* Group: "STRING_VALUE", // required
51-
* Dimensions: [ // RequestStringList
51+
* Dimensions: [ // SanitizedStringList
5252
* "STRING_VALUE",
5353
* ],
5454
* Limit: Number("int"),

clients/client-pi/src/commands/GetResourceMetricsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export interface GetResourceMetricsCommandOutput extends GetResourceMetricsRespo
4848
* Metric: "STRING_VALUE", // required
4949
* GroupBy: { // DimensionGroup
5050
* Group: "STRING_VALUE", // required
51-
* Dimensions: [ // RequestStringList
51+
* Dimensions: [ // SanitizedStringList
5252
* "STRING_VALUE",
5353
* ],
5454
* Limit: Number("int"),

clients/client-pi/src/commands/ListAvailableResourceDimensionsCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ export interface ListAvailableResourceDimensionsCommandOutput
4747
* ],
4848
* MaxResults: Number("int"),
4949
* NextToken: "STRING_VALUE",
50+
* AuthorizedActions: [ // AuthorizedActionsList
51+
* "DescribeDimensionKeys" || "GetDimensionKeyDetails" || "GetResourceMetrics",
52+
* ],
5053
* };
5154
* const command = new ListAvailableResourceDimensionsCommand(input);
5255
* const response = await client.send(command);

clients/client-pi/src/models/models_0.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,21 @@ export interface AnalysisReportSummary {
208208
Tags?: Tag[];
209209
}
210210

211+
/**
212+
* @public
213+
* @enum
214+
*/
215+
export const FineGrainedAction = {
216+
DESCRIBE_DIMENSION_KEYS: "DescribeDimensionKeys",
217+
GET_DIMENSION_KEY_DETAILS: "GetDimensionKeyDetails",
218+
GET_RESOURCE_METRICS: "GetResourceMetrics",
219+
} as const;
220+
221+
/**
222+
* @public
223+
*/
224+
export type FineGrainedAction = (typeof FineGrainedAction)[keyof typeof FineGrainedAction];
225+
211226
/**
212227
* @public
213228
*/
@@ -1578,6 +1593,15 @@ export interface ListAvailableResourceDimensionsRequest {
15781593
* @public
15791594
*/
15801595
NextToken?: string;
1596+
1597+
/**
1598+
* <p>The actions to discover the dimensions you are authorized to access. If you specify multiple actions, then the response will
1599+
* contain the dimensions common for all the actions.</p>
1600+
* <p>When you don't specify this request parameter or provide an empty list, the response contains all the
1601+
* available dimensions for the target database engine whether or not you are authorized to access them.</p>
1602+
* @public
1603+
*/
1604+
AuthorizedActions?: FineGrainedAction[];
15811605
}
15821606

15831607
/**

clients/client-pi/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import {
7474
DescribeDimensionKeysResponse,
7575
DimensionGroup,
7676
DimensionKeyDescription,
77+
FineGrainedAction,
7778
GetDimensionKeyDetailsRequest,
7879
GetPerformanceAnalysisReportRequest,
7980
GetPerformanceAnalysisReportResponse,
@@ -606,6 +607,8 @@ const de_NotAuthorizedExceptionRes = async (
606607

607608
// se_AdditionalMetricsList omitted.
608609

610+
// se_AuthorizedActionsList omitted.
611+
609612
/**
610613
* serializeAws_json1_1CreatePerformanceAnalysisReportRequest
611614
*/
@@ -689,7 +692,7 @@ const se_GetResourceMetricsRequest = (input: GetResourceMetricsRequest, context:
689692

690693
// se_RequestedDimensionList omitted.
691694

692-
// se_RequestStringList omitted.
695+
// se_SanitizedStringList omitted.
693696

694697
// se_Tag omitted.
695698

codegen/sdk-codegen/aws-models/pi.json

Lines changed: 72 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"com.amazonaws.pi#AdditionalMetricsList": {
4444
"type": "list",
4545
"member": {
46-
"target": "com.amazonaws.pi#RequestString"
46+
"target": "com.amazonaws.pi#SanitizedString"
4747
},
4848
"traits": {
4949
"smithy.api#length": {
@@ -211,6 +211,18 @@
211211
}
212212
}
213213
},
214+
"com.amazonaws.pi#AuthorizedActionsList": {
215+
"type": "list",
216+
"member": {
217+
"target": "com.amazonaws.pi#FineGrainedAction"
218+
},
219+
"traits": {
220+
"smithy.api#length": {
221+
"min": 0,
222+
"max": 3
223+
}
224+
}
225+
},
214226
"com.amazonaws.pi#Boolean": {
215227
"type": "boolean"
216228
},
@@ -644,14 +656,14 @@
644656
"type": "structure",
645657
"members": {
646658
"Group": {
647-
"target": "com.amazonaws.pi#RequestString",
659+
"target": "com.amazonaws.pi#SanitizedString",
648660
"traits": {
649661
"smithy.api#documentation": "<p>The name of the dimension group. Valid values are as follows:</p>\n <ul>\n <li>\n <p>\n <code>db</code> - The name of the database to which the client is connected. The following values are permitted:</p>\n <ul>\n <li>\n <p>Aurora PostgreSQL</p>\n </li>\n <li>\n <p>Amazon RDS PostgreSQL</p>\n </li>\n <li>\n <p>Aurora MySQL</p>\n </li>\n <li>\n <p>Amazon RDS MySQL</p>\n </li>\n <li>\n <p>Amazon RDS MariaDB</p>\n </li>\n <li>\n <p>Amazon DocumentDB</p>\n </li>\n </ul>\n </li>\n <li>\n <p>\n <code>db.application</code> - The name of the application that is connected to the database. The following values are\n permitted:</p>\n <ul>\n <li>\n <p>Aurora PostgreSQL</p>\n </li>\n <li>\n <p>Amazon RDS PostgreSQL</p>\n </li>\n <li>\n <p>Amazon DocumentDB</p>\n </li>\n </ul>\n </li>\n <li>\n <p>\n <code>db.host</code> - The host name of the connected client (all engines).</p>\n </li>\n <li>\n <p>\n <code>db.query</code> - The query that is currently running (only Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.query_tokenized</code> - The digest query (only Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.session_type</code> - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL).</p>\n </li>\n <li>\n <p>\n <code>db.sql</code> - The text of the SQL statement that is currently running (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.sql_tokenized</code> - The SQL digest (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.user</code> - The user logged in to the database (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.wait_event</code> - The event for which the database backend is waiting (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.wait_event_type</code> - The type of event for which the database backend is waiting (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.wait_state</code> - The event for which the database backend is waiting (only Amazon DocumentDB).</p>\n </li>\n </ul>",
650662
"smithy.api#required": {}
651663
}
652664
},
653665
"Dimensions": {
654-
"target": "com.amazonaws.pi#RequestStringList",
666+
"target": "com.amazonaws.pi#SanitizedStringList",
655667
"traits": {
656668
"smithy.api#documentation": "<p>A list of specific dimensions from a dimension group. If this parameter is not present,\n then it signifies that all of the dimensions in the group were requested, or are present in\n the response.</p>\n <p>Valid values for elements in the <code>Dimensions</code> array are:</p>\n <ul>\n <li>\n <p>\n <code>db.application.name</code> - The name of the application that is connected to the database. Valid values are as follows: </p>\n <ul>\n <li>\n <p>Aurora PostgreSQL</p>\n </li>\n <li>\n <p>Amazon RDS PostgreSQL</p>\n </li>\n <li>\n <p>Amazon DocumentDB</p>\n </li>\n </ul>\n </li>\n <li>\n <p>\n <code>db.host.id</code> - The host ID of the connected client (all engines).</p>\n </li>\n <li>\n <p>\n <code>db.host.name</code> - The host name of the connected client (all engines).</p>\n </li>\n <li>\n <p>\n <code>db.name</code> - The name of the database to which the client is connected. Valid values are as follows:</p>\n <ul>\n <li>\n <p>Aurora PostgreSQL</p>\n </li>\n <li>\n <p>Amazon RDS PostgreSQL</p>\n </li>\n <li>\n <p>Aurora MySQL</p>\n </li>\n <li>\n <p>Amazon RDS MySQL</p>\n </li>\n <li>\n <p>Amazon RDS MariaDB</p>\n </li>\n <li>\n <p>Amazon DocumentDB</p>\n </li>\n </ul>\n </li>\n <li>\n <p>\n <code>db.query.id</code> - The query ID generated by Performance Insights (only Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.query.db_id</code> - The query ID generated by the database (only Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.query.statement</code> - The text of the query that is being run (only Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.query.tokenized_id</code>\n </p>\n </li>\n <li>\n <p>\n <code>db.query.tokenized.id</code> - The query digest ID generated by Performance Insights (only Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.query.tokenized.db_id</code> - The query digest ID generated by Performance Insights (only Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.query.tokenized.statement</code> - The text of the query digest (only Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.session_type.name</code> - The type of the current session (only Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.sql.id</code> - The hash of the full, non-tokenized SQL statement generated by Performance Insights (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.sql.db_id</code> - Either the SQL ID generated by the database engine, or a value generated by Performance Insights that begins with\n <code>pi-</code> (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.sql.statement</code> - The full text of the SQL statement that is running, as in <code>SELECT * FROM employees</code>\n (all engines except Amazon DocumentDB)</p>\n </li>\n <li>\n <p>\n <code>db.sql.tokenized_id</code>\n </p>\n </li>\n <li>\n <p>\n <code>db.sql_tokenized.id</code> - The hash of the SQL digest generated by Performance Insights (all engines except Amazon DocumentDB). In the console,\n <code>db.sql_tokenized.id</code> is called the Support ID because Amazon Web Services Support can look at this data to help you troubleshoot\n database issues.</p>\n </li>\n <li>\n <p>\n <code>db.sql_tokenized.db_id</code> - Either the native database ID used to refer to the SQL statement, or a synthetic ID such as\n <code>pi-2372568224</code> that Performance Insights generates if the native database ID isn't available (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.sql_tokenized.statement</code> - The text of the SQL digest, as in <code>SELECT * FROM employees WHERE employee_id =\n ?</code> (all engines except Amazon DocumentDB)</p>\n </li>\n <li>\n <p>\n <code>db.user.id</code> - The ID of the user logged in to the database (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.user.name</code> - The name of the user logged in to the database (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.wait_event.name</code> - The event for which the backend is waiting (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.wait_event.type</code> - The type of event for which the backend is waiting (all engines except Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.wait_event_type.name</code> - The name of the event type for which the backend is waiting (all engines except\n Amazon DocumentDB).</p>\n </li>\n <li>\n <p>\n <code>db.wait_state.name</code> - The event for which the backend is waiting (only Amazon DocumentDB).</p>\n </li>\n </ul>"
657669
}
@@ -775,7 +787,7 @@
775787
"com.amazonaws.pi#DimensionsMetricList": {
776788
"type": "list",
777789
"member": {
778-
"target": "com.amazonaws.pi#RequestString"
790+
"target": "com.amazonaws.pi#SanitizedString"
779791
},
780792
"traits": {
781793
"smithy.api#length": {
@@ -854,6 +866,29 @@
854866
}
855867
}
856868
},
869+
"com.amazonaws.pi#FineGrainedAction": {
870+
"type": "enum",
871+
"members": {
872+
"DESCRIBE_DIMENSION_KEYS": {
873+
"target": "smithy.api#Unit",
874+
"traits": {
875+
"smithy.api#enumValue": "DescribeDimensionKeys"
876+
}
877+
},
878+
"GET_DIMENSION_KEY_DETAILS": {
879+
"target": "smithy.api#Unit",
880+
"traits": {
881+
"smithy.api#enumValue": "GetDimensionKeyDetails"
882+
}
883+
},
884+
"GET_RESOURCE_METRICS": {
885+
"target": "smithy.api#Unit",
886+
"traits": {
887+
"smithy.api#enumValue": "GetResourceMetrics"
888+
}
889+
}
890+
}
891+
},
857892
"com.amazonaws.pi#GetDimensionKeyDetails": {
858893
"type": "operation",
859894
"input": {
@@ -1402,6 +1437,12 @@
14021437
"traits": {
14031438
"smithy.api#documentation": "<p>An optional pagination token provided by a previous request. If this parameter is specified, \n the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.\n </p>"
14041439
}
1440+
},
1441+
"AuthorizedActions": {
1442+
"target": "com.amazonaws.pi#AuthorizedActionsList",
1443+
"traits": {
1444+
"smithy.api#documentation": "<p>The actions to discover the dimensions you are authorized to access. If you specify multiple actions, then the response will\n contain the dimensions common for all the actions.</p>\n <p>When you don't specify this request parameter or provide an empty list, the response contains all the \n available dimensions for the target database engine whether or not you are authorized to access them.</p>"
1445+
}
14051446
}
14061447
},
14071448
"traits": {
@@ -1740,7 +1781,7 @@
17401781
"type": "structure",
17411782
"members": {
17421783
"Metric": {
1743-
"target": "com.amazonaws.pi#RequestString",
1784+
"target": "com.amazonaws.pi#SanitizedString",
17441785
"traits": {
17451786
"smithy.api#documentation": "<p>The name of a Performance Insights metric to be measured.</p>\n <p>Valid values for <code>Metric</code> are:</p>\n <ul>\n <li>\n <p>\n <code>db.load.avg</code> - A scaled representation of the number of active sessions for the \n database engine.</p>\n </li>\n <li>\n <p>\n <code>db.sampledload.avg</code> - The raw number of active sessions for the database engine.</p>\n </li>\n <li>\n <p>The counter metrics listed in <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights_Counters.html#USER_PerfInsights_Counters.OS\">Performance Insights\n operating system counters</a> in the <i>Amazon Aurora User Guide</i>.</p>\n </li>\n <li>\n <p>The counter metrics listed in <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights_Counters.html#USER_PerfInsights_Counters.OS\">Performance Insights\n operating system counters</a> in the <i>Amazon RDS User Guide</i>.</p>\n </li>\n </ul>\n <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code> are the same\n value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code> showing the\n scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than\n <code>db.load.avg</code>. For most use cases, you can query <code>db.load.avg</code> only.</p>",
17461787
"smithy.api#required": {}
@@ -1766,7 +1807,7 @@
17661807
"com.amazonaws.pi#MetricQueryFilterMap": {
17671808
"type": "map",
17681809
"key": {
1769-
"target": "com.amazonaws.pi#RequestString"
1810+
"target": "com.amazonaws.pi#SanitizedString"
17701811
},
17711812
"value": {
17721813
"target": "com.amazonaws.pi#RequestString"
@@ -1787,7 +1828,7 @@
17871828
"com.amazonaws.pi#MetricTypeList": {
17881829
"type": "list",
17891830
"member": {
1790-
"target": "com.amazonaws.pi#RequestString"
1831+
"target": "com.amazonaws.pi#SanitizedString"
17911832
}
17921833
},
17931834
"com.amazonaws.pi#MetricValuesList": {
@@ -2867,22 +2908,10 @@
28672908
"smithy.api#pattern": "\\S"
28682909
}
28692910
},
2870-
"com.amazonaws.pi#RequestStringList": {
2871-
"type": "list",
2872-
"member": {
2873-
"target": "com.amazonaws.pi#RequestString"
2874-
},
2875-
"traits": {
2876-
"smithy.api#length": {
2877-
"min": 1,
2878-
"max": 10
2879-
}
2880-
}
2881-
},
28822911
"com.amazonaws.pi#RequestedDimensionList": {
28832912
"type": "list",
28842913
"member": {
2885-
"target": "com.amazonaws.pi#RequestString"
2914+
"target": "com.amazonaws.pi#SanitizedString"
28862915
},
28872916
"traits": {
28882917
"smithy.api#length": {
@@ -2965,6 +2994,29 @@
29652994
"target": "com.amazonaws.pi#ResponseResourceMetric"
29662995
}
29672996
},
2997+
"com.amazonaws.pi#SanitizedString": {
2998+
"type": "string",
2999+
"traits": {
3000+
"smithy.api#documentation": "A generic string type that forbids characters that could expose our service (or services downstream)\n to security risks around injections.",
3001+
"smithy.api#length": {
3002+
"min": 0,
3003+
"max": 256
3004+
},
3005+
"smithy.api#pattern": "^[a-zA-Z0-9-_\\.:/*)( ]+$"
3006+
}
3007+
},
3008+
"com.amazonaws.pi#SanitizedStringList": {
3009+
"type": "list",
3010+
"member": {
3011+
"target": "com.amazonaws.pi#SanitizedString"
3012+
},
3013+
"traits": {
3014+
"smithy.api#length": {
3015+
"min": 1,
3016+
"max": 10
3017+
}
3018+
}
3019+
},
29683020
"com.amazonaws.pi#ServiceType": {
29693021
"type": "enum",
29703022
"members": {

0 commit comments

Comments
 (0)