@@ -7,29 +7,52 @@ Current Features / Supported AWS Products
7
7
-----------------------------------------
8
8
9
9
* S3
10
- * Create or delete buckets
11
- * Upload or delete objects
10
+ * Create bucket
11
+ * Delete bucket
12
+ * Upload object(s)
13
+ * Delete object(s)
12
14
* File sync
13
15
* EC2
16
+ * Run instance
14
17
* Start instance
15
18
* Stop instance
16
- * Authorize security group permissions
19
+ * Terminate instance
20
+ * Import key
21
+ * Authorize security group ingress permissions
22
+ * Authorize security group egress permissions
23
+ * Revoke security group ingress permissions
24
+ * Revoke security group egress permissions
17
25
* Wait instance for specific status
18
- * ELB
19
- * (TBD)
26
+ * RDS
27
+ * Create DB instance
28
+ * Delete DB instance
29
+ * Modify DB instance
30
+ * Migrate (create or modify) DB instance
31
+ * Reboot DB instance
32
+ * Wait DB instance for specific status
20
33
* Route53
21
- * Create or delete hosted zones
22
- * Change record sets
23
- * CloudFormation
24
- * Migrate (create or update) stacks
25
- * Delete stacks
26
- * Wait stack for specific status
34
+ * Create hosted zone
35
+ * Delete hosted zone
36
+ * Change record set
27
37
* Elastic Beanstalk
28
38
* Create or delete applications
29
39
* Create or terminate environments
30
40
* Create or delete configuration templates
31
41
* Create or delete application versions
32
42
* Wait environment for specific status
43
+ * CloudFormation
44
+ * Migrate (create or update) stack
45
+ * Delete stack
46
+ * Wait stack for specific status
47
+ * Lambda
48
+ * Create function
49
+ * Update function code
50
+ * Update function configuration
51
+ * Migrate (create or update) function
52
+ * Invoke function
53
+ * Delete function
54
+ * ELB
55
+ * (TBD)
33
56
34
57
Requirements
35
58
------------
64
87
These credentials are used to make API accesses by default.
65
88
66
89
67
- ### Implements tasks to start and stop bastion instance
90
+ ### S3 files tasks
91
+
92
+ ```
93
+ apply plugin: 'aws-s3'
94
+
95
+ task syncObjects(type: jp.classmethod.aws.gradle.s3.SyncTask) {
96
+ bucketName 'foobar.example.com'
97
+ source file('path/to/objects')
98
+ }
99
+ ```
100
+
101
+ Look [ S3 example 1] ( samples/01-s3-upload-simple ) and [ S3 example 2] ( samples/02-s3-sync-contents ) for more information.
102
+
103
+
104
+ ### EC2 instance tasks
68
105
69
106
```
70
107
apply plugin: 'aws-ec2'
@@ -84,38 +121,47 @@ task startBastion(type: jp.classmethod.aws.gradle.ec2.AmazonEC2StartInstanceTask
84
121
}
85
122
```
86
123
87
- ### Implements sync S3 files task
124
+ Look [ EC2 example ] ( samples/03-ec2 ) for more information.
88
125
89
- ```
90
- apply plugin: 'aws-s3'
91
126
92
- task syncObjects(type: jp.classmethod.aws.gradle.s3.SyncTask) {
93
- bucketName 'foobar.example.com'
94
- source file('path/to/objects')
95
- }
127
+ ### RDS DB instance tasks
128
+
96
129
```
130
+ apply plugin: "aws-rds"
97
131
98
- ### Implements tasks to migrate and delete stack
132
+ // You can overwrite default credentials and region settings like this:
133
+ // rds {
134
+ // profileName 'another-credentials-profile-name' // optional
135
+ // region = 'us-east-1'
136
+ // }
99
137
100
- ```
101
- apply plugin: 'aws-cloudformation'
138
+ task migrateDBInstance(type: AmazonRDSMigrateDBInstanceTask) {
139
+ dbInstanceIdentifier = "foobar"
140
+ allocatedStorage = 5
141
+ dbInstanceClass = "db.t2.micro"
142
+ engine = "MySQL"
143
+ masterUsername = "root"
144
+ masterUserPassword = "passW0rd"
145
+ vpcSecurityGroupIds = [ "sg-d3958fbf" ]
146
+ dbSubnetGroupName = "default"
147
+ multiAZ = false
148
+ publiclyAccessible = true
149
+ }
102
150
103
- cloudFormation {
104
- stackName 'foobar-stack'
105
- stackParams([
106
- Foo: 'bar',
107
- Baz: 'qux'
108
- ])
109
- capabilityIam true
110
- templateFile project.file("foobar.template")
111
- templateBucket 'example-bucket'
112
- templateKeyPrefix 'foobar/'
151
+ task rebootDBInstance(type: AmazonRDSRebootDBInstanceTask) {
152
+ dbInstanceIdentifier = "foobar"
113
153
}
114
154
115
- // awsCfnMigrateStack and awsCfnDeleteStack task (and so on) is declared.
155
+ task deleteDBInstance(type: AmazonRDSDeleteDBInstanceTask) {
156
+ dbInstanceIdentifier = "foobar"
157
+ skipFinalSnapshot = true
158
+ }
116
159
```
117
160
118
- ### Implemets create / delete hosted zone task
161
+ Look [ RDS example] ( samples/07-rds ) for more information.
162
+
163
+
164
+ ### Route 53 hosted zone tasks
119
165
120
166
```
121
167
apply plugin: 'aws-route53'
@@ -130,7 +176,10 @@ task deleteHostedZone(type: jp.classmethod.aws.gradle.route53.DeleteHostedZoneTa
130
176
}
131
177
```
132
178
133
- ### Implements tasks to manage Elastic Beanstalk environemnt
179
+ Look [ Route 53 example] ( samples/04-route53 ) for more information.
180
+
181
+
182
+ ### Elastic Beanstalk environemnt tasks
134
183
135
184
```
136
185
apply plugin: 'aws-beanstalk'
@@ -170,6 +219,74 @@ beanstalk {
170
219
// task awsEbMigrateEnvironment, awsEbDeleteApplication and so on are declared
171
220
```
172
221
222
+ Look [ Elastic Beanstalk example] ( samples/05-beanstalk ) for more information.
223
+
224
+
225
+ ### CloudFormation stack tasks
226
+
227
+ ```
228
+ apply plugin: 'aws-cloudformation'
229
+
230
+ cloudFormation {
231
+ stackName 'foobar-stack'
232
+ stackParams([
233
+ Foo: 'bar',
234
+ Baz: 'qux'
235
+ ])
236
+ capabilityIam true
237
+ templateFile project.file("foobar.template")
238
+ templateBucket 'example-bucket'
239
+ templateKeyPrefix 'foobar/'
240
+ }
241
+
242
+ // awsCfnMigrateStack and awsCfnDeleteStack task (and so on) is declared.
243
+ ```
244
+
245
+ Look [ CloudFormation example] ( samples/06-cloudformation ) for more information.
246
+
247
+
248
+ ### Lambda function tasks
249
+
250
+ ```
251
+ apply plugin:'base'
252
+ apply plugin: "aws-lambda"
253
+ aws {
254
+ profileName "default"
255
+ region "ap-northeast-1"
256
+ }
257
+
258
+ lambda {
259
+ region "us-east-1"
260
+ }
261
+
262
+ task zip(type: Zip) {
263
+ from "function/"
264
+ destinationDir file("build")
265
+ }
266
+
267
+ task migrateFunction(type: AWSLambdaMigrateFunctionTask, dependsOn: zip) {
268
+ functionName = "foobar"
269
+ role = "arn:aws:iam::${aws.accountId}:role/lambda-poweruser"
270
+ zipFile = zip.archivePath
271
+ handler = "DecodeBase64.handler"
272
+ }
273
+
274
+ task invokeFunction(type: AWSLambdaInvokeTask) {
275
+ functionName = "foobar"
276
+ invocationType = InvocationType.RequestResponse
277
+ payload = file("sample-input/input.txt")
278
+ doLast {
279
+ println "Lambda function result: " + new String(invokeResult.payload.array(), "UTF-8")
280
+ }
281
+ }
282
+
283
+ task deleteFunction(type: AWSLambdaDeleteFunctionTask) {
284
+ functionName = "foobar"
285
+ }
286
+ ```
287
+
288
+ Look [ Lambda example] ( samples/08-lambda ) for more information.
289
+
173
290
174
291
License
175
292
-------
0 commit comments