Git Product home page Git Product logo

aws-samples / aws-cdk-stack-builder-tool Goto Github PK

View Code? Open in Web Editor NEW
186.0 6.0 9.0 14.82 MB

AWS CDK Builder is a browser-based tool designed to streamline bootstrapping of Infrastructure as Code (IaC) projects using the AWS Cloud Development Kit (CDK).

Home Page: https://aws-samples.github.io/aws-cdk-stack-builder-tool/

License: MIT No Attribution

JavaScript 0.32% TypeScript 98.78% HTML 0.20% SCSS 0.70%
cdk cdk-constructs cdk-examples cdk-patterns cdk-utilities

aws-cdk-stack-builder-tool's Introduction

AWS CDK Builder

Release Notes License: MIT

๐Ÿ”ฅ Try AWS CDK Builder ๐Ÿ”ฅ

sample

Table of content

Features

AWS CDK Builder is a browser-based tool designed to streamline bootstrapping of Infrastructure as Code (IaC) projects using the AWS Cloud Development Kit (CDK). Equipped with a dynamic visual designer and instant TypeScript code generation capabilities, the CDK Builder simplifies the construction and deployment of CDK projects. It stands as a resource for all CDK users, providing a platform to explore a broad array of CDK constructs.

sample sample

Deploy

You do not need to deploy the AWS CDK Builder to use it; an online version is available.

https://aws-samples.github.io/aws-cdk-stack-builder-tool

But if you wish to deploy it on your own account, here is a step-by-step guide.

Environment setup

Deploy with AWS Cloud9

We recommend deploying with AWS Cloud9. If you'd like to use Cloud9 to deploy the solution, you will need the following before proceeding:

  • use Amazon Linux 2023 as the platform.

Local deployment

If you have decided not to use AWS Cloud9, verify that your environment satisfies the following prerequisites:

You have:

  1. An AWS account
  2. AdministratorAccess policy granted to your AWS account (for production, we recommend restricting access as needed)
  3. Both console and programmatic access
  4. NodeJS 18 installed
    • If you are using nvm you can run the following before proceeding
    • nvm install 18 && nvm use 18
      
  5. AWS CLI installed and configured to use with your AWS account
  6. Typescript 3.8+ installed
  7. AWS CDK CLI installed
  8. Docker installed
  9. Python 3+ installed

Deployment

  1. Clone the repository
git clone https://github.com/aws-samples/aws-cdk-stack-builder-tool
  1. Move into the cloned repository
cd aws-cdk-stack-builder-tool

3. Install the project dependencies by running this command

npm install
  1. (Optional) Bootstrap AWS CDK on the target account and region

Note: This is required if you have never used AWS CDK on this account and region combination. (More information on CDK bootstrapping).

npx cdk bootstrap aws://{targetAccountId}/{targetRegion}

You can now deploy by running:

npx cdk deploy

You can view the progress of your CDK deployment in the CloudFormation console in the selected region.

  1. Once deployed, take note of the DomainName
...
Outputs:
cdk-builder.DomainName = https://dxxxxxxxxxxxxx.cloudfront.net
...
  1. Open the DomainName Url for the outputs above, i.e. https://dxxxxxxxxxxxxx.cloudfront.net

Clean up

You can remove the stacks and all the associated resources created in your AWS account by running the following command:

npx cdk destroy

Architecture

AWS CDK Builder is a serverless static website application, created using React and TypeScript.

sample

Adding private constructs

If there are constructs which are not in the public npm js registry, they can be added as follows:

  1. Download the npm package:
npm pack <your-package> --pack-destination ./src/react-app/public/constructs
  1. Modify a blueprint to use the newly added package. For example, to change the Blank blueprint:
open ./src/react-app/src/blueprints/cdk-blank.ts
  1. Modify libs: { as follows:
libs: {
  "@aws-cdk/aws-amplify-alpha": "2.x",
  ...
  "@aws-cdk/region-info": "2.x",
  "my-cool-lib-1.2.3.tgz": "local" // <-- This is the line to add, use filename as found in ./src/react-app/src/public/constructs as the key, and "local" as the value
},

Now when a project is created using the modified blueprint, it will have access to the private constructs.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

aws-cdk-stack-builder-tool's People

Contributors

morganpattersonsignet avatar spugachev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aws-cdk-stack-builder-tool's Issues

Ability to point in interface that value should be treated as element of array

In below code generated from tool, "eventName" and "eventSource" attributes should be arrays in the same way as "source" and "detailType":

 new events.Rule(this, "Event_r53dump", {
      eventPattern: {
        detail: {
          eventName: "ChangeResourceRecordSets",
          eventSource: "route53.amazonaws.com",
        },
        detailType: ["AWS API Call via CloudTrail"],
        source: ["aws.route53"],
      },
      targets: [new eventsTargets.LambdaFunction(r53dump)],
    });

It will be great to have ability to influence code generation behavior to add square brackets.

Ability to use conditions in IAM policy statement

Currently condition is added as key value statement where value is double quoted. It will be helpful to be able to decide whereas it is double quote or curly bracket to achieve syntax like { 'aws:SomeField': '1' } for key StringEquals.

Node 16.x is end of life

The README for this project recommends running the project with Node 16, but Node 16 is already end-of-life (as of 11 Sep 2023). The README should recommend Node 18 as a minimum version

how to call static methods

Hi, how can I call static methods on constructs?

For example, say I want to import a Lambda Layer using its ARN rather than creating one from scratch, in CDK I would do this:

const powertoolsLayer = lambda.LayerVersion.fromLayerVersionArn(
      this,
      'PowertoolsLayer',
      `arn:aws:lambda:${cdk.Stack.of(this).region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:23`
    );

How can I do this in the tool?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.