-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgo.py
More file actions
executable file
·31 lines (22 loc) · 1.4 KB
/
go.py
File metadata and controls
executable file
·31 lines (22 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
from argparse import ArgumentParser
from utils.imaging import Builder
from utils import GoUtils
parser = ArgumentParser(description='Cornell University AWS AppStream 2.0 Framework')
parser.add_argument('-s', '--stack', type=str, default='AppstreamFramework', help='The CFN Stack Name to use. Default: appstream-framework')
parser.add_argument('-d', '--deploy', action='store_true', help='Deploy the template to CFN.')
parser.add_argument('-u', '--update', action='store_true', help='Update existing stack.')
parser.add_argument('-p', '--profile', type=str, default=None, help='The AWS account profile to use. Only needed if not on an EC2 instance in the desired account with the proper Instance Profile')
parser.add_argument('-r', '--region', type=str, default='us-east-1', help='The AWS region to use. Default: us-east-1')
parser.add_argument('-l', '--log_level', type=str, default='INFO', help='Log Level for Go Script. Default: INFO')
parser.add_argument('-b', '--build_image', action='store_true', help='Auto-Deploy Image Builder')
parser.add_argument('--packages', nargs='+', type=str, help='List of software packages to install')
args = parser.parse_args()
utils = GoUtils(args)
t = utils.get_framework_template()
if args.deploy:
utils.deploy_template(args.stack, t, utils.config['Tags'])
elif args.build_image:
b = Builder(utils)
b.deploy_image_config()
b.deploy_image_builder()