-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathautomation-AwsCreateImage.yml
47 lines (45 loc) · 1.58 KB
/
automation-AwsCreateImage.yml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
args:
- default: true
description: The ID of the instance
name: instanceId
required: true
- description: 'A name for the new image - Constraints: 3-128 alphanumeric characters,
parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/),
dashes (-), single quotes (''), at-signs (@), or underscores(_)'
name: name
required: true
- description: By default, Amazon EC2 attempts to shut down and reboot the instance
before creating the image. If the 'No Reboot' option is set(give value 'true'
for that) Amazon EC2 doesn't shut down the instance before creating the image.
When this option is used, file system integrity on the created image can't be
guaranteed.
name: noReboot
- description: A description for the new image
name: description
comment: Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that
is either running or stopped.
commonfields:
id: AwsCreateImage
version: -1
dependson:
must:
- create-image
name: AwsCreateImage
runonce: false
script: |2
resp = demisto.executeCommand("create-image", demisto.args())
if isError(resp[0]):
demisto.results(resp)
else:
data = demisto.get(resp[0], "Contents.CreateImageResponse")
if data:
data = data if isinstance(data, list) else [data]
data = [{k: formatCell(row[k]) for k in row} for row in data]
demisto.results({"ContentsFormat": formats["table"], "Type": entryTypes["note"], "Contents": data} )
else:
demisto.results("No results.")
scripttarget: 0
system: true
tags:
- Amazon Web Services
type: python