From 4c2f1f24e07f1bbb1be79c86bca6d9a6a93654dc Mon Sep 17 00:00:00 2001 From: Flavio Stutz Date: Tue, 23 Jan 2024 23:55:24 +0100 Subject: [PATCH] chore: adding cdk conf for examples --- examples/src/wso2/cdk.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 examples/src/wso2/cdk.ts diff --git a/examples/src/wso2/cdk.ts b/examples/src/wso2/cdk.ts new file mode 100644 index 0000000..669977b --- /dev/null +++ b/examples/src/wso2/cdk.ts @@ -0,0 +1,36 @@ +/* eslint-disable camelcase */ +import { Construct } from 'constructs'; +import { Wso2Api, Wso2ApiProps } from 'cdk-practical-constructs'; + +import { petstoreOpenapi } from './petstore-openapi'; + +export const addWso2Api = (scope: Construct): void => { + // prepare api definition + const wso2Props: Wso2ApiProps = { + wso2Config: { + baseApiUrl: 'https://mywso2.com', + credentialsSecretId: 'shared/wso2-creds', + }, + apiDefinition: { + wso2Version: 'v1', + version: 'v1', + type: 'HTTP', + endpointConfig: { + production_endpoints: { + url: 'http://serverabc.com', + }, + endpoint_type: 'http', + }, + context: '/petstore', + name: 'petstore-sample', + gatewayEnvironments: ['public'], + corsConfiguration: { + accessControlAllowOrigins: ['testwebsite.com'], + }, + }, + openapiDocument: petstoreOpenapi, + }; + + // eslint-disable-next-line no-new + new Wso2Api(scope, 'wso2-petstore', wso2Props); +};