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

@glicogh/healthcare-cdk

v0.1.19

Published

CDK automations

Downloads

592

Readme

Welcome to your CDK TypeScript project

This is a blank project for CDK development with TypeScript.

The cdk.json file tells the CDK Toolkit how to execute your app.

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform the jest unit tests
  • npx cdk deploy deploy this stack to your default AWS account/region
  • npx cdk diff compare deployed stack with current state
  • npx cdk synth emits the synthesized CloudFormation template

Local setup

AWS CLI

Follow these steps to setup the AWS CLI in order to run CDK commands

aws configure sso --profile glicogh-uat

This will prompt you to enter further details. Here's an example

SSO session name (Recommended): isa
SSO start URL [None]: https://glicogh.awsapps.com/start/
SSO region [None]: us-east-1
SSO registration scopes [sso:account:access]:

This will open up the sso URL in a browser for you to auhtorize the CLI. After the authorization, the CLI will present all the AWS accounts (available to your user account) for you to make a selection. Here's an example of the prompt

There are 4 AWS accounts available to you.
> GLICO-Ghana, [email protected] (169555392631)
  Healthcare Microservices Dev, [email protected] (640168444097)
  Healthcare Microservices Prod, [email protected] (273354667305)
  Healthcare Microservices UAT, [email protected] (825765383017)

Select the account that best suits the environment you're trying to build in. Once you make a selection, there will be a confirmation and another prompt that looks like the following

Using the account ID 825765383017
The only role available to you is: AdministratorAccess_
Using the role name "AdministratorAccess_"
CLI default client Region [None]: eu-west-2
CLI default output format [None]: json

To use this profile, specify the profile name using --profile, as shown:

aws s3 ls --profile glicogh-uat

CDK CLI

npm install -g aws-cdk

Testing setup

Run the following to list available stack

cdk --profile glicogh-uat --context env=uat ls

The output looks like this

MicroserviceNetwork
MicroserviceRedis
MicroserviceMySQL

Running the CDK

Shared stack

The following stack are meant to be deployed once and shared across the microservices. These would typically be deployed from a local machine as opposed to within a CI/CD pipeline

  • MicroserviceNetwork
  • MicroserviceInfraAuth
  • MicroserviceRedis
  • MicroserviceMySQL

The only required option for these stack is env. For example, to deploy MicroserviceNetwork in the UAT environment, you would run the command

cdk --profile glicogh-uat --context env=uat deploy MicroserviceNetwork

Pipeline-based stack

The following stack on the other hand, are meant to deploy a new set of resources on each CDK deployment. These can also be thought of as the stack that have a GIT repository.

  • MicroserviceApiGateway
  • MicroservicePortal
  • MicroserviceLaravelBased
  • MicroserviceNotificationService

These are typically microservice stack and will be triggered each time code is merged into the release branch of a microservice repo. These stack will not be ran directly in this project, but rather from within each microservice project as a dependency. For example, to deploy the account microservice in the UAT environment, you would run the command

cdk --profile glicogh-uat --context env=uat --context version=1.0.1 --context service=account deploy

These stack can also be versioned.

The service option can also be passed in a .env

The above command is what you would run in the CDK CLI. However, you would typically be running the deployment in a CI/CD pipeline such as Github Actions, in which case the command may be different. You would have to refer to the CI/CD platform's documentation for how to achieve this.

Using as dependency

Follow these steps to setup CDK in a repository.

This assumes you are in the root of the project

# delete CDK folder if it already exists
rm -rf .infra/cdk
# create CDK folder
mkdir -p .infra/cdk
# change working directory to the CDK directory
cd .infra/cdk
# initialize CDK
cdk init app --language typescript
# install package as a dependency
npm i @glicogh/healthcare-cdk
# copy env
cp node_modules/@glicogh/healthcare-cdk/.env.example .env.example
# copy CDK initialization file
cp node_modules/@glicogh/healthcare-cdk/cdk.example.ts bin/cdk.ts

Now you can clone the file .env.example for each of the target environments (for example, .env.uat) and edit the variables appropriately for the target environment.

For the laravel-based projects, the package is able to perform all the steps/commands for you by running php artisan glico:healthcare:microservice:cdk