Skip to content

Commit cc1cbaf

Browse files
author
awstools
committed
feat(client-amp): Add support for sending metrics to cross account and CMCK AMP workspaces through RoleConfiguration on Create/Update Scraper.
1 parent d98e8ff commit cc1cbaf

File tree

7 files changed

+109
-3
lines changed

7 files changed

+109
-3
lines changed

clients/client-amp/src/commands/CreateScraperCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ export interface CreateScraperCommandOutput extends CreateScraperResponse, __Met
7373
* workspaceArn: "STRING_VALUE", // required
7474
* },
7575
* },
76+
* roleConfiguration: { // RoleConfiguration
77+
* sourceRoleArn: "STRING_VALUE",
78+
* targetRoleArn: "STRING_VALUE",
79+
* },
7680
* clientToken: "STRING_VALUE",
7781
* tags: { // TagMap
7882
* "<keys>": "STRING_VALUE",

clients/client-amp/src/commands/DescribeScraperCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ export interface DescribeScraperCommandOutput extends DescribeScraperResponse, _
7575
* // workspaceArn: "STRING_VALUE", // required
7676
* // },
7777
* // },
78+
* // roleConfiguration: { // RoleConfiguration
79+
* // sourceRoleArn: "STRING_VALUE",
80+
* // targetRoleArn: "STRING_VALUE",
81+
* // },
7882
* // },
7983
* // };
8084
*

clients/client-amp/src/commands/ListScrapersCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ export interface ListScrapersCommandOutput extends ListScrapersResponse, __Metad
8080
* // workspaceArn: "STRING_VALUE", // required
8181
* // },
8282
* // },
83+
* // roleConfiguration: { // RoleConfiguration
84+
* // sourceRoleArn: "STRING_VALUE",
85+
* // targetRoleArn: "STRING_VALUE",
86+
* // },
8387
* // },
8488
* // ],
8589
* // nextToken: "STRING_VALUE",

clients/client-amp/src/commands/UpdateScraperCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ export interface UpdateScraperCommandOutput extends UpdateScraperResponse, __Met
4949
* workspaceArn: "STRING_VALUE", // required
5050
* },
5151
* },
52+
* roleConfiguration: { // RoleConfiguration
53+
* sourceRoleArn: "STRING_VALUE",
54+
* targetRoleArn: "STRING_VALUE",
55+
* },
5256
* clientToken: "STRING_VALUE",
5357
* };
5458
* const command = new UpdateScraperCommand(input);

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

+42
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,24 @@ export namespace Destination {
580580
};
581581
}
582582

583+
/**
584+
* <p>To configure roles that allows users to write to an Amazon Managed Service for Prometheus workspace in a different account.</p>
585+
* @public
586+
*/
587+
export interface RoleConfiguration {
588+
/**
589+
* <p>A ARN identifying the source role configuration.</p>
590+
* @public
591+
*/
592+
sourceRoleArn?: string | undefined;
593+
594+
/**
595+
* <p>A ARN identifying the target role configuration.</p>
596+
* @public
597+
*/
598+
targetRoleArn?: string | undefined;
599+
}
600+
583601
/**
584602
* <p>A scrape configuration for a scraper, base 64 encoded. For more information, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-configuration">Scraper configuration</a> in the <i>Amazon Managed Service for Prometheus User
585603
* Guide</i>.</p>
@@ -713,6 +731,12 @@ export interface CreateScraperRequest {
713731
*/
714732
destination: Destination | undefined;
715733

734+
/**
735+
* <p>The scraper role configuration for the workspace.</p>
736+
* @public
737+
*/
738+
roleConfiguration?: RoleConfiguration | undefined;
739+
716740
/**
717741
* <p>(Optional) A unique, case-sensitive identifier that you can provide to ensure the
718742
* idempotency of the request.</p>
@@ -939,6 +963,12 @@ export interface ScraperDescription {
939963
* @public
940964
*/
941965
destination: Destination | undefined;
966+
967+
/**
968+
* <p>To configure roles that allows users to write to an Amazon Managed Service for Prometheus workspace in a different account.</p>
969+
* @public
970+
*/
971+
roleConfiguration?: RoleConfiguration | undefined;
942972
}
943973

