Go to file
Matt Chesler 1f240543c8 Allow use of IAM instance profile credentials 2020-04-01 08:32:43 -04:00
.circleci Added Code Climate, Removed Codacy. 2019-05-09 13:20:16 +01:00
lib Allow use of IAM instance profile credentials 2020-04-01 08:32:43 -04:00
.gitignore pipe 2019-05-09 10:14:05 +01:00
README.md Allow use of IAM instance profile credentials 2020-04-01 08:32:43 -04:00
clean.js v1.1.2: consistently use bucketRegion, not regionName 2019-05-25 22:24:19 -06:00
index.js Refactoring 2019-05-09 21:20:14 +01:00
package-lock.json Allow use of IAM instance profile credentials 2020-04-01 08:32:43 -04:00
package.json Allow use of IAM instance profile credentials 2020-04-01 08:32:43 -04:00
test.js v1.1.2: consistently use bucketRegion, not regionName 2019-05-25 22:24:19 -06:00

README.md

CircleCI Maintainability Test Coverage Known Vulnerabilities

"Lifetime Downloads" "Monthly Downloads" "Weekly Downloads"

greenlock-storage-s3

S3 backed storage strategy for greenlock-express.js (and greenlock.js)

Requirements

You will need a s3 bucket and the corresponding credentials.

Integration

greenlock-express.js


let store = require('greenlock-storage-s3').create({
    accessKeyId: accessKeyId                // Replace with your accessKeyId
    , secretAccessKey: secretAccessKey      // Replace with your secretAccessKey
    , bucketRegion: bucketRegion            // Replace with your bucketRegion
    , bucketName: bucketName                // Replace with your bucketName
    , configDir: 'acme/'                    // Recommended
    , accountsDir: 'accounts/'              // Recommended
    , debug: true                           // Debug
});

var Greenlock = require("greenlock-express");

var greenlock = Greenlock.create({
    // Other options
    , store: store
});

// Continue your greenlock setup

If using credentials from Environment variables, the shared credentials file, the ECS credentials provider (if applicable), or loaded from AWS IAM using the credentials provider of the Amazon EC2 instance (if configured in the instance metadata), omit the accessKeyId and secretAccessKey.

Testing

The strategy is tested against the greenlock-store-test

To run the tests yourself, create a .env file with the following

// .env file
AWS_ACCESS_KEY_ID=abc           // Replace with your accessKeyId
AWS_SECRET_ACCESS_KEY=abc       // Replace with your secretAccessKey
AWS_BUCKET_REGION=abc           // Replace with your bucketRegion
AWS_BUCKET_NAME=abc             // Replace with your bucketName

Run the following command:

$ npm run clean && npm run test && npm run clean

License

ISC