-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathexample_ec2din.xml
61 lines (54 loc) · 2.2 KB
/
example_ec2din.xml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?xml version="1.0" encoding="utf-8"?>
<project name="MyTask" basedir="." default="example-using-for">
<property name="test.aws.access_key" value="your-value-here" />
<property name="test.aws.secret_key" value="your-value-here" />
<property name="test.aws.jar" value="your-value-here" />
<taskdef name="ec2din" classpath="${test.aws.jar}" classname="it.corley.ant.EC2DescribeInstances" />
<target name="example-using-for">
<for param="val">
<ec2din key="${test.aws.access_key}" secret="${test.aws.secret_key}" region="EU" select="dns-name">
<filter name="tag:Name">
<value>instance name</value>
</filter>
</ec2din>
<sequential>
<echo message="instance public DNS: @{val}"/>
</sequential>
</for>
</target>
<target name="example-using-for-single">
<for param="val">
<ec2din key="${test.aws.access_key}" secret="${test.aws.secret_key}" region="EU" select="ip-address">
<filter name="tag:Name" value="single value"/>
</ec2din>
<sequential>
<echo message="instance public DNS: @{val}"/>
</sequential>
</for>
</target>
<target name="example-using-for-multiple">
<for param="val">
<ec2din key="${test.aws.access_key}" secret="${test.aws.secret_key}" region="EU" select="instance-id">
<filter name="tag:Name">
<value>multiple</value>
<value>values</value>
</filter>
</ec2din>
<sequential>
<echo message="instance ID: @{val}"/>
</sequential>
</for>
</target>
<target name="filters-support-wildcards">
<for param="val">
<ec2din key="${test.aws.access_key}" secret="${test.aws.secret_key}" region="EU" select="instance-id">
<filter name="tag:Name">
<value>wildcard-to-the-right-*</value>
</filter>
</ec2din>
<sequential>
<echo message="instance ID: @{val}"/>
</sequential>
</for>
</target>
</project>