ots-aws 1.2.1
Install from the command line:
Learn more about npm packages
$ npm install @sniptt-official/ots-aws@1.2.1
Install via package.json:
"@sniptt-official/ots-aws": "1.2.1"
About this version
Initialise a new CDK app if you don't already have one:
mkdir dev; cd dev
cdk init app --language typescript
npx cdk bootstrap --profile dev
Make sure you're authenticated with the GitHub registry (GitHub PAT with registry:read
access is enough):
npm config set @sniptt-official:registry https://npm.pkg.github.com
npm config set -- '//npm.pkg.github.com/:_authToken' $GITHUB_TOKEN
Install the ots-aws
construct:
npm i @sniptt-official/ots-aws
Add the ots-aws
construct to your stack:
import { Ots } from '@sniptt-official/ots-aws';
import { Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
export class DevStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
// When you run `ots new` the resulting "View URL" will be composed
// using this value. For example:
//
// https://my-ots-web-view.com/burn-secret?id=xxx#xxx
//
// Make sure this web view implements client-side decryption of the secret.
const webViewUrl = 'https://my-ots-web-view.com/burn-secret';
const ots = new Ots(this, 'Ots', { webViewUrl });
}
}
Deploy:
npx cdk deploy DevStack --profile dev
Grab your new API Gateway URL, API key and configure your local ~/.ots.yaml
config:
apiUrl: https://YOUR_API_ID.execute-api.YOUR_REGION.amazonaws.com/prod/secrets
apiKey: YOUR_API_KEY
npm ci
npm run build
npm test
cd lambda-functions
npm ci
npm run build
npm test