Terraform module to provision a secure Terraform S3 bucket. Has a provisioning test in its' Github actions
It's 100% Open Source and licensed under the APACHE2.
Include this repository as a module in your existing Terraform code:
module "s3" {
source = "JamesWoolfenden/s3/aws"
version = "0.4.0"
s3_bucket_force_destroy = var.s3_bucket_force_destroy
s3_bucket_name = var.s3_bucket_name
s3_bucket_policy = data.aws_iam_policy_document.s3_policy.json
common_tags = var.common_tags
}This creates an s3 bucket with policy and applies the common tags scheme. The module uses a tagging scheme based on the map variable common_tags. This needs to consist of as a minimum (in your auto.tfvars):
common_tags = {
application = "Terraform"
module = "S3"
environment = "develop"
}| Name | Version |
|---|---|
| aws | n/a |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| access_block | n/a | map |
{ |
no |
| common_tags | This is a map type for applying tags on resources | map |
n/a | yes |
| mfa_delete | To enable/disable MFA delete | bool |
true |
no |
| s3_bucket_acl | Acl on the bucket | string |
"private" |
no |
| s3_bucket_force_destroy | String Boolean to set bucket to be undeletable (well more difficult anyway) | string |
n/a | yes |
| s3_bucket_name | The name of the bucket | string |
n/a | yes |
| s3_bucket_policy | The IAM policy for the bucket | string |
n/a | yes |
| s3_logging | Enable logging on s3 bucket | bool |
true |
no |
| sse_algorithm | The type of encryption algorithm to use | string |
"aws:kms" |
no |
| versioning | Enable versioning on s3 bucket | bool |
true |
no |
| Name | Description |
|---|---|
| account_id | The AWS account number in use |
| bucket | The bucket |
Check out these related projects.
- terraform-aws-statebucket - Terraform s3 state buckets
Got a question?
File a GitHub issue.
Please use the issue tracker to report any bugs or file feature requests.
Copyright © 2019-2020 Slalom, LLC
See LICENSE for full details.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.