https://github.com/capralifecycle/liflig-cdk-vy
CDK constructs for the Vy internal services, based on nsbno/terraform-provider-vy
https://github.com/capralifecycle/liflig-cdk-vy
Last synced: 16 days ago
JSON representation
CDK constructs for the Vy internal services, based on nsbno/terraform-provider-vy
- Host: GitHub
- URL: https://github.com/capralifecycle/liflig-cdk-vy
- Owner: capralifecycle
- License: mpl-2.0
- Created: 2025-10-29T10:00:36.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2026-06-06T06:59:25.000Z (16 days ago)
- Last Synced: 2026-06-06T08:20:58.777Z (16 days ago)
- Language: TypeScript
- Size: 1.09 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CDK constructs for the Vy internal services
Easily use internal services from Vy in CDK infrastructure code.
This is based on https://github.com/nsbno/terraform-provider-vy
## Usage
```bash
npm install @liflig/cdk-vy
```
### Create a VyCognitoProvider
```typescript
const vyCognitoProvider = new VyCognitoProvider(this, "MyProvider", {
environment: VyEnvironment.TEST,
});
```
### Create a resource server
```typescript
const resourceServer = new CognitoResourceServer(this, "ApiResourceServer", {
resourceServerProvider: vyCognitoProvider.resourceServerProvider,
name: "my-api",
identifier: "https://my-api.vydev.io",
scopes: [
{ name: "read", description: "Read access to the API" },
{ name: "write", description: "Write access to the API" },
],
});
```
### Create app clients
```typescript
// Backend app client for M2M authentication
const backendClient = new CognitoAppClient(this, "BackendClient", {
appClientProvider: vyCognitoProvider.appClientProvider,
name: "my-backend-service",
type: AppClientType.BACKEND,
scopes: ["https://api.vydev.io/read", "https://api.vydev.io/write"]
});
// Access credentials
const clientId = backendClient.clientId;
const clientSecret = backendClient.clientSecret; // Stored in Secrets Manager
@example
// Frontend app client for user authentication
const frontendClient = new CognitoAppClient(this, "FrontendClient", {
appClientProvider: vyCognitoProvider.appClientProvider,
name: "my-web-app",
type: AppClientType.FRONTEND,
scopes: ["email", "openid", "profile"],
callbackUrls: ["https://my-app.vydev.io/auth/callback"],
logoutUrls: ["https://my-app.vydev.io/logout"],
authUrlPath: "/oauth2/token"
});
```