Registry / aws / aws-cdk-aws-codeguruprofiler

aws-cdk-aws-codeguruprofiler

JSON →
library1.204.0pypypiunverified

The `aws-cdk-aws-codeguruprofiler` library provides AWS CDK (v1) constructs for provisioning AWS CodeGuru Profiler resources. It simplifies the creation and management of profiling groups and related configurations within your CDK applications. This entry is for CDK v1, with the current version being 1.204.0. AWS CDK typically follows a rapid release cadence, often aligning with AWS service updates.

pip install aws-cdk.core aws-cdk-aws-codeguruprofiler
INSTALL
IMPORT
SIG · AWS-CDK-AWS-CODEGU
A
aws-cdk-aws-codeguruprofiler
awspythonv1.204.0
Install
3.7s avg
Import
Disk
29MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.204.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 30.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.7s · import 0.000s · 31MB
29MB installed
● package 29MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ProfilingGroup
from aws_cdk.aws_codeguruprofiler import ProfilingGroup
from aws_cdk.lib.aws_codeguruprofiler import ProfilingGroup
This package is for AWS CDK v1. The `aws_cdk.lib` import pattern is specific to AWS CDK v2. Ensure your entire CDK application is consistently using v1 (`aws-cdk.core` and federated packages) or v2 (`aws-cdk-lib` monolithic package).
App
from aws_cdk import App
from aws_cdk.App import App
For AWS CDK v1, core constructs like App and Stack are directly imported from the top-level `aws_cdk` module (which comes from `aws-cdk.core` PyPI package).

This quickstart demonstrates how to define a basic AWS CodeGuru Profiling Group using the `aws-cdk-aws-codeguruprofiler` library in a CDK v1 application. It creates a `ProfilingGroup` resource with a configurable name. Remember to set `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` environment variables for deployment.

import os from aws_cdk import App, Stack, Environment from aws_cdk import aws_codeguruprofiler as codeguruprofiler from constructs import Construct class CodeGuruProfilerStack(Stack): def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) profiling_group_name = os.environ.get("CODEGURU_PROFILING_GROUP_NAME", "MyDefaultProfilingGroup") # Create a CodeGuru Profiling Group profiling_group = codeguruprofiler.ProfilingGroup( self, "MyApplicationProfilingGroup", profiling_group_name=profiling_group_name, # Compute Platform is typically configured via agent or defaults to 'Default' # For AWS Lambda, explicit configuration may be needed or a different construct. # You can add tags, notifications, etc. here. ) # Output the ARN of the created profiling group # cdk.CfnOutput(self, "ProfilingGroupArn", value=profiling_group.profiling_group_arn) app = App() CodeGuruProfilerStack( app, "CodeGuruProfilerStack", env=Environment(account=os.environ.get("CDK_DEFAULT_ACCOUNT"), region=os.environ.get("CDK_DEFAULT_REGION")) ) app.synth()
Debug
Known issues
breakingThis package (`aws-cdk-aws-codeguruprofiler`) is part of AWS CDK v1's federated package model. It is not compatible with AWS CDK v2, which uses a single monolithic package (`aws-cdk-lib`). Trying to mix v1 and v2 packages or import patterns will lead to `ModuleNotFoundError` or deployment issues.
fix
Migrate your entire CDK application to v2 by installing `aws-cdk-lib` and updating imports, or ensure you are consistently using v1 by installing `aws-cdk.core` and specific service packages like this one.
affects: All versions of aws-cdk-aws-codeguruprofiler (v1) when used with aws-cdk-lib (v2).
gotchaAWS CodeGuru Profiler requires appropriate IAM permissions for the application being profiled and the CDK deployment role. Ensure your execution roles have `codeguru-profiler:ConfigureAgent`, `codeguru-profiler:PostAgentProfile`, and other necessary permissions (e.g., `codeguru-profiler:CreateProfilingGroup` for the deployment role).
fix
Attach an IAM policy with required CodeGuru Profiler permissions to the application's execution role and your CDK deployment role. Consider using `iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonCodeGuruProfilerAgentAccess')` for the application role.
affects: All versions
gotchaProfiling Group names must be unique within an AWS account and region. If you attempt to deploy a stack with a name that already exists (even from a previous failed deployment or manual creation), the deployment will fail.
fix
Ensure profiling group names are unique. Use a dynamic name (e.g., suffixed with a unique ID or hash) for transient environments, or explicitly delete the old profiling group before redeployment.
affects: All versions
Upgrade
Version history
1.204.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies
aws-cdk.corerequiredCore AWS CDK v1 library, required for all CDK v1 constructs.
constructsrequiredBase construct library for all CDK applications.
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
2
Resources
aws-cdk-aws-codeguruprofiler — pip install aws-cdk-aws-codeguruprofiler · libregistry