All Projects → serverless → aws-sdk-extra

serverless / aws-sdk-extra

Licence: other
The AWS SDK + a handful of extra convenience methods.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to aws-sdk-extra

swarm-gcp-faas
Setup OpenFaaS on Google Cloud with Terraform, Docker Swarm and Weave
Stars: ✭ 15 (-16.67%)
Mutual labels:  faas
utils.js
Fast, small and purely functional utility library
Stars: ✭ 132 (+633.33%)
Mutual labels:  utils
aws-mobilehub-helper-ios
ARCHIVED: Use https://github.com/aws/aws-sdk-ios/
Stars: ✭ 41 (+127.78%)
Mutual labels:  aws-sdk
py-eth-sig-utils
Collection of python functions to generate hashes for signing on Ethereum
Stars: ✭ 18 (+0%)
Mutual labels:  utils
openfaas-rstats-templates
OpenFaaS templates for R
Stars: ✭ 17 (-5.56%)
Mutual labels:  faas
tencent-tensorflow-scf
A template project for serverless functions for Tensorflow inference on Tencent Cloud.
Stars: ✭ 38 (+111.11%)
Mutual labels:  faas
faas-fargate
OpenFaaS on AWS Fargate. Open source Functions as a Service without any infrastructure to manage
Stars: ✭ 50 (+177.78%)
Mutual labels:  faas
MERN-Ecommerce
An E-commerce app built using MERN stack. It has 4 social login options and implements email verification as well. Stripe and Paypal payment gateways are implemented.
Stars: ✭ 50 (+177.78%)
Mutual labels:  aws-sdk
autils
Awesome frontend utils library
Stars: ✭ 17 (-5.56%)
Mutual labels:  utils
aws-sdk-lisp
AWS-SDK for Common Lisp
Stars: ✭ 61 (+238.89%)
Mutual labels:  aws-sdk
csa-misc-utils
Miscellaneous samples, documents, how-tos, utilities, scripts, and other CSA tidbits
Stars: ✭ 79 (+338.89%)
Mutual labels:  utils
openwhisk-runtime-python
Apache OpenWhisk Runtime Python supports Apache OpenWhisk functions written in Python
Stars: ✭ 39 (+116.67%)
Mutual labels:  faas
timestampy
🕒 Bunch of utilities useful when working with UNIX timestamps
Stars: ✭ 21 (+16.67%)
Mutual labels:  utils
go-appsync-graphql-cloudformation
AWS AppSync GraphQL API Proxy with Lambda, CloudFormation, and SAM
Stars: ✭ 28 (+55.56%)
Mutual labels:  faas
android-library
Android开发基础库
Stars: ✭ 14 (-22.22%)
Mutual labels:  utils
cli
Autocode CLI and standard library tooling
Stars: ✭ 3,791 (+20961.11%)
Mutual labels:  faas
aws-lambda-powertools-typescript
A suite of utilities for AWS Lambda Functions that makes structured logging, creating custom metrics asynchronously and tracing with AWS X-Ray easier
Stars: ✭ 817 (+4438.89%)
Mutual labels:  aws-sdk
kubeless
Kubernetes Native Serverless Framework
Stars: ✭ 6,848 (+37944.44%)
Mutual labels:  faas
cmn-utils
公共函数&请求封装
Stars: ✭ 43 (+138.89%)
Mutual labels:  utils
useful
🇨🇭 A collection of useful functions for working in Elixir
Stars: ✭ 21 (+16.67%)
Mutual labels:  utils

AWS SDK Extra

The AWS SDK + a handful of extra convenience methods.

// require aws-sdk-extra, instead of the official aws-sdk
const aws = require(`@serverless/aws-sdk-extra`)

// initialize any service, as usual.
const s3 = new aws.S3({
  credentials: { accessKeyId: 'xxx', secretAccessKey: 'xxx' },
  region: 'us-east-1'
})

// initialize the Extras service for extra methods
const extras = new aws.Extras({
  credentials: { accessKeyId: 'xxx', secretAccessKey: 'xxx' },
  region: 'us-east-1'
})

// call some powerful extra methods. More info below.
const certificate = await extras.deployCertificate(params)

Reference

deployDistributionDomain

Deploys a CloudFront distribution domain by adding the domain to the distribution and deploying the certificate and DNS records.

const params = {
  domain: 'serverless.com',
  distributionId: 'xxx'
}

const {
  certificateArn,
  certificateStatus,
  domainHostedZoneId
} = await extras.deployDistributionDomain(params)

deployCertificate

Deploys a free ACM certificate for the given domain.

const params = {
  domain: 'serverless.com'
}

const { certificateArn, certificateStatus, domainHostedZoneId } = await extras.deployCertificate(
  params
)

deployDistributionDns

Deploys a DNS records for a distribution domain.

