Skip to content

Commit 4aca00f

Browse files
author
awstools
committed
feat(client-amp): Add VPC source configuration support enabling Amazon Managed Service for Prometheus Collector to collect metrics from MSK clusters.
1 parent 0cb0163 commit 4aca00f

File tree

8 files changed

+174
-10
lines changed

8 files changed

+174
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface CreateRuleGroupsNamespaceCommandInput extends CreateRuleGroupsN
2727
export interface CreateRuleGroupsNamespaceCommandOutput extends CreateRuleGroupsNamespaceResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>The <code>CreateRuleGroupsNamespace</code> operation creates a rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces.</p> <p>Use this operation only to create new rule groups namespaces. To update an existing rule groups namespace, use <code>PutRuleGroupsNamespace</code>.</p>
30+
* <p>The <code>CreateRuleGroupsNamespace</code> operation creates a rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces.</p> <important> <p>The combined length of a rule group namespace and a rule group name cannot exceed 721 UTF-8 bytes.</p> </important> <p>Use this operation only to create new rule groups namespaces. To update an existing rule groups namespace, use <code>PutRuleGroupsNamespace</code>.</p>
3131
* @example
3232
* Use a bare-bones client and the command you need to make an API call.
3333
* ```javascript

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

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface CreateScraperCommandInput extends CreateScraperRequest {}
2727
export interface CreateScraperCommandOutput extends CreateScraperResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>The <code>CreateScraper</code> operation creates a scraper to collect metrics. A scraper pulls metrics from Prometheus-compatible sources within an Amazon EKS cluster, and sends them to your Amazon Managed Service for Prometheus workspace. Scrapers are flexible, and can be configured to control what metrics are collected, the frequency of collection, what transformations are applied to the metrics, and more.</p> <p>An IAM role will be created for you that Amazon Managed Service for Prometheus uses to access the metrics in your cluster. You must configure this role with a policy that allows it to scrape metrics from your cluster. For more information, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-eks-setup">Configuring your Amazon EKS cluster</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p> <p>The <code>scrapeConfiguration</code> parameter contains the base-64 encoded YAML configuration for the scraper.</p> <p>When creating a scraper, the service creates a <code>Network Interface</code> in each <b>Availability Zone</b> that are passed into <code>CreateScraper</code> through subnets. These network interfaces are used to connect to the Amazon EKS cluster within the VPC for scraping metrics.</p> <note> <p>For more information about collectors, including what metrics are collected, and how to configure the scraper, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html">Using an Amazon Web Services managed collector</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p> </note>
30+
* <p>The <code>CreateScraper</code> operation creates a scraper to collect metrics. A scraper pulls metrics from Prometheus-compatible sources and sends them to your Amazon Managed Service for Prometheus workspace. You can configure scrapers to collect metrics from Amazon EKS clusters, Amazon MSK clusters, or from VPC-based sources that support DNS-based service discovery. Scrapers are flexible, and can be configured to control what metrics are collected, the frequency of collection, what transformations are applied to the metrics, and more.</p> <p>An IAM role will be created for you that Amazon Managed Service for Prometheus uses to access the metrics in your source. You must configure this role with a policy that allows it to scrape metrics from your source. For Amazon EKS sources, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-eks-setup">Configuring your Amazon EKS cluster</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p> <p>The <code>scrapeConfiguration</code> parameter contains the base-64 encoded YAML configuration for the scraper.</p> <p>When creating a scraper, the service creates a <code>Network Interface</code> in each <b>Availability Zone</b> that are passed into <code>CreateScraper</code> through subnets. These network interfaces are used to connect to your source within the VPC for scraping metrics.</p> <note> <p>For more information about collectors, including what metrics are collected, and how to configure the scraper, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html">Using an Amazon Web Services managed collector</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p> </note>
3131
* @example
3232
* Use a bare-bones client and the command you need to make an API call.
3333
* ```javascript
@@ -51,6 +51,14 @@ export interface CreateScraperCommandOutput extends CreateScraperResponse, __Met
5151
* "STRING_VALUE",
5252
* ],
5353
* },
54+
* vpcConfiguration: { // VpcConfiguration
55+
* securityGroupIds: [ // required
56+
* "STRING_VALUE",
57+
* ],
58+
* subnetIds: [ // required
59+
* "STRING_VALUE",
60+
* ],
61+
* },
5462
* },
5563
* destination: { // Destination Union: only one key present
5664
* ampConfiguration: { // AmpConfiguration
@@ -157,6 +165,50 @@ export interface CreateScraperCommandOutput extends CreateScraperResponse, __Met
157165
* *\/
158166
* ```
159167
*
168+
* @example CreateScraper with generic VPC config with mandatory securityGroupIds and subnetIds
169+
* ```javascript
170+
* //
171+
* const input = {
172+
* alias: "alias",
173+
* clientToken: "token",
174+
* destination: {
175+
* ampConfiguration: {
176+
* workspaceArn: "arn:aws:aps:us-west-2:123456789012:workspace/ws-ogh2u499-ce12-hg89-v6c7-123412341234"
177+
* }
178+
* },
179+
* scrapeConfiguration: {
180+
* configurationBlob: "blob"
181+
* },
182+
* source: {
183+
* vpcConfiguration: {
184+
* securityGroupIds: [
185+
* "sg-abc123"
186+
* ],
187+
* subnetIds: [
188+
* "subnet-abc123"
189+
* ]
190+
* }
191+
* },
192+
* tags: {
193+
* exampleTag: "exampleValue"
194+
* }
195+
* };
196+
* const command = new CreateScraperCommand(input);
197+
* const response = await client.send(command);
198+
* /* response is
199+
* {
200+
* arn: "arn:aws:aps:us-west-2:123456789012:scraper/scraper-123",
201+
* scraperId: "scraper-123",
202+
* status: {
203+
* statusCode: "CREATING"
204+
* },
205+
* tags: {
206+
* exampleTag: "exampleValue"
207+
* }
208+
* }
209+
* *\/
210+
* ```
211+
*
160212
* @public
161213
*/
162214
export class CreateScraperCommand extends $Command

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ export interface DescribeScraperCommandOutput extends DescribeScraperResponse, _
6969
* // "STRING_VALUE",
7070
* // ],
7171
* // },
72+
* // vpcConfiguration: { // VpcConfiguration
73+
* // securityGroupIds: [ // required
74+
* // "STRING_VALUE",
75+
* // ],
76+
* // subnetIds: [ // required
77+
* // "STRING_VALUE",
78+
* // ],
79+
* // },
7280
* // },
7381
* // destination: { // Destination Union: only one key present
7482
* // ampConfiguration: { // AmpConfiguration

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ export interface ListScrapersCommandOutput extends ListScrapersResponse, __Metad
7373
* // "STRING_VALUE",
7474
* // ],
7575
* // },
76+
* // vpcConfiguration: { // VpcConfiguration
77+
* // securityGroupIds: [ // required
78+
* // "STRING_VALUE",
79+
* // ],
80+
* // subnetIds: [ // required
81+
* // "STRING_VALUE",
82+
* // ],
83+
* // },
7684
* // },
7785
* // destination: { // Destination Union: only one key present
7886
* // ampConfiguration: { // AmpConfiguration

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface PutRuleGroupsNamespaceCommandInput extends PutRuleGroupsNamespa
2727
export interface PutRuleGroupsNamespaceCommandOutput extends PutRuleGroupsNamespaceResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>Updates an existing rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces.</p> <p>Use this operation only to update existing rule groups namespaces. To create a new rule groups namespace, use <code>CreateRuleGroupsNamespace</code>.</p> <p>You can't use this operation to add tags to an existing rule groups namespace. Instead, use <code>TagResource</code>.</p>
30+
* <p>Updates an existing rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces.</p> <important> <p>The combined length of a rule group namespace and a rule group name cannot exceed 721 UTF-8 bytes.</p> </important> <p>Use this operation only to update existing rule groups namespaces. To create a new rule groups namespace, use <code>CreateRuleGroupsNamespace</code>.</p> <p>You can't use this operation to add tags to an existing rule groups namespace. Instead, use <code>TagResource</code>.</p>
3131
* @example
3232
* Use a bare-bones client and the command you need to make an API call.
3333
* ```javascript

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

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,29 @@ export interface EksConfiguration {
644644
subnetIds: string[] | undefined;
645645
}
646646

647+
/**
648+
* <p>The Amazon VPC configuration that specifies the network settings for a Prometheus collector to securely connect to Amazon MSK clusters. This configuration includes the security groups and subnets that control network access and placement for the collector.</p>
649+
* @public
650+
*/
651+
export interface VpcConfiguration {
652+
/**
653+
* <p>The security group IDs that control network access for the Prometheus collector. These security groups must allow the collector to communicate with your Amazon MSK cluster on the required ports.</p>
654+
* @public
655+
*/
656+
securityGroupIds: string[] | undefined;
657+
658+
/**
659+
* <p>The subnet IDs where the Prometheus collector will be deployed. The subnets must be in the same Amazon VPC as your Amazon MSK cluster and have network connectivity to the cluster.</p>
660+
* @public
661+
*/
662+
subnetIds: string[] | undefined;
663+
}
664+
647665
/**
648666
* <p>The source of collected metrics for a scraper.</p>
649667
* @public
650668
*/
651-
export type Source = Source.EksConfigurationMember | Source.$UnknownMember;
669+
export type Source = Source.EksConfigurationMember | Source.VpcConfigurationMember | Source.$UnknownMember;
652670

653671
/**
654672
* @public
@@ -660,6 +678,17 @@ export namespace Source {
660678
*/
661679
export interface EksConfigurationMember {
662680
eksConfiguration: EksConfiguration;
681+
vpcConfiguration?: never;
682+
$unknown?: never;
683+
}
684+
685+
/**
686+
* <p>The Amazon VPC configuration for the Prometheus collector when connecting to Amazon MSK clusters. This configuration enables secure, private network connectivity between the collector and your Amazon MSK cluster within your Amazon VPC.</p>
687+
* @public
688+
*/
689+
export interface VpcConfigurationMember {
690+
eksConfiguration?: never;
691+
vpcConfiguration: VpcConfiguration;
663692
$unknown?: never;
664693
}
665694

@@ -668,6 +697,7 @@ export namespace Source {
668697
*/
669698
export interface $UnknownMember {
670699
eksConfiguration?: never;
700+
vpcConfiguration?: never;
671701
$unknown: [string, any];
672702
}
673703

@@ -677,6 +707,7 @@ export namespace Source {
677707
*/
678708
export interface Visitor<T> {
679709
eksConfiguration: (value: EksConfiguration) => T;
710+
vpcConfiguration: (value: VpcConfiguration) => T;
680711
_: (name: string, value: any) => T;
681712
}
682713
}
@@ -699,7 +730,7 @@ export interface CreateScraperRequest {
699730
scrapeConfiguration: ScrapeConfiguration | undefined;
700731

701732
/**
702-
* <p>The Amazon EKS cluster from which the scraper will collect metrics.</p>
733+
* <p>The Amazon EKS or Amazon Web Services cluster from which the scraper will collect metrics.</p>
703734
* @public
704735
*/
705736
source: Source | undefined;

clients/client-amp/src/schemas/schemas_0.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ const _UWAR = "UpdateWorkspaceAliasRequest";
169169
const _UWC = "UpdateWorkspaceConfiguration";
170170
const _UWCR = "UpdateWorkspaceConfigurationRequest";
171171
const _UWCRp = "UpdateWorkspaceConfigurationResponse";
172+
const _VC = "VpcConfiguration";
172173
const _VE = "ValidationException";
173174
const _VEF = "ValidationExceptionField";
174175
const _VEFL = "ValidationExceptionFieldList";
@@ -269,6 +270,7 @@ const _t = "tags";
269270
const _tK = "tagKeys";
270271
const _tRA = "targetRoleArn";
271272
const _ty = "type";
273+
const _vC = "vpcConfiguration";
272274
const _w = "workspace";
273275
const _wA = "workspaceArn";
274276
const _wC = "workspaceConfiguration";
@@ -1200,6 +1202,7 @@ export var ValidationException: StaticErrorSchema = [
12001202
TypeRegistry.for(n0).registerError(ValidationException, __ValidationException);
12011203

12021204
export var ValidationExceptionField: StaticStructureSchema = [3, n0, _VEF, 0, [_n, _m], [0, 0]];
1205+
export var VpcConfiguration: StaticStructureSchema = [3, n0, _VC, 0, [_sGI, _sIu], [64 | 0, 64 | 0]];
12031206
export var WorkspaceConfigurationDescription: StaticStructureSchema = [
12041207
3,
12051208
n0,
@@ -1276,7 +1279,7 @@ export var ScraperLoggingDestination: StaticStructureSchema = [
12761279
[_cWL],
12771280
[() => CloudWatchLogDestination],
12781281
];
1279-
export var Source: StaticStructureSchema = [3, n0, _S, 0, [_eC], [() => EksConfiguration]];
1282+
export var Source: StaticStructureSchema = [3, n0, _S, 0, [_eC, _vC], [() => EksConfiguration, () => VpcConfiguration]];
12801283
export var CreateAlertManagerDefinition: StaticOperationSchema = [
12811284
9,
12821285
n0,

0 commit comments

Comments
 (0)