Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 515802e

Browse files
committed
merged extra branch
1 parent 57c1992 commit 515802e

File tree

2 files changed

+99
-40
lines changed

2 files changed

+99
-40
lines changed

src/deployAppSyncResolvers.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const { sleep } = require('./utils')
55
const getRoleArn = require('./getRoleArn')
66
const getLambdaArn = require('./getLambdaArn')
77

8-
98
const listResolvers = async (config, params) => {
109
const appSync = new AWS.AppSync(config)
1110

src/index.js

Lines changed: 99 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ const getMetrics = require('./getMetrics')
3333

3434
/**
3535
* Define AWS Extras class
36-
* @param {*} params
36+
* @param {*} params
3737
*/
3838

3939
class Extras {
40-
4140
constructor(config = {}) {
4241
this.config = config
4342
}
@@ -65,40 +64,52 @@ class Extras {
6564
* type: 'aws_lambda',
6665
* functionName: 'myLambdaFunction',
6766
* }
68-
*
67+
*
6968
* // AWS Cloudfront
7069
* {
7170
* type: 'aws_cloudfront',
7271
* distributionId: 'ja9fa9j1',
7372
* }
7473
*
7574
*/
76-
getMetrics(params) { return getMetrics(this.config, params) }
75+
getMetrics(params) {
76+
return getMetrics(this.config, params)
77+
}
7778

7879
/**
7980
* Deploys a CloudFront distribution domain by adding the domain
8081
*/
81-
deployDistributionDomain(params) { return deployDistributionDomain(this.config, params) }
82+
deployDistributionDomain(params) {
83+
return deployDistributionDomain(this.config, params)
84+
}
8285

8386
/**
8487
* Deploys a free ACM certificate for the given domain
8588
*/
86-
deployCertificate(params) { return deployCertificate(this.config, params) }
89+
deployCertificate(params) {
90+
return deployCertificate(this.config, params)
91+
}
8792

88-
/**
93+
/**
8994
* Deploys a DNS records for a distribution domain
9095
*/
91-
deployDistributionDns(params) { return deployDistributionDns(this.config, params) }
96+
deployDistributionDns(params) {
97+
return deployDistributionDns(this.config, params)
98+
}
9299

93100
/**
94101
* Fetches the hosted zone id for the given domain
95102
*/
96-
getDomainHostedZoneId(params) { return getDomainHostedZoneId(this.config, params) }
103+
getDomainHostedZoneId(params) {
104+
return getDomainHostedZoneId(this.config, params)
105+
}
97106

98107
/**
99108
* Adds a domain or subdomain to a CloudFront Distribution
100109
*/
101-
addDomainToDistribution(params) { return addDomainToDistribution(this.config, params) }
110+
addDomainToDistribution(params) {
111+
return addDomainToDistribution(this.config, params)
112+
}
102113

103114
/**
104115
* Updates or creates an IAM Role and Policy
@@ -109,135 +120,184 @@ class Extras {
109120
* @param {*} params.service The "Service" section of the assumeRolePolicyDocument
110121
* @param {*} params.assumeRolePolicyDocument The assumeRolePolicyDocument. Overrides params.service
111122
*/
112-
deployRole(params) { return deployRole(this.config, params) }
123+
deployRole(params) {
124+
return deployRole(this.config, params)
125+
}
113126

114127
/**
115128
* Get an AWS IAM Role, its tags, inline policies and managed policies
116129
* @param {*} params.roleName The name of the IAM Role you want to remove
117130
*/
118-
getRole(params) { return getRole(this.config, params) }
131+
getRole(params) {
132+
return getRole(this.config, params)
133+
}
119134

120135
/**
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
122137
*/
123-
removeRole(params) { return removeRole(this.config, params) }
138+
removeRole(params) {
139+
return removeRole(this.config, params)
140+
}
124141

125142
/**
126143
* Deletes all attached managed and inline policies for the given role
127144
*/
128-
removeRolePolicies(params) { return removeRolePolicies(this.config, params) }
145+
removeRolePolicies(params) {
146+
return removeRolePolicies(this.config, params)
147+
}
129148

130149
/**
131150
* Updates a lambda if it exists, otherwise creates a new one.
132151
*/
133-
deployLambda(params) { return deployLambda(this.config, params) }
152+
deployLambda(params) {
153+
return deployLambda(this.config, params)
154+
}
134155

135156
/**
136157
* Deploys the DNS records for an Api Gateway V2 HTTP custom domain
137158
*/
138-
deployApigDomainDns(params) { return deployApigDomainDns(this.config, params) }
159+
deployApigDomainDns(params) {
160+
return deployApigDomainDns(this.config, params)
161+
}
139162

140163
/**
141164
* Updates or creates an AppSync API
142165
*/
143-
deployAppSyncApi(params) { return deployAppSyncApi(this.config, params) }
166+
deployAppSyncApi(params) {
167+
return deployAppSyncApi(this.config, params)
168+
}
144169

145170
/**
146171
* Updates or creates an AppSync Schema
147172
*/
148-
deployAppSyncSchema(params) { return deployAppSyncSchema(this.config, params) }
173+
deployAppSyncSchema(params) {
174+
return deployAppSyncSchema(this.config, params)
175+
}
149176

150177
/**
151178
* Updates or creates AppSync Resolvers
152179
*/
153-
deployAppSyncResolvers(params) { return deployAppSyncResolvers(this.config, params) }
180+
deployAppSyncResolvers(params) {
181+
return deployAppSyncResolvers(this.config, params)
182+
}
154183

155184
/**
156185
* Generates the minimum IAM role policy that is required for the given resolvers.
157186
*/
158-
getAppSyncResolversPolicy(params) { return getAppSyncResolversPolicy(this.config, params) }
187+
getAppSyncResolversPolicy(params) {
188+
return getAppSyncResolversPolicy(this.config, params)
189+
}
159190

160191
/**
161192
* Returns the account id of the configured credentials
162193
*/
163-
getAccountId(params) { return getAccountId(this.config, params) }
194+
getAccountId(params) {
195+
return getAccountId(this.config, params)
196+
}
164197

165198
/**
166199
* Constructs a Lambda ARN from the given Lambda name
167200
*/
168-
getLambdaArn(params) { return getLambdaArn(this.config, params) }
201+
getLambdaArn(params) {
202+
return getLambdaArn(this.config, params)
203+
}
169204

170205
/**
171206
* Constructs an IAM Role ARN from the given Role name
172207
*/
173-
getRoleArn(params) { return getRoleArn(this.config, params) }
208+
getRoleArn(params) {
209+
return getRoleArn(this.config, params)
210+
}
174211

175212
/**
176213
* Constructs Table ARN from the given Table name
177214
*/
178-
getTableArn(params) { return getTableArn(this.config, params) }
215+
getTableArn(params) {
216+
return getTableArn(this.config, params)
217+
}
179218

180219
/**
181220
* Constructs ElasticSearch ARN from the given ElasticSearch domain
182221
*/
183-
getElasticSearchArn(params) { return getElasticSearchArn(this.config, params) }
222+
getElasticSearchArn(params) {
223+
return getElasticSearchArn(this.config, params)
224+
}
184225

185226
/**
186227
* Constructs RDS ARN from the given dbClusterIdentifier
187228
*/
188-
getRdsArn(params) { return getRdsArn(this.config, params) }
229+
getRdsArn(params) {
230+
return getRdsArn(this.config, params)
231+
}
189232

190233
/**
191234
* Constructs CloudWatch Log Group ARN from the given lambdaName or logGroupName
192235
*/
193-
getCloudWatchLogGroupArn(params) { return getCloudWatchLogGroupArn(this.config, params) }
236+
getCloudWatchLogGroupArn(params) {
237+
return getCloudWatchLogGroupArn(this.config, params)
238+
}
194239

195240
/**
196241
* Removes a Lambda function. Does nothing if already removed.
197242
*/
198-
removeLambda(params) { return removeLambda(this.config, params) }
243+
removeLambda(params) {
244+
return removeLambda(this.config, params)
245+
}
199246

200247
/**
201248
* Removes an AppSync API. Does nothing if already removed.
202249
*/
203-
removeAppSyncApi(params) { return removeAppSyncApi(this.config, params) }
250+
removeAppSyncApi(params) {
251+
return removeAppSyncApi(this.config, params)
252+
}
204253

205254
/**
206255
* Creates an AppSync API Key that is valid for 1 year
207256
*/
208-
createAppSyncApiKey(params) { return createAppSyncApiKey(this.config, params) }
257+
createAppSyncApiKey(params) {
258+
return createAppSyncApiKey(this.config, params)
259+
}
209260

210261
/**
211262
* Updates or creats an AppSync API Key
212263
*/
213-
deployAppSyncApiKey(params) { return deployAppSyncApiKey(this.config, params) }
264+
deployAppSyncApiKey(params) {
265+
return deployAppSyncApiKey(this.config, params)
266+
}
214267

215268
/**
216269
* Updates or creats a CloudFront distribution for AppSync API
217270
*/
218-
deployAppSyncDistribution(params) { return deployAppSyncDistribution(this.config, params) }
271+
deployAppSyncDistribution(params) {
272+
return deployAppSyncDistribution(this.config, params)
273+
}
219274

220275
/**
221276
* Updates or creats a CloudFront distribution for AppSync API
222277
*/
223-
deployDistribution(params) { return deployDistribution(this.config, params) }
278+
deployDistribution(params) {
279+
return deployDistribution(this.config, params)
280+
}
224281

225282
/**
226283
* Disables a CloudFront distribution
227284
*/
228-
disableDistribution(params) { return disableDistribution(this.config, params) }
285+
disableDistribution(params) {
286+
return disableDistribution(this.config, params)
287+
}
229288

230289
/**
231290
* Removes a CloudFront distribution. If distribution is enabled, it just disables it.
232291
* If distribution is already disabled, it removes it completely.
233292
*/
234-
removeDistribution(params) { return removeDistribution(this.config, params) }
235-
293+
removeDistribution(params) {
294+
return removeDistribution(this.config, params)
295+
}
236296
}
237297

238298
/**
239299
* Export
240300
*/
241301

242-
AWS.Extras = Extras;
243-
module.exports = AWS;
302+
AWS.Extras = Extras
303+
module.exports = AWS

0 commit comments

Comments
 (0)