944974
/**
@@ -1066,6 +1096,12 @@ export interface ScraperSummary {
10661096
* @public
10671097
*/
10681098
destination: Destination | undefined;
1099+
1100+
/**
1101+
* <p>To configure roles that allows users to write to an Amazon Managed Service for Prometheus workspace in a different account.</p>
1102+
* @public
1103+
*/
1104+
roleConfiguration?: RoleConfiguration | undefined;
10691105
}
10701106

10711107
/**
@@ -1122,6 +1158,12 @@ export interface UpdateScraperRequest {
11221158
*/
11231159
destination?: Destination | undefined;
11241160

1161+
/**
1162+
* <p>The scraper role configuration for the workspace.</p>
1163+
* @public
1164+
*/
1165+
roleConfiguration?: RoleConfiguration | undefined;
1166+
11251167
/**
11261168
* <p>A unique identifier that you can provide to ensure the idempotency of the request.
11271169
* Case-sensitive.</p>

clients/client-amp/src/protocols/Aws_restJson1.ts

+9
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ import {
117117
InternalServerException,
118118
LoggingConfigurationMetadata,
119119
ResourceNotFoundException,
120+
RoleConfiguration,
120121
RuleGroupsNamespaceDescription,
121122
RuleGroupsNamespaceSummary,
122123
ScrapeConfiguration,
@@ -222,6 +223,7 @@ export const se_CreateScraperCommand = async (
222223
alias: [],
223224
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
224225
destination: (_) => _json(_),
226+
roleConfiguration: (_) => _json(_),
225227
scrapeConfiguration: (_) => se_ScrapeConfiguration(_, context),
226228
source: (_) => _json(_),
227229
tags: (_) => _json(_),
@@ -659,6 +661,7 @@ export const se_UpdateScraperCommand = async (
659661
alias: [],
660662
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
661663
destination: (_) => _json(_),
664+
roleConfiguration: (_) => _json(_),
662665
scrapeConfiguration: (_) => se_ScrapeConfiguration(_, context),
663666
})
664667
);
@@ -1444,6 +1447,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
14441447

14451448
// se_EksConfiguration omitted.
14461449

1450+
// se_RoleConfiguration omitted.
1451+
14471452
/**
14481453
* serializeAws_restJson1ScrapeConfiguration
14491454
*/
@@ -1500,6 +1505,8 @@ const de_LoggingConfigurationMetadata = (output: any, context: __SerdeContext):
15001505

15011506
// de_LoggingConfigurationStatus omitted.
15021507

1508+
// de_RoleConfiguration omitted.
1509+
15031510
/**
15041511
* deserializeAws_restJson1RuleGroupsNamespaceDescription
15051512
*/
@@ -1566,6 +1573,7 @@ const de_ScraperDescription = (output: any, context: __SerdeContext): ScraperDes
15661573
destination: (_: any) => _json(__expectUnion(_)),
15671574
lastModifiedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
15681575
roleArn: __expectString,
1576+
roleConfiguration: _json,
15691577
scrapeConfiguration: (_: any) => de_ScrapeConfiguration(__expectUnion(_), context),
15701578
scraperId: __expectString,
15711579
source: (_: any) => _json(__expectUnion(_)),
@@ -1588,6 +1596,7 @@ const de_ScraperSummary = (output: any, context: __SerdeContext): ScraperSummary
15881596
destination: (_: any) => _json(__expectUnion(_)),
15891597
lastModifiedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
15901598
roleArn: __expectString,
1599+
roleConfiguration: _json,
15911600
scraperId: __expectString,
15921601
source: (_: any) => _json(__expectUnion(_)),
15931602
status: _json,

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

