npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@amazon-codecatalyst/blueprints.sam-serverless-application

v0.3.110

Published

This blueprint creates a project that leverages a serverless application model (SAM) to quickly create and deploy an API. You can choose Java, TypeScript, or Python as the programming language

Downloads

17,633

Readme

This Blueprint

This Blueprint generates an AWS Serverless Application Model (SAM) project.

A serverless application is a combination of AWS Lambda functions, event sources, and other resources that work together to perform tasks. A serverless application can also include additional resources such as APIs, databases, and event source mappings. For more information on serverless applications, see the AWS Serverless Application Model (SAM) Developer Guide

The project uses an Amazon CodeCatalyst environment to deploy a SAM application with AWS Lambda and Amazon API Gateway to an Amazon CloudFront URL. After you create your project, you can view the repository, source code, and continuous integration and continuous delivery (CI/CD) workflow for your project. After your workflow runs successfully, your deployed AWS Cloud Development Kit (CDK) application URL is available under the output for your workflow.

Architecture overview

This project uses:

  • Node.js 14
  • Java 11
  • Python 3.9

You can choose any of the above as the programming language.

Architecture diagram

Connections and permissions

Configure your AWS account connection from the AWS accounts tab in your Amazon CodeCatalyst space. Add AWS IAM roles to the account extension to authorize project workflows to access AWS account resources.

The SAM application requires the following IAM roles to build and deploy the application:

IAM role trust policy

{
  "Version": "2012-10-17",
  "Statement": [
      {
          "Sid": "CodeCatalyst",
          "Effect": "Allow",
          "Principal": {
              "Service": [
                  "codecatalyst-runner.amazonaws.com",
                  "codecatalyst.amazonaws.com"
              ]
          },
          "Action": "sts:AssumeRole"
      }
  ]
}

Deploy role policy

Create a role based on the trust policy above, and add the following inline policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "iam:PassRole",
                "iam:DeleteRole",
                "iam:GetRole",
                "iam:TagRole",
                "iam:CreateRole",
                "iam:AttachRolePolicy",
                "iam:DetachRolePolicy",
                "cloudformation:*",
                "lambda:*",
                "apigateway:*"
            ],
            "Resource": "*"
        }
    ]
}

_Note: You must update the policy if you add more resources.

Build role policy

Create a role based on the trust policy above, and add the following inline policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:*",
                "cloudformation:*"
            ],
            "Resource": "*"
        }
    ]
}

Project resources

After being successfully created, this project deploys the following AWS resources:

  • AWS Lambda function(s) - A resource that invokes your code on a high-availability compute infrastructure without provisioning or managing servers. For more information on AWS Lambda, see the AWS Lambda Developer Guide

  • Amazon API Gateway - A resource that creates, publishes, maintains, monitors, and secures REST, HTTP, and WebSocket APIs at any scale. For more information on API Gateway, see the AWS API Gateway Developer Guide

  • IAM role(s) - A resource that secures controlled access to AWS resources such as the AWS Lambda function(s). For more information on IAM, see the AWS IAM User Guide

The deployment status can be viewed in the project's workflow.

This blueprint creates the following Amazon CodeCatalyst resources:

  • Source repository named HelloWorld - A Git repository to store, version, and manage project assets.

    • template.yaml - The template that defines the application's AWS resources, including AWS Lambda functions, Amazon API Gateways, and IAM roles.
    • devfile.yaml - A devfile that defines Dev Environments or development environments that have been built for the cloud.
  • Workflows defined in .codecatalyst/workflows/build-and-release.yaml

    A workflow is an automated procedure that defines how to build, test, and deploy the serverless application. For more information, see the Build, test, and deploy with workflows section of the Amazon CodeCatalyst User Guide.

  • Environment(s) - An abstraction of infrastructure resources that deploy applications. You can use environments can be used to organize deployment actions into a production or non-production environment.

    For more information on environments, see the Organizing deployments using environments section in the Amazon CodeCatalyst User Guide.

  • Dev Environment - A cloud-based development environment. A Dev Environment must be manually created with the generated devfile using the Create Dev Environment operation in Amazon CodeCatalyst.

    For more information on creating Dev Environments, see the Working with Dev Environments section in the Amazon CodeCatalyst User Guide.

Additional resources

See the Amazon CodeCatalyst User Guide for additional information on using the features and resources of Amazon CodeCatalyst.