Skip to main content

AWS CDK Construct Library for Amazon Managed Grafana

Project description

@robhan-cdk-lib/aws_grafana

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

In aws-cdk-lib.aws_grafana, there currently only exist L1 constructs for Amazon Managed Grafana.

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_grafana 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 { Construct } from "constructs";
import {
  AccountAccessType,
  AuthenticationProviders,
  PermissionTypes,
  Workspace,
} from "@robhan-cdk-lib/aws_grafana";
import { Role, ServicePrincipal } from "aws-cdk-lib/aws-iam";

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

    const grafanaRole = new Role(this, "GrafanaWorkspaceRole", {
      assumedBy: new ServicePrincipal("grafana.amazonaws.com"),
      description: "Role for Amazon Managed Grafana Workspace",
    });

    const workspace = new Workspace(this, "Workspace", {
      accountAccessType: AccountAccessType.CURRENT_ACCOUNT,
      authenticationProviders: [AuthenticationProviders.AWS_SSO],
      permissionType: PermissionTypes.SERVICE_MANAGED,
      role: grafanaRole,
    });
  }
}

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_grafana-0.0.355.tar.gz (94.5 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_grafana-0.0.355-py3-none-any.whl (92.9 kB view details)

Uploaded Python 3

File details

Details for the file robhan_cdk_lib_aws_grafana-0.0.355.tar.gz.

File metadata

File hashes

Hashes for robhan_cdk_lib_aws_grafana-0.0.355.tar.gz
Algorithm Hash digest
SHA256 2901b75537abfa845c91ef17212b15bd72cb5b62dcf7b3858da366e8bb355e55
MD5 99efe90546907a0278446185b44c5724
BLAKE2b-256 ce4268da88980326af6ccb8b32d91ee1b37e287d41c22d501a9cee7c4273c62e

See more details on using hashes here.

File details

Details for the file robhan_cdk_lib_aws_grafana-0.0.355-py3-none-any.whl.

File metadata

File hashes

Hashes for robhan_cdk_lib_aws_grafana-0.0.355-py3-none-any.whl
Algorithm Hash digest
SHA256 2f419764b38c1fe14d48511ace3b61a69c03c6ea1651b9f41a2264186fb7a11a
MD5 c1143295db36fd1f773d6d1b1a4c4781
BLAKE2b-256 7b2b55e5907a04e55bf742f27c5a332383f373683faef2a33010a81e335eba89

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