@tazbruce/pulumi-quickstart-library
v2.0.1
Published
Pulumi infra library for building and deploying an API
Downloads
1
Readme
pulumi-quickstart-library
This is a Pulumi Component Library built to allow for extremely quick API creation. In particular, this library is designed to provide a fast and simple way to deploy a containerised API to Google Cloud Run, and then expose it to the internet via AWS Api Gateway.
Requirements
- Node.js
- Pulumi
- Docker
- Google Cloud SDK
- Google Cloud Project
- Google Cloud Service Account
- AWS CLI
- AWS Account
- AWS IAM User
- AWS Route53 Hosted Zone
Installation
npm install @tazbruce/infra-api-library
Usage
Container Component
Pulumi Config Requirements
gcp:project
- Google Cloud Project IDgcp:region
- Google Cloud Regiongcp:credentials
- Google Cloud Service Account Credentials
import { ContainerComponent } from '@tazbruce/infra-api-library';
const container = new ContainerComponent("container", {
environment: environment, // dev, staging, prod
imageName: imageName, // name of the image to use
appPath: appPath, // path of the app
memory: memory, // memory to allocate
cpu: cpu, // cpu to allocate
containerPort: containerPort, // port to expose
concurrency: concurrency, // max concurrent requests
});
Api Component
Pulumi Config Requirements
aws:region
- AWS Regionaws:accessKey
- AWS Access Keyaws:secretKey
- AWS Secret Key
import { ApiComponent } from '@tazbruce/infra-api-library';
const api = new ApiComponent("api", {
environment: environment, // dev, staging, prod
imageName: imageName, // name of the image to use
containerUrl: containerComponent.serviceUrl, // url of the container
appDomain: appUrl, // domain of the app
apiDomain: apiDomain, // domain of the api
});
Contributing
See CONTRIBUTING.md for details on how to contribute to this library.
License
This library is licensed under the MIT License. See the LICENSE file.