Skip to main content

AWS CDK Construct Library for Amazon Managed Service for Prometheus

Project description

@robhan-cdk-lib/aws_aps

AWS Cloud Development Kit (CDK) constructs for Amazon Managed Service for Prometheus.

In aws-cdk-lib.aws_aps, there currently only exist L1 constructs for Amazon Managed Service for Prometheus.

While helpful, they miss convenience like:

  • advanced parameter checking (min/max number values, string lengths, array lengths...) before CloudFormation deployment
  • proper parameter typing, e.g. enum values instead of strings
  • simply referencing other constructs instead of e.g. ARN strings

Those features are implemented here.

The CDK maintainers explain that publishing your own package is "by far the strongest signal you can give to the CDK team that a feature should be included within the core aws-cdk packages".

This project aims to develop aws_aps constructs to a maturity that can potentially be accepted to the CDK core.

It is not supported by AWS and is not endorsed by them. Please file issues in the GitHub repository if you find any.

Example use

import * as cdk from 'aws-cdk-lib';
import { Subnet } from 'aws-cdk-lib/aws-ec2';
import { Cluster } from 'aws-cdk-lib/aws-eks';
import { Construct } from 'constructs';
import { Workspace, RuleGroupsNamespace, Scraper } from '@robhan-cdk-lib/aws_aps';

export class AwsApsCdkStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const workspace = new Workspace(this, 'MyWorkspace', {});
    new RuleGroupsNamespace(this, 'MyRuleGroupsNamespace', { workspace, data: '<myRulesFileData>', name: 'myRuleGroupsNamespace' });
    new Scraper(this, 'MyScraper', {
      destination: {
        ampConfiguration: {
          workspace,
        },
      },
      source: {
        eksConfiguration: {
          cluster: Cluster.fromClusterAttributes(this, 'MyCluster', {
            clusterName: 'clusterName',
          }),
          subnets: [
            Subnet.fromSubnetAttributes(this, 'MySubnet', {
              subnetId: 'subnetId',
            }),
          ],
        },
      },
      scrapeConfiguration: {
        configurationBlob: '<myScrapeConfiguration>',
      },
    });
  }
}

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robhan_cdk_lib_aws_aps-0.0.121.tar.gz (83.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robhan_cdk_lib_aws_aps-0.0.121-py3-none-any.whl (81.2 kB view details)

Uploaded Python 3

File details

Details for the file robhan_cdk_lib_aws_aps-0.0.121.tar.gz.

File metadata

File hashes

Hashes for robhan_cdk_lib_aws_aps-0.0.121.tar.gz
Algorithm Hash digest
SHA256 6f79a452196ff317abf5f29e49d397a94e2eef10505e3f8e6002d9b28b4c5090
MD5 e1d2573282d336f499d8802df9d236dd
BLAKE2b-256 09b708bc49af814c384a73faf2e9f6f15ec6ceff59eb5f34fcc69cdba9f8d242

See more details on using hashes here.

File details

Details for the file robhan_cdk_lib_aws_aps-0.0.121-py3-none-any.whl.

File metadata

File hashes

Hashes for robhan_cdk_lib_aws_aps-0.0.121-py3-none-any.whl
Algorithm Hash digest
SHA256 73e9f4438f09fa36d3c1ea6c4bf453809bbf8119735b5d2dba0a96a0d3ec90ec
MD5 20148a8d78bcbf66a5dea19c6d3e205c
BLAKE2b-256 6c93452a0f2ada9c0272043ac0d55390639dad26b989ff13c80f58fae2db6040

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page