@@ -33,11 +33,10 @@ const getMetrics = require('./getMetrics')
33
33
34
34
/**
35
35
* Define AWS Extras class
36
- * @param {* } params
36
+ * @param {* } params
37
37
*/
38
38
39
39
class Extras {
40
-
41
40
constructor ( config = { } ) {
42
41
this . config = config
43
42
}
@@ -65,40 +64,52 @@ class Extras {
65
64
* type: 'aws_lambda',
66
65
* functionName: 'myLambdaFunction',
67
66
* }
68
- *
67
+ *
69
68
* // AWS Cloudfront
70
69
* {
71
70
* type: 'aws_cloudfront',
72
71
* distributionId: 'ja9fa9j1',
73
72
* }
74
73
*
75
74
*/
76
- getMetrics ( params ) { return getMetrics ( this . config , params ) }
75
+ getMetrics ( params ) {
76
+ return getMetrics ( this . config , params )
77
+ }
77
78
78
79
/**
79
80
* Deploys a CloudFront distribution domain by adding the domain
80
81
*/
81
- deployDistributionDomain ( params ) { return deployDistributionDomain ( this . config , params ) }
82
+ deployDistributionDomain ( params ) {
83
+ return deployDistributionDomain ( this . config , params )
84
+ }
82
85
83
86
/**
84
87
* Deploys a free ACM certificate for the given domain
85
88
*/
86
- deployCertificate ( params ) { return deployCertificate ( this . config , params ) }
89
+ deployCertificate ( params ) {
90
+ return deployCertificate ( this . config , params )
91
+ }
87
92
88
- /**
93
+ /**
89
94
* Deploys a DNS records for a distribution domain
90
95
*/
91
- deployDistributionDns ( params ) { return deployDistributionDns ( this . config , params ) }
96
+ deployDistributionDns ( params ) {
97
+ return deployDistributionDns ( this . config , params )
98
+ }
92
99
93
100
/**
94
101
* Fetches the hosted zone id for the given domain
95
102
*/
96
- getDomainHostedZoneId ( params ) { return getDomainHostedZoneId ( this . config , params ) }
103
+ getDomainHostedZoneId ( params ) {
104
+ return getDomainHostedZoneId ( this . config , params )
105
+ }
97
106
98
107
/**
99
108
* Adds a domain or subdomain to a CloudFront Distribution
100
109
*/
101
- addDomainToDistribution ( params ) { return addDomainToDistribution ( this . config , params ) }
110
+ addDomainToDistribution ( params ) {
111
+ return addDomainToDistribution ( this . config , params )
112
+ }
102
113
103
114
/**
104
115
* Updates or creates an IAM Role and Policy
@@ -109,135 +120,184 @@ class Extras {
109
120
* @param {* } params.service The "Service" section of the assumeRolePolicyDocument
110
121
* @param {* } params.assumeRolePolicyDocument The assumeRolePolicyDocument. Overrides params.service
111
122
*/
112
- deployRole ( params ) { return deployRole ( this . config , params ) }
123
+ deployRole ( params ) {
124
+ return deployRole ( this . config , params )
125
+ }
113
126
114
127
/**
115
128
* Get an AWS IAM Role, its tags, inline policies and managed policies
116
129
* @param {* } params.roleName The name of the IAM Role you want to remove
117
130
*/
118
- getRole ( params ) { return getRole ( this . config , params ) }
131
+ getRole ( params ) {
132
+ return getRole ( this . config , params )
133
+ }
119
134
120
135
/**
121
- * Deletes the given role and all its attached managed and inline policies
136
+ * Deletes the given role and all its attached managed and inline policies
122
137
*/
123
- removeRole ( params ) { return removeRole ( this . config , params ) }
138
+ removeRole ( params ) {
139
+ return removeRole ( this . config , params )
140
+ }
124
141
125
142
/**
126
143
* Deletes all attached managed and inline policies for the given role
127
144
*/
128
- removeRolePolicies ( params ) { return removeRolePolicies ( this . config , params ) }
145
+ removeRolePolicies ( params ) {
146
+ return removeRolePolicies ( this . config , params )
147
+ }
129
148
130
149
/**
131
150
* Updates a lambda if it exists, otherwise creates a new one.
132
151
*/
133
- deployLambda ( params ) { return deployLambda ( this . config , params ) }
152
+ deployLambda ( params ) {
153
+ return deployLambda ( this . config , params )
154
+ }
134
155
135
156
/**
136
157
* Deploys the DNS records for an Api Gateway V2 HTTP custom domain
137
158
*/
138
- deployApigDomainDns ( params ) { return deployApigDomainDns ( this . config , params ) }
159
+ deployApigDomainDns ( params ) {
160
+ return deployApigDomainDns ( this . config , params )
161
+ }
139
162
140
163
/**
141
164
* Updates or creates an AppSync API
142
165
*/
143
- deployAppSyncApi ( params ) { return deployAppSyncApi ( this . config , params ) }
166
+ deployAppSyncApi ( params ) {
167
+ return deployAppSyncApi ( this . config , params )
168
+ }
144
169
145
170
/**
146
171
* Updates or creates an AppSync Schema
147
172
*/
148
- deployAppSyncSchema ( params ) { return deployAppSyncSchema ( this . config , params ) }
173
+ deployAppSyncSchema ( params ) {
174
+ return deployAppSyncSchema ( this . config , params )
175
+ }
149
176
150
177
/**
151
178
* Updates or creates AppSync Resolvers
152
179
*/
153
- deployAppSyncResolvers ( params ) { return deployAppSyncResolvers ( this . config , params ) }
180
+ deployAppSyncResolvers ( params ) {
181
+ return deployAppSyncResolvers ( this . config , params )
182
+ }
154
183
155
184
/**
156
185
* Generates the minimum IAM role policy that is required for the given resolvers.
157
186
*/
158
- getAppSyncResolversPolicy ( params ) { return getAppSyncResolversPolicy ( this . config , params ) }
187
+ getAppSyncResolversPolicy ( params ) {
188
+ return getAppSyncResolversPolicy ( this . config , params )
189
+ }
159
190
160
191
/**
161
192
* Returns the account id of the configured credentials
162
193
*/
163
- getAccountId ( params ) { return getAccountId ( this . config , params ) }
194
+ getAccountId ( params ) {
195
+ return getAccountId ( this . config , params )
196
+ }
164
197
165
198
/**
166
199
* Constructs a Lambda ARN from the given Lambda name
167
200
*/
168
- getLambdaArn ( params ) { return getLambdaArn ( this . config , params ) }
201
+ getLambdaArn ( params ) {
202
+ return getLambdaArn ( this . config , params )
203
+ }
169
204
170
205
/**
171
206
* Constructs an IAM Role ARN from the given Role name
172
207
*/
173
- getRoleArn ( params ) { return getRoleArn ( this . config , params ) }
208
+ getRoleArn ( params ) {
209
+ return getRoleArn ( this . config , params )
210
+ }
174
211
175
212
/**
176
213
* Constructs Table ARN from the given Table name
177
214
*/
178
- getTableArn ( params ) { return getTableArn ( this . config , params ) }
215
+ getTableArn ( params ) {
216
+ return getTableArn ( this . config , params )
217
+ }
179
218
180
219
/**
181
220
* Constructs ElasticSearch ARN from the given ElasticSearch domain
182
221
*/
183
- getElasticSearchArn ( params ) { return getElasticSearchArn ( this . config , params ) }
222
+ getElasticSearchArn ( params ) {
223
+ return getElasticSearchArn ( this . config , params )
224
+ }
184
225
185
226
/**
186
227
* Constructs RDS ARN from the given dbClusterIdentifier
187
228
*/
188
- getRdsArn ( params ) { return getRdsArn ( this . config , params ) }
229
+ getRdsArn ( params ) {
230
+ return getRdsArn ( this . config , params )
231
+ }
189
232
190
233
/**
191
234
* Constructs CloudWatch Log Group ARN from the given lambdaName or logGroupName
192
235
*/
193
- getCloudWatchLogGroupArn ( params ) { return getCloudWatchLogGroupArn ( this . config , params ) }
236
+ getCloudWatchLogGroupArn ( params ) {
237
+ return getCloudWatchLogGroupArn ( this . config , params )
238
+ }
194
239
195
240
/**
196
241
* Removes a Lambda function. Does nothing if already removed.
197
242
*/
198
- removeLambda ( params ) { return removeLambda ( this . config , params ) }
243
+ removeLambda ( params ) {
244
+ return removeLambda ( this . config , params )
245
+ }
199
246
200
247
/**
201
248
* Removes an AppSync API. Does nothing if already removed.
202
249
*/
203
- removeAppSyncApi ( params ) { return removeAppSyncApi ( this . config , params ) }
250
+ removeAppSyncApi ( params ) {
251
+ return removeAppSyncApi ( this . config , params )
252
+ }
204
253
205
254
/**
206
255
* Creates an AppSync API Key that is valid for 1 year
207
256
*/
208
- createAppSyncApiKey ( params ) { return createAppSyncApiKey ( this . config , params ) }
257
+ createAppSyncApiKey ( params ) {
258
+ return createAppSyncApiKey ( this . config , params )
259
+ }
209
260
210
261
/**
211
262
* Updates or creats an AppSync API Key
212
263
*/
213
- deployAppSyncApiKey ( params ) { return deployAppSyncApiKey ( this . config , params ) }
264
+ deployAppSyncApiKey ( params ) {
265
+ return deployAppSyncApiKey ( this . config , params )
266
+ }
214
267
215
268
/**
216
269
* Updates or creats a CloudFront distribution for AppSync API
217
270
*/
218
- deployAppSyncDistribution ( params ) { return deployAppSyncDistribution ( this . config , params ) }
271
+ deployAppSyncDistribution ( params ) {
272
+ return deployAppSyncDistribution ( this . config , params )
273
+ }
219
274
220
275
/**
221
276
* Updates or creats a CloudFront distribution for AppSync API
222
277
*/
223
- deployDistribution ( params ) { return deployDistribution ( this . config , params ) }
278
+ deployDistribution ( params ) {
279
+ return deployDistribution ( this . config , params )
280
+ }
224
281
225
282
/**
226
283
* Disables a CloudFront distribution
227
284
*/
228
- disableDistribution ( params ) { return disableDistribution ( this . config , params ) }
285
+ disableDistribution ( params ) {
286
+ return disableDistribution ( this . config , params )
287
+ }
229
288
230
289
/**
231
290
* Removes a CloudFront distribution. If distribution is enabled, it just disables it.
232
291
* If distribution is already disabled, it removes it completely.
233
292
*/
234
- removeDistribution ( params ) { return removeDistribution ( this . config , params ) }
235
-
293
+ removeDistribution ( params ) {
294
+ return removeDistribution ( this . config , params )
295
+ }
236
296
}
237
297
238
298
/**
239
299
* Export
240
300
*/
241
301
242
- AWS . Extras = Extras ;
243
- module . exports = AWS ;
302
+ AWS . Extras = Extras
303
+ module . exports = AWS
0 commit comments