这是indexloc提供的服务,不要输入任何密码
Skip to content

JamesWoolfenden/terraform-aws-s3

Repository files navigation

Slalom

terraform-aws-s3

Build Status Latest Release pre-commit pre-commit

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.

Usage

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"
}

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
access_block n/a map
{
"block_public_acls": false,
"block_public_policy": false,
"ignore_public_acls": false,
"restrict_public_buckets": false
}
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

Outputs

Name Description
account_id The AWS account number in use
bucket The bucket

Instructions

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHub issue.

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Copyrights

Copyright © 2019-2020 Slalom, LLC

License

License

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.

Contributors

James Woolfenden
James Woolfenden

About

Contains the module, permissions and sample code to create a s3 bucket in AWS

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •