AWS Cloud Development Kit (AWS CDK)

repository·main·Indexed 11 days ago

https://github.com/aws/aws-cdk

An open-source framework for defining cloud infrastructure in code using familiar programming languages to provision AWS resources via AWS CloudFormation. It utilizes high-level, object-oriented abstractions called constructs and includes experimental features like the AppStagingSynthesizer for application-specific staging resources and alpha support for AWS Amplify apps.

Tokens
965.9K
Snippets
2.7K
Records
4.2K
Agent score
95%

What's inside AWS CDK

  1. Overview of Amazon Bedrock AgentCore Construct Library

    main

    The aws-cdk-lib/aws-bedrockagentcore library enables the deployment and operation of highly capable AI agents securely and at scale. It provides infrastructure purpose-built for dynamic agent workloads and works with any framework (such as CrewAI, LangGraph, LlamaIndex, and Strands Agents) and any foundation model (inside or outside of Amazon Bedrock).

    Key primitives provided by this library include:

    • AgentCore Runtime: For deploying agent workloads.
    • Browser: For web-based agent capabilities.
    • Code Interpreter: For executing code in a secure environment.
    • Gateway: For managing inbound/outbound communication.
    • Gateway Target: For defining where gateway traffic is routed (e.g., Lambda, OpenAPI).
    • Memory: For managing agent state and long-term memory.
    • Online Evaluation: For evaluating agent performance in real-time.
  2. Overview of Amazon Bedrock Construct Library

    main

    The @aws-cdk/aws-bedrock-alpha library provides constructs for deploying Amazon Bedrock resources. It specifically facilitates the deployment of Bedrock Agents, allowing you to build generative AI applications that can interact with your existing systems and data sources.

    Key capabilities covered in this library include:

    • Agents: Creating and configuring AI agents, including action groups, memory, and orchestration.
    • Guardrails: Implementing content filters, denied topics, and PII/regex filters to ensure responsible AI usage.
    • Prompts: Managing prompt variants (text, chat, and agent prompts) and versions.
    • Inference Profiles: Using inference profiles and prompt routers to manage model access and routing.
  3. Overview of Custom Resource Handlers

    main

    The @aws-cdk/custom-resource-handlers package provides specialized logic for AWS CloudFormation Custom Resources. These handlers automate complex tasks that standard CloudFormation resources cannot perform directly.

    Handlers are categorized into two types:

    1. Stable Handlers: These are bundled into the main aws-cdk-lib package at build time and are available under aws-cdk-lib/custom-resource-handlers.
    2. Experimental Handlers: These belong to specific -alpha modules (e.g., @aws-cdk/aws-amplify-alpha) and are not part of the main aws-cdk-lib package. You must import them from their respective alpha package.

    When a handler is stabilized, it is moved from its alpha package into aws-cdk-lib.

  4. Overview of Security Guardian

    main

    Security Guardian is a GitHub Action and CLI tool designed to detect broadly scoped IAM principals in CloudFormation templates. It validates changed *.template.json files in pull requests using custom cfn-guard v3 rules.

    Key capabilities include:

    • Broad IAM Principal Detection: Uses CloudFormation intrinsic functions (e.g., Fn::Join with :root) to find risky principals.
    • Cross-account Wildcard Detection: Flags dangerous patterns like "*" or "arn:aws:iam::*:root".
    • Extensible Exemptions: Supports smart exemptions for AWS service defaults and metadata-based suppression.
    • Flexible Execution: Runs both locally and within GitHub Actions, producing human-readable and machine-parsable summaries.
  5. Amazon GameLift Construct Library Overview

    main

    The @aws-cdk/aws-gamelift-alpha module provides constructs to define and manage Amazon GameLift resources. Amazon GameLift is a service for deploying, operating, and scaling dedicated, low-cost servers for session-based multiplayer games.

    Key components supported by this library include:

    • GameLift FlexMatch: A customizable matchmaking service where you define rulesets to group players.
    • GameLift Hosting: Tools to deploy and scale dedicated game servers.
    • GameLift FleetIQ: Optimizes the use of Amazon EC2 Spot Instances for cost-effective hosting.
  6. Find or contribute AWS X-Ray construct libraries

    main

    Since official L2 constructs are not yet available in the core library, you have two options:

    1. Search Construct Hub: Look for community-maintained X-Ray construct libraries at https://constructs.dev/search?q=xray.
    2. Use L1 Constructs: Use the automatically generated L1 constructs provided in aws-cdk-lib/aws-xray, which follow the CloudFormation AWS::XRay resource specification.

    If you are interested in contributing hand-written L2 constructs, you can submit an RFC via the CDK Contributing Guide.

  7. Use Alexa Skills Kit (ASK) in AWS CDK

    main

    The alexa-ask module currently does not contain hand-written L2 constructs. To work with Alexa Skills Kit in your CDK applications, you should use the automatically generated L1 constructs. These L1 constructs map directly to the CloudFormation Alexa::ASK resources. Use them in the same way you would define CloudFormation resources directly.

    import * as alexa_ask from 'aws-cdk-lib/alexa-ask';
  8. Use the CloudWatch Alarm Actions library

    main

    The CloudWatch Alarm Actions library provides classes that allow you to automate responses when a CloudWatch Alarm triggers. Instead of just sending an SNS notification, you can trigger specific AWS service actions directly from the alarm.

    Supported actions include:

    • EC2 Actions
    • SNS Actions
    • SSM OpsCenter Actions
    • Autoscaling Actions
    • Application Autoscaling Actions
    • Lambda Actions
  9. Use the AWS Glue Construct Library

    main

    The @aws-cdk/aws-glue-alpha module provides L2 constructs for AWS Glue, a serverless data integration service. These constructs offer convenience methods for common use cases and set default parameters aligned with AWS best practices for different job types (Spark, Python Shell, and Ray).

    Warning: Experimental API This module is in an experimental state. The APIs are under active development and are not subject to Semantic Versioning. They may undergo non-backward compatible changes or be removed in future versions. You should be prepared to update your code when upgrading this package.

  10. Use Amazon DynamoDB Accelerator (DAX) in AWS CDK

    main

    The aws-dax module provides access to Amazon DynamoDB Accelerator resources. Currently, this module only contains automatically generated L1 constructs. There are no hand-written (L2) constructs available in the official library yet.

    To use DAX in your CDK application, you can:

    1. Use the automatically generated L1 constructs provided in this module. These map directly to AWS CloudFormation AWS::DAX resources.
    2. Search Construct Hub for community-maintained DAX construct libraries.
    import * as dax from 'aws-cdk-lib/aws-dax';