Skip to content

Commit

Permalink
chore: adding cdk conf for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviostutz authored and Flavio Stutz committed Jan 23, 2024
1 parent d2e2924 commit 4c2f1f2
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions examples/src/wso2/cdk.ts
Original file line number Diff line number Diff line change
@@ -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);
};

0 comments on commit 4c2f1f2

Please sign in to comment.