From 195fa62411896a3a6a982a35872fc9df0891a4cd Mon Sep 17 00:00:00 2001 From: handojo1 <3625624+handojo1@users.noreply.github.com> Date: Mon, 31 May 2021 08:33:03 +0700 Subject: [PATCH 1/3] terraform 12 syntax --- examples/simple/main.tf | 2 +- main.tf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/simple/main.tf b/examples/simple/main.tf index dfdd811..e4ce80e 100644 --- a/examples/simple/main.tf +++ b/examples/simple/main.tf @@ -2,5 +2,5 @@ module "codebuild_sqitch_shared_resources" { source = "../../" product_domain = "bei" environment = "staging" - vpc_id = "${data.terraform_remote_state.vpc_lab_production.vpc_id}" + vpc_id = "${data.terraform_remote_state.vpc_lab_production.outputs.vpc_id}" } diff --git a/main.tf b/main.tf index 79d3265..1c84a29 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,6 @@ # Codebuild Role module "codebuild_role" { - source = "github.com/traveloka/terraform-aws-iam-role.git//modules/service?ref=v1.0.2" + source = "github.com/traveloka/terraform-aws-iam-role.git//modules/service?ref=v2.0.2" product_domain = "${var.product_domain}" environment = "${var.environment}" @@ -26,13 +26,13 @@ resource "aws_iam_role_policy_attachment" "codebuild_ecr" { # Security Group Name module "postgres_sg_name" { - source = "github.com/traveloka/terraform-aws-resource-naming.git?ref=v0.18.1" + source = "github.com/traveloka/terraform-aws-resource-naming.git?ref=v0.19.1" name_prefix = "${var.product_domain}-postgres-sqitch-sg" resource_type = "security_group" } module "codebuild_sg_name" { - source = "github.com/traveloka/terraform-aws-resource-naming.git?ref=v0.18.1" + source = "github.com/traveloka/terraform-aws-resource-naming.git?ref=v0.19.1" name_prefix = "${var.product_domain}-codebuild-sqitch-sg" resource_type = "security_group" } From 642b6b62e0fa593549a75e67e992f8ddfe6d59e2 Mon Sep 17 00:00:00 2001 From: handojo1 <3625624+handojo1@users.noreply.github.com> Date: Mon, 31 May 2021 09:44:29 +0700 Subject: [PATCH 2/3] fix documentation --- CHANGELOG.md | 30 +++++----------- README.md | 96 +++++++++++++--------------------------------------- 2 files changed, 31 insertions(+), 95 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e27bcb0..33bbfb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,33 +1,19 @@ -## v0.2.0 (Feb 28, 2019) +## v1.0.0 (May 31, 2021) NOTES: -* Any Notes regarding your submitted PR, like breaking changes or else. -FEATURES: - -* **New Source:** `aws_000_0000` ([#references_to_issue](./)) - -ENHANCEMENTS: - -* feature: Add support for new version of AWS API - -BUG FIXES: - -* Prevent error from evil bugs - -## v0.1.0 (Jan 1, 2019) - -NOTES: -* Any Notes regarding your submitted PR, like breaking changes or else. +* Might not be compatible with Terraform 11 FEATURES: -* **New Source:** `aws_000_0000` ([#references_to_issue](./)) +* Terraform 12 syntax + +## v0.3.0 (May 12, 2021) ENHANCEMENTS: -* feature: Add support for new version of AWS API +* Output Codebuild role name since some terraform module requires the name instead of ARN -BUG FIXES: +## v0.1.0 (Jan 1, 2019) -* Prevent error from evil bugs +* Initial release diff --git a/README.md b/README.md index 8ade42b..e542f3c 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,21 @@ # Terraform AWS Modules Template -[![Terraform Version](https://img.shields.io/badge/Terraform%20Version-0.11.13-blue.svg)](https://releases.hashicorp.com/terraform/) -[![Release](https://img.shields.io/github/release/traveloka/terraform-aws-modules-template.svg)](https://github.com/traveloka/terraform-aws-modules-template/releases) -[![Last Commit](https://img.shields.io/github/last-commit/traveloka/terraform-aws-modules-template.svg)](https://github.com/traveloka/terraform-aws-modules-template/commits/master) -[![Issues](https://img.shields.io/github/issues/traveloka/terraform-aws-modules-template.svg)](https://github.com/traveloka/terraform-aws-modules-template/issues) -[![Pull Requests](https://img.shields.io/github/issues-pr/traveloka/terraform-aws-modules-template.svg)](https://github.com/traveloka/terraform-aws-modules-template/pulls) -[![License](https://img.shields.io/github/license/traveloka/terraform-aws-modules-template.svg)](https://github.com/traveloka/terraform-aws-modules-template/blob/master/LICENSE) +[![Terraform Version](https://img.shields.io/badge/Terraform%20Version-0.12.31-blue.svg)](https://releases.hashicorp.com/terraform/) +[![Release](https://img.shields.io/github/release/traveloka/terraform-aws-sqitch-codebuild-shared-resources.svg)](https://github.com/traveloka/terraform-aws-sqitch-codebuild-shared-resources/releases) +[![Last Commit](https://img.shields.io/github/last-commit/traveloka/terraform-aws-sqitch-codebuild-shared-resources.svg)](https://github.com/traveloka/terraform-aws-sqitch-codebuild-shared-resources/commits/master) +[![Issues](https://img.shields.io/github/issues/traveloka/terraform-aws-sqitch-codebuild-shared-resources.svg)](https://github.com/traveloka/terraform-aws-sqitch-codebuild-shared-resources/issues) +[![Pull Requests](https://img.shields.io/github/issues-pr/traveloka/terraform-aws-sqitch-codebuild-shared-resources.svg)](https://github.com/traveloka/terraform-aws-sqitch-codebuild-shared-resources/pulls) +[![License](https://img.shields.io/github/license/traveloka/terraform-aws-sqitch-codebuild-shared-resources.svg)](https://github.com/traveloka/terraform-aws-sqitch-codebuild-shared-resources/blob/master/LICENSE) ![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.png?v=103) -This repository is a guide for our terraform module (and all repository in general) to build user friendly modules that easy to understand and self explaining. We hope this can help our team nurture opensource culture and create more welcoming to contribution. This template is not strict standard and improvisation beyond this template might produce more awesome modules. - -**We write this module not only as an example but also as an explanation of how to implement this other modules** +This repository contains a terraform module to create reusable things to be used by CodeBuild pipelines for deploying Sqitch SQL migration framework to RDS instances in the same account. ## Table of Content - [Prerequisites](#Prerequisites) -- [Quick Start](#Quick-Start) - [Dependencies](#Dependencies) +- [Examples](#Examples) +- [Versioning](#Versioning) - [Contributing](#Contributing) - [Contributor](#Contributor) - [License](#License) @@ -24,97 +23,48 @@ This repository is a guide for our terraform module (and all repository in gener ## Prerequisites -Before jumping to use this module, you need to know standard knowledge of markdown language syntax. - -[Github Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) - -Because specifically it explain about terraform modules, you also need to install a few tools such as - -- [Terraform](https://releases.hashicorp.com/terraform/). To this date, I recommend at latest version `0.11.x` and not recommend `0.12.x` or above -- [awsudo](https://github.com/makethunder/awsudo) to assume role in AWS -- [Visual Studio Code](https://code.visualstudio.com/download) is the best editor for the [Terraform Extension](https://marketplace.visualstudio.com/items?itemName=mauve.terraform). After install activate auto format by go to`File`→`Preferences`→`Settings`. Choose`Text Editor`→`Formatting`and check`Format on Save` +For Terraform version, this module has been tested on terraform 0.12.31. It might not run correctly on 0.11 or below. -Terraform Providers. You don't need to download or install anything. Just make sure this is the version you use in code if it is used +For terraform Providers: -- Provider [aws](https://www.terraform.io/docs/providers/aws/index.html) version `1.60.0`. We are not recommending usage of `2.0.0` and above. -- Provider [random](https://www.terraform.io/docs/providers/random/index.html) version `1.0.0`. +- Provider [aws](https://www.terraform.io/docs/providers/aws/index.html) version `2.70.0`. We have not tested usage of `3.0.0` and above. +- Provider [random](https://www.terraform.io/docs/providers/random/index.html) version `2.3.0`. ## Dependencies -This section can explain dependency that needed to run module, lets say this is `acm-certificate` module - -This project need dependencies: - -- `vpc` module applied -- `public-route53-zone` module applied - -## Quick Start - -After module's code set and go, complete it with well written documentation. Start with a user friendly `README`. What is the content ? At least it explain. +This module doesn't require any extra module to be run independently first. -- What does this project do? -- Why is this project useful? -- How do I get started? -- Where can I get more help, if I need it? +## Examples -Follow along this reading to learn more. This document already explain 2 top questions above. - -Standard terraform modules have an example and you can write this below in quick started section, e.g: - -Quick check the `variable.tf` to learn more about what you can customize, we state default value but it might not fulfill your expectation. Copy folder example, change values in `/example/locals.tf`, and After that run this scripts - -``` -cd /