const params = {
  domain: 'serverless.com',
  distributionUrl: 'xxx.cloudfront.net'
}

const { domainHostedZoneId } = await extras.deployDistributionDns(params)

addDomainToDistribution

Adds a domain or subdomain to a CloudFront Distribution.

const params = {
  domain: 'serverless.com',
  certificateArn: 'xxx:xxx',
  certificateStatus: 'ISSUED'
}

const { domainHostedZoneId } = await extras.addDomainToDistribution(params)

getDomainHostedZoneId

Fetches the hosted zone id for the given domain.

const params = {
  domain: 'serverless.com'
}

const { domainHostedZoneId } = await extras.getDomainHostedZoneId(params)

deployRole

Updates or creates the given role name with the given service & policy. You can specify an inline policy:

const params = {
  name: 'my-role',
  service: 'lambda.amazonaws.com',
  policy: [
    {
      Effect: 'Allow',
      Action: ['sts:AssumeRole'],
      Resource: '*'
    },
    {
      Effect: 'Allow',
      Action: ['logs:CreateLogGroup', 'logs:CreateLogStream'],
      Resource: '*'
    }
  ]
}
const { roleArn } = await extras.deployRole(params)

Or you can specify the policy as a maanged policy arn string:

const params = {
  name: 'my-role',
  service: 'lambda.amazonaws.com',
  policy: 'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'
}
const { roleArn } = await extras.deployRole(params)

If you don't specify a policy property, an admin policy will be created by default.

removeRole

Removes the given role and all its attached managed and inline policies.

const params = {
  name: 'my-role'
}

await extras.removeRole(params)

removeRolePolicies

Removes all attached managed and inline policies for the given role.

const params = {
  name: 'my-role'
}

await extras.removeRolePolicies(params)

deployLambda

Updates a lambda if it exists, otherwise creates a new one.

const params = {
  lambdaName: 'my-lambda', // required
  roleArn: 'aws:iam:role:arn:xxx', // required
  lambdaSrc: 'path/to/lambda/directory' // required. could also be a buffer of a zip file
  memory: 512 // optional, along with the other lambda config
  vpcConfig: // optional, specify a VPC
    securityGroupIds:
      - sg-xxx
    subnetIds:
      - subnet-xxx
      - subnet-xxx
}

const { lambdaArn, lambdaSize, lambdaSha } = await extras.deployLambda(params)

deployApigDomainDns

Deploys the DNS records for an Api Gateway V2 HTTP custom domain

const params = {
  domain: 'serverless.com', // required. The custom domain you'd like to configure.
  apigatewayHostedZoneId: 'qwertyuiop', // required. The regional hosted zone id of the APIG custom domain
  apigatewayDomainName: 'd-qwertyuiop.xxx.com' // required. The regional endpoint of the APIG custom domain
}

const { domainHostedZoneId } = await extras.deployApigDomainDns(params)

deployAppSyncApi

Updates or creates an AppSync API

const params = {
  apiName: 'my-api',
  apiId: 'xxx' // if provided, updates the API. If not provided, creates a new API
}

const { apiId, apiUrls } = await extras.deployAppSyncApi(params)

deployAppSyncSchema

Updates or creates an AppSync Schema

const params = {
  apiId: 'xxx', // the targeted api id
  schema: '...' // valid graphql schema
}

await extras.deployAppSyncApi(params)

deployAppSyncResolvers

Updates or creates AppSync Resolvers

const params = {
  apiId,
  roleName: 'my-role', // name of the role that provides access for these resources to the required resources
  resolvers: {
    Query: {
      getPost: {
        lambda: 'getPost' // name of the lambda function to use as a resolver for the getPost field
      }
    },
    Mutation: {
      putPost: {
        lambda: 'putPost'
      }
    }
  }
}

await extras.deployAppSyncResolvers(params)

deployStack

Updates or creates a CloudFormation stack.

const inputs = {
  stackName: 'my-stack', // required
  template: {
    // required
    AWSTemplateFormatVersion: '2010-09-09',
    Description: 'Example Stack',
    Resources: {
      LogGroup: {
        Type: 'AWS::Logs::LogGroup',
        Properties: {
          LogGroupName: '/log/group/one',
          RetentionInDays: 14
        }
      }
    },
    Outputs: {
      firstStackOutput: {
        Value: {
          'Fn::GetAtt': ['LogGroup', 'Arn']
        }
      },
      secondStackOutput: {
        Value: {
          'Fn::GetAtt': ['LogGroup', 'Arn']
        }
      }
    }
  },
  capabilities: ['CAPABILITY_IAM'],
  parameters: {
    firstParameter: 'value'
  },
  role: 'arn:iam:xxx'
}

const outputs = await extras.deployStack(params)

removeStack

Removes a CloudFormation stack if it exists.

const prams = {
  stackName: 'my-stack' // name of the stack you want to remove
}

await extras.removeStack(params)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].