diff --git a/.github/workflows/publish_gh_pages.yml b/.github/workflows/publish_gh_pages.yml new file mode 100644 index 0000000..6c36a0b --- /dev/null +++ b/.github/workflows/publish_gh_pages.yml @@ -0,0 +1,18 @@ +name: Publish docs via GitHub Pages +on: + push: + branches: + - main + +jobs: + build: + name: Deploy docs + runs-on: ubuntu-latest + steps: + - name: Checkout main + uses: actions/checkout@v2 + + - name: Deploy docs + uses: mhausenblas/mkdocs-deploy-gh-pages@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.projenrc.js b/.projenrc.js index b521d7c..f9dac9b 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -23,6 +23,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ schedule: UpgradeDependenciesSchedule.MONTHLY, }, }, + keywords: ['aws', 'backend', 's3', 'terraform'], stability: Stability.EXPERIMENTAL, publishToMaven: { javaPackage: 'io.github.stefanfreitag.cdk.terraformstatebackend', diff --git a/API.md b/API.md index 14194be..deb534d 100644 --- a/API.md +++ b/API.md @@ -6,23 +6,14 @@ of - S3 bucket - DynamoDB table. -## Features - -- Versioning is enabled - [[S3.14] S3 buckets should use versioning](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-14) -- All public access is blocked - [[S3.1] S3 Block Public Access setting should be enabled](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-1) -- Enforce SSL for requests - [[S3.5] S3 buckets should require requests to use Secure Socket Layer](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-1) -- A lifecycle policy for non-current versions of objects - [[S3.10] S3 buckets with versioning enabled should have lifecycle policies configured -](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-10) -- Enforcing that the bucket owner owns every object in the bucket. - -## Links - -- [Amazon Simple Storage Service controls](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html) -- [Controlling ownership of objects and disabling ACLs for your bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) +## Contributing + +We welcome community contributions and pull requests. See [CONTRIBUTING.md](./CONTRIBUTING.md) for +details. + +## License + +This project is licensed under Apache 2.0 - see the [LICENSE](./LICENSE) file for details. # API Reference diff --git a/README.md b/README.md index cf830e2..8dcb7d7 100644 --- a/README.md +++ b/README.md @@ -6,20 +6,11 @@ of - S3 bucket - DynamoDB table. -## Features +## Contributing -- Versioning is enabled - [[S3.14] S3 buckets should use versioning](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-14) -- All public access is blocked - [[S3.1] S3 Block Public Access setting should be enabled](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-1) -- Enforce SSL for requests - [[S3.5] S3 buckets should require requests to use Secure Socket Layer](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-1) -- A lifecycle policy for non-current versions of objects - [[S3.10] S3 buckets with versioning enabled should have lifecycle policies configured -](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-10) -- Enforcing that the bucket owner owns every object in the bucket. +We welcome community contributions and pull requests. See [CONTRIBUTING.md](./CONTRIBUTING.md) for +details. -## Links +## License -- [Amazon Simple Storage Service controls](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html) -- [Controlling ownership of objects and disabling ACLs for your bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) +This project is licensed under Apache 2.0 - see the [LICENSE](./LICENSE) file for details. diff --git a/docs/features.md b/docs/features.md new file mode 100644 index 0000000..4248148 --- /dev/null +++ b/docs/features.md @@ -0,0 +1,8 @@ +# Features + +- [[S3.1] S3 Block Public Access setting should be enabled](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-1) +- [[S3.5] S3 buckets should require requests to use Secure Socket Layer](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-1) +- [[S3.14] S3 buckets should use versioning](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-14) +- A lifecycle policy for non-current versions of objects + [[S3.10] S3 buckets with versioning enabled should have lifecycle policies configured](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html#s3-10) +- Enforcing that the bucket owner owns every object in the bucket. diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..1a6d783 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,11 @@ +# Introduction + +Terraform supports remote state management using S3 and DynamoDB services from AWS. +This CDK construct provides an implementation following recommended practices, e.g. + +- state locking and consistency checking via Dynamo DB +- encryption of state files at rest +- versioning on the S3 bucket + Allowing state recovery in the case of accidental deletions and human error + +A full list of features is available in the [here](features.md). \ No newline at end of file diff --git a/docs/links.md b/docs/links.md new file mode 100644 index 0000000..e2cc2b6 --- /dev/null +++ b/docs/links.md @@ -0,0 +1,7 @@ +# Links + +- [AWS Cloud Development Kit](https://aws.amazon.com/cdk) +- [AWS DynamoDB](https://aws.amazon.com/dynamodb/) +- [AWS Simple Storage Service](https://aws.amazon.com/s3/) +- [Amazon Simple Storage Service controls](https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html) +- [Controlling ownership of objects and disabling ACLs for your bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..84c04e0 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,24 @@ +site_name: Terraform Remote State S3 Backend +site_description: 'Documentation for the Terraform Remote State S3 Backend' +site_author: 'Stefan Freitag' +docs_dir: docs/ +repo_name: 'stefanfreitag/terraform-backend-s3-bucket' +repo_url: 'https://github.com/stefanfreitag/terraform-backend-s3-bucket' +edit_uri: blob/main/docs/ +nav: + - Home: index.md + - Features: features.md + - Links: links.md +theme: + name: 'material' + palette: + scheme: default + +markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.superfences \ No newline at end of file diff --git a/package.json b/package.json index fc99d38..b67cda7 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,11 @@ "@types/prettier": "2.6.0" }, "keywords": [ - "cdk" + "aws", + "backend", + "cdk", + "s3", + "terraform" ], "main": "lib/index.js", "license": "Apache-2.0",