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

Commit cd0332b

Browse files
authored
Update README.md
1 parent 515802e commit cd0332b

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

README.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
# Serverless AWS SDK
1+
# AWS SDK Extra
22

3-
The aws sdk + powerful high-level serverless utils.
3+
The AWS SDK + a handful of extra convenience methods.
44

55
```js
66
// require the serverless aws sdk.
7-
const aws = require(`@serverless/aws-sdk`)
7+
const aws = require(`@serverless/aws-sdk-extra`)
88

99
// set credentials, as usual.
1010
aws.config.update({
1111
credentials: { accessKeyId: 'xxx', secretAccessKey: 'xxx' },
1212
region: 'us-east-1'
1313
})
1414

15-
// use any service, as usual.
15+
// initialize any service, as usual.
1616
const s3 = new aws.S3()
1717

18-
// use some powerful utils. More info below.
19-
const certificate = await aws.utils.deployCertificate(params)
18+
// initialize the extra service for more power
19+
const extra = new aws.Extra()
20+
21+
// call some powerful extra methods. More info below.
22+
const certificate = await extra.deployCertificate(params)
2023
```
2124

2225
# Reference
@@ -49,7 +52,7 @@ const {
4952
certificateArn,
5053
certificateStatus,
5154
domainHostedZoneId
52-
} = await aws.utils.deployDistributionDomain(params)
55+
} = await extra.deployDistributionDomain(params)
5356
```
5457

5558
# deployCertificate
@@ -61,7 +64,7 @@ const params = {
6164
domain: 'serverless.com'
6265
}
6366

64-
const { certificateArn, certificateStatus, domainHostedZoneId } = await aws.utils.deployCertificate(
67+
const { certificateArn, certificateStatus, domainHostedZoneId } = await extra.deployCertificate(
6568
params
6669
)
6770
```
@@ -76,7 +79,7 @@ const params = {
7679
distributionUrl: 'xxx.cloudfront.net'
7780
}
7881

79-
const { domainHostedZoneId } = await aws.utils.deployDistributionDns(params)
82+
const { domainHostedZoneId } = await extra.deployDistributionDns(params)
8083
```
8184

8285
# addDomainToDistribution
@@ -90,7 +93,7 @@ const params = {
9093
certificateStatus: 'ISSUED'
9194
}
9295

93-
const { domainHostedZoneId } = await aws.utils.addDomainToDistribution(params)
96+
const { domainHostedZoneId } = await extra.addDomainToDistribution(params)
9497
```
9598

9699
# getDomainHostedZoneId
@@ -102,7 +105,7 @@ const params = {
102105
domain: 'serverless.com'
103106
}
104107

105-
const { domainHostedZoneId } = await aws.utils.getDomainHostedZoneId(params)
108+
const { domainHostedZoneId } = await extra.getDomainHostedZoneId(params)
106109
```
107110

108111
# deployRole
@@ -126,7 +129,7 @@ const params = {
126129
}
127130
]
128131
}
129-
const { roleArn } = await aws.utils.deployRole(params)
132+
const { roleArn } = await extra.deployRole(params)
130133
```
131134

132135
Or you can specify the policy as a maanged policy arn string:
@@ -137,7 +140,7 @@ const params = {
137140
service: 'lambda.amazonaws.com',
138141
policy: 'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'
139142
}
140-
const { roleArn } = await aws.utils.deployRole(params)
143+
const { roleArn } = await extra.deployRole(params)
141144
```
142145

143146
If you don't specify a policy property, an admin policy will be created by default.
@@ -151,7 +154,7 @@ const params = {
151154
name: 'my-role'
152155
}
153156

154-
await aws.utils.removeRole(params)
157+
await extra.removeRole(params)
155158
```
156159

157160
# removeRolePolicies
@@ -163,7 +166,7 @@ const params = {
163166
name: 'my-role'
164167
}
165168

166-
await aws.utils.removeRolePolicies(params)
169+
await extra.removeRolePolicies(params)
167170
```
168171

169172
# deployLambda
@@ -184,7 +187,7 @@ const lambdaParams = {
184187
- subnet-xxx
185188
}
186189

187-
const { lambdaArn, lambdaSize, lambdaSha } = await aws.utils.deployLambda(params)
190+
const { lambdaArn, lambdaSize, lambdaSha } = await extra.deployLambda(params)
188191
```
189192

190193
# deployApigDomainDns
@@ -198,7 +201,7 @@ const lambdaParams = {
198201
apigatewayDomainName: 'd-qwertyuiop.xxx.com' // required. The regional endpoint of the APIG custom domain
199202
}
200203

201-
const { domainHostedZoneId } = await aws.utils.deployApigDomainDns(params)
204+
const { domainHostedZoneId } = await extra.deployApigDomainDns(params)
202205
```
203206

204207
# deployAppSyncApi
@@ -211,7 +214,7 @@ const deployAppSyncApiParams = {
211214
apiId: 'xxx' // if provided, updates the API. If not provided, creates a new API
212215
}
213216

214-
const { apiId, apiUrls } = await aws.utils.deployAppSyncApi(params)
217+
const { apiId, apiUrls } = await extra.deployAppSyncApi(params)
215218
```
216219

217220
# deployAppSyncSchema
@@ -224,7 +227,7 @@ const deployAppSyncSchemaParams = {
224227
schema: '...' // valid graphql schema
225228
}
226229

227-
await aws.utils.deployAppSyncApi(params)
230+
await extra.deployAppSyncApi(params)
228231
```
229232

230233
# deployAppSyncResolvers
@@ -249,5 +252,5 @@ const deployAppSyncResolversParams = {
249252
}
250253
}
251254

252-
await aws.utils.deployAppSyncResolvers(params)
255+
await extra.deployAppSyncResolvers(params)
253256
```

0 commit comments

Comments
 (0)