Skip to content

Commit a405195

Browse files
committed
Add tags arg parser for aws
Add the ability to add tags to AMIs when running ore aws upload with --tags flag.
1 parent 6a57089 commit a405195

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

mantle/cmd/ore/aws/upload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ After a successful run, the final line of output will be a line of JSON describi
4141
--ami-name="CoreOS-stable-1234.5.6" \
4242
--ami-description="CoreOS stable 1234.5.6" \
4343
--file="/home/.../coreos_production_ami_vmdk_image.vmdk" \
44-
--tags="machine=production"`,
44+
--tags=machine=production --tags=FedoraGroup=coreos"`,
4545
RunE: runUpload,
4646

4747
SilenceUsage: true,

src/cosalib/aws.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ def aws_run_ore(build, args):
154154
ore_args.extend(['--grant-user', user])
155155
for user in args.grant_user_snapshot:
156156
ore_args.extend(['--grant-user-snapshot', user])
157+
for tag in args.tags:
158+
ore_args.extend(['--tags', tag])
157159
if args.public:
158160
ore_args.extend(['--public'])
159161

@@ -191,4 +193,6 @@ def aws_cli(parser):
191193
parser.add_argument("--grant-user-snapshot", help="Grant user snapshot volume permission",
192194
nargs="*", default=[])
193195
parser.add_argument("--public", action="store_true", help="Mark images as publicly available")
196+
parser.add_argument("--tags", help="list of key=value tags to attach to the AMI",
197+
action='append', default=[])
194198
return parser

0 commit comments

Comments
 (0)