aws-samples / aws-codecommit-s3-backups-with-terraform

Backup your AWS CodeCommit repositories to S3 with Terraform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AWS CodeCommit S3 backups with Terraform module

Take the red pill and backup your AWS CodeCommit repositories to S3 with a Terraform module.

...or...

Take the blue pill and discover that deleting an AWS CodeCommit repository is a destructive one-way operation that cannot be undone.

Prerequisites

Architecture

image info

  1. Users push code to a repository in CodeCommit.
  2. Amazon EventBridge monitors for changes to any repository.
  3. EventBridge invokes AWS CodeBuild and sends it information about the repository.
  4. CodeBuild clones the repository and packages it into a .zip file.
  5. CodeBuild uploads the .zip file to an S3 bucket.

Module Inputs

This module is designed for a GitHub source type but it could be cloned and deployed locally, or from a private registry.

module "codecommit_s3_backup" {
  source = "github.com/aws-samples/aws-codecommit-s3-backups-with-terraform"
  name   = "codecommit-s3-backup"
}

The name will be used in the resource names, such as eventbridge rules and IAM roles.

Troubleshooting

Issue Fix
Errors containing NO_ARTIFACTS or NO_SOURCE Run a destroy and then a fresh apply. CodeBuild projects with no artifacts and defined source may generate errors when they are being edited (rather than built fresh).

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

Backup your AWS CodeCommit repositories to S3 with Terraform

License:MIT No Attribution


Languages

Language:HCL 100.0%