1+ #!/usr/bin/env node
2+ /*****************************************************************************
3+ * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
4+ * *
5+ * Licensed under the Apache License, Version 2.0 (the "License"). You may *
6+ * not use this file except in compliance with the License. A copy of the *
7+ * License is located at *
8+ * *
9+ * http://www.apache.org/licenses/LICENSE-2.0 *
10+ * *
11+ * or in the 'license' file accompanying this file. This file is distributed *
12+ * on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, *
13+ * express or implied. See the License for the specific language governing *
14+ * permissions and limitations under the License. *
15+ *****************************************************************************/
16+
17+ import * as cdk from '@aws-cdk/core' ;
18+ import { AwsInstanceSchedulerStack } from '../lib/aws-instance-scheduler-stack' ;
19+ import { AwsInstanceSchedulerRemoteStack } from '../lib/aws-instance-scheduler-remote-stack' ;
20+
21+ const SOLUTION_VERSION = process . env [ 'DIST_VERSION' ] || '%%VERSION%%' ;
22+ const SOLUTION_NAME = process . env [ 'SOLUTION_NAME' ] ;
23+ const SOLUTION_ID = process . env [ 'SOLUTION_ID' ] ;
24+ const SOLUTION_BUCKET = process . env [ 'DIST_OUTPUT_BUCKET' ] ;
25+ const SOLUTION_TMN = process . env [ 'SOLUTION_TRADEMARKEDNAME' ] ;
26+ const SOLUTION_PROVIDER = 'AWS Solution Development' ;
27+
28+ const app = new cdk . App ( ) ;
29+
30+
31+ new AwsInstanceSchedulerStack ( app , 'instance-scheduler' , {
32+ description : '(' + SOLUTION_ID + ') - ' + SOLUTION_NAME + ', version ' + SOLUTION_VERSION ,
33+ solutionId : SOLUTION_ID ,
34+ solutionTradeMarkName : SOLUTION_TMN ,
35+ solutionProvider : SOLUTION_PROVIDER ,
36+ solutionBucket : SOLUTION_BUCKET ,
37+ solutionName : SOLUTION_NAME ,
38+ solutionVersion : SOLUTION_VERSION
39+ } ) ;
40+ new AwsInstanceSchedulerRemoteStack ( app , 'instance-scheduler-remote' , {
41+ description : '(' + SOLUTION_ID + ') - ' + SOLUTION_NAME + ' cross account role, version ' + SOLUTION_VERSION ,
42+ solutionId : SOLUTION_ID ,
43+ solutionTradeMarkName : SOLUTION_TMN ,
44+ solutionProvider : SOLUTION_PROVIDER ,
45+ solutionBucket : SOLUTION_BUCKET ,
46+ solutionName : SOLUTION_NAME ,
47+ solutionVersion : SOLUTION_VERSION
48+ } ) ;
0 commit comments