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

JamesWoolfenden/terraform-aws-statebucket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README Header

Slalom

terraform-aws-statebucket Build Status Latest Release

Terraform module to provision an AWS Codecommit CI/CD system.


This project uses the "build-harness" a modified version of the project "SweetOps" from Cloudposse. Sweet indeed.

It's 100% Open Source and licensed under the APACHE2.

Usage

Include this repository as a module in your existing terraform code:

module "statebucket" {
source      = "JamesWoolfenden/statebucket/aws"
version     = "0.0.4"
common_tags = "${var.common_tags}"
}

Instructions

When working with Terraform as part of a team, instead of a local terrraform.tfstate file, a shared remote state store is required, for AWS this is S3 bucket. But if we want to automate everything via Terraform? Traditionally we would have to create the initial bucket by hand via the console or by the cli and the resource unmanaged. The module and example solves the issue of creating a state bucket in Terraform using Terrraform itself.

Chicken then Egg

The Makefile in folder examples\examplesA has a number of tasks, one specifically to create the initial bucket:

make first

This makes the lock DB table, the state (S3) bucket, fills out and creates the remote_state.tf file and then copies the state from the local disk to the bucket.PHEW. The State of the bucket is now managed along with any future resources.

On the second and subsequent runs you use:

make build

Features

This module implements state locking via DynamoDB, Versioning on files within the bucket and finally MFA Based deletes of the bucket itself.

The module also uses a tagging based on the map variable common_tags scheme.

This Scheme here uses as a minimum (in your terraform.tfvars): common_tags = { Application = "terraform" Module = "statebucket" Environment = "develop" }

Makefile Targets

Available targets:

  help/all:
                          Display help for all targets
  help/short:
                        This help short screen
  help:
                              Help screen
  lint                                Lint terraform code

Inputs

Name Description Type Default Required
common_tags This is a map type for applying tags on resources map - yes

Outputs

Name Description
bucket_domain_name The FQDN for the bucket

Makefile Targets

Available targets:

  help/all:
                          Display help for all targets
  help/short:
                        This help short screen
  help:
                              Help screen
  lint                                Lint terraform code

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHub issue.

Terraform Module Development

Slack Community

You can join the Cloudposse community Open Source Community on Slack.

Contributing

Bug Reports & Feature Requests

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

Copyrights

Copyright © 2019-2019 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

README Footer Beacon

About

Contains the module, permissions and sample code to create a state bucket for further Terraform use.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published