+42-3
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,12 @@
13981398
"smithy.api#required": {}
13991399
}
14001400
},
1401+
"roleConfiguration": {
1402+
"target": "com.amazonaws.amp#RoleConfiguration",
1403+
"traits": {
1404+
"smithy.api#documentation": "<p>The scraper role configuration for the workspace.</p>"
1405+
}
1406+
},
14011407
"clientToken": {
14021408
"target": "com.amazonaws.amp#IdempotencyToken",
14031409
"traits": {
@@ -2544,7 +2550,8 @@
25442550
"aws.api#arnReference": {
25452551
"type": "AWS::IAM::Role"
25462552
},
2547-
"smithy.api#documentation": "<p>An ARN identifying an IAM role used by the scraper.</p>"
2553+
"smithy.api#documentation": "<p>An ARN identifying an IAM role used by the scraper.</p>",
2554+
"smithy.api#pattern": "^arn:aws[-a-z]*:iam::[0-9]{12}:role/.+$"
25482555
}
25492556
},
25502557
"com.amazonaws.amp#IdempotencyToken": {
@@ -2594,7 +2601,7 @@
25942601
"min": 20,
25952602
"max": 2048
25962603
},
2597-
"smithy.api#pattern": "^arn:aws:kms:[a-z0-9\\-]+:\\d+:key/[a-f0-9\\-]+$"
2604+
"smithy.api#pattern": "^arn:aws[-a-z]*:kms:[-a-z0-9]+:[0-9]{12}:key/[-a-f0-9]+$"
25982605
}
25992606
},
26002607
"com.amazonaws.amp#ListRuleGroupsNamespaces": {
@@ -3055,7 +3062,7 @@
30553062
"aws.api#arnReference": {
30563063
"type": "AWS::Logs::LogGroup"
30573064
},
3058-
"smithy.api#pattern": "^arn:aws[a-z0-9-]*:logs:[a-z0-9-]+:\\d{12}:log-group:[A-Za-z0-9\\.\\-\\_\\#/]{1,512}\\:\\*$"
3065+
"smithy.api#pattern": "^arn:aws[-a-z]*:logs:[-a-z0-9]+:[0-9]{12}:log-group:[A-Za-z0-9\\.\\-\\_\\#/]{1,512}\\:\\*$"
30593066
}
30603067
},
30613068
"com.amazonaws.amp#LoggingConfiguration": {
@@ -3426,6 +3433,26 @@
34263433
"smithy.api#httpError": 404
34273434
}
34283435
},
3436+
"com.amazonaws.amp#RoleConfiguration": {
3437+
"type": "structure",
3438+
"members": {
3439+
"sourceRoleArn": {
3440+
"target": "com.amazonaws.amp#IamRoleArn",
3441+
"traits": {
3442+
"smithy.api#documentation": "<p>A ARN identifying the source role configuration.</p>"
3443+
}
3444+
},
3445+
"targetRoleArn": {
3446+
"target": "com.amazonaws.amp#IamRoleArn",
3447+
"traits": {
3448+
"smithy.api#documentation": "<p>A ARN identifying the target role configuration.</p>"
3449+
}
3450+
}
3451+
},
3452+
"traits": {
3453+
"smithy.api#documentation": "<p>To configure roles that allows users to write to an Amazon Managed Service for Prometheus workspace in a different account.</p>"
3454+
}
3455+
},
34293456
"com.amazonaws.amp#RuleGroupsNamespace": {
34303457
"type": "resource",
34313458
"identifiers": {
@@ -3807,6 +3834,9 @@
38073834
"smithy.api#documentation": "<p>The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.</p>",
38083835
"smithy.api#required": {}
38093836
}
3837+
},
3838+
"roleConfiguration": {
3839+
"target": "com.amazonaws.amp#RoleConfiguration"
38103840
}
38113841
},
38123842
"traits": {
@@ -3985,6 +4015,9 @@
39854015
"smithy.api#documentation": "<p>The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.</p>",
39864016
"smithy.api#required": {}
39874017
}
4018+
},
4019+
"roleConfiguration": {
4020+
"target": "com.amazonaws.amp#RoleConfiguration"
39884021
}
39894022
},
39904023
"traits": {
@@ -4500,6 +4533,12 @@
45004533
"smithy.api#documentation": "<p>The new Amazon Managed Service for Prometheus workspace to send metrics to.</p>"
45014534
}
45024535
},
4536+
"roleConfiguration": {
4537+
"target": "com.amazonaws.amp#RoleConfiguration",
4538+
"traits": {
4539+
"smithy.api#documentation": "<p>The scraper role configuration for the workspace.</p>"
4540+
}
4541+
},
45034542
"clientToken": {
45044543
"target": "com.amazonaws.amp#IdempotencyToken",
45054544
"traits": {

0 commit comments

Comments
 (0)