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 / # Go to copied example folder -awsudo -u -- terraform init # Initialize by downloading modules and providers -awsudo -u -- terraform plan # See what resource will be created -awsudo -u -- terraform apply # Apply the resource in plan -awsudo -u -- terraform destroy # May be you change your mind ? -``` - -After this script run, explain what to expect, e.g: - -This will add - -- Instance Profile -- Auto Scaling Group -- Load Balancer Internal -- Private Link -- Route 53 -- Security Group -- Security Group Rule +Go to the `example` directory for example terraform code that uses this module. ## Versioning -This section can inform what the latest stable version that you recommend for any different case, latest change log that happen, and a link to `CHANGELOG` or `RELEASE`. It really can help others to quickly your latest work. e.g: - We use [SemVer](https://semver.org/) for our versioning -**Latest stable version** `v0.1.1`, 7th July 2019 +**Latest stable version** `v1.0.0`, 31st May 2021 -**Latest version** `v0.1.2`, 10th July 2019 +**Latest version** `v0.1.2`, 31st May 2021 **Latest release** : -- Add README documentation -- Fix `managedBy` tags in `vpc` resources +- Terraform 12 Syntax Please also see our `CHANGELOG` document in this repository and see more detail ## Contributing -Contribution can come from not only code, but also idea, discussion, etc. You can explain how to contribute to this project in `CONTRIBUTION`. Please see our example of `CONTRIBUTION` document +Please see our example of `CONTRIBUTING` document ## Contributor -For question, issue, and pull request you can contact these awesome people +For question, issue, and pull request you can contact these people -- [Rafi Kurnia](https://github.com/rafikurnia) (**Author**) -- [Rukaan Adha](https://github.com/Rukaan) -- [Muhammad Panji](https://github.com/sumodirjo) +- [Christianto Handojo](https://github.com/handojo1) (**Author**) ## License -Last but not least, add License to modules. Most of our repository is licensed under Apache License 2.0 - see the `LICENSE` file for details +This module is licensed under Apache License 2.0 - see the `LICENSE` file for details ## Acknowledgments From 6008219e16ff284e45f4a764322dc6ebb5b50c60 Mon Sep 17 00:00:00 2001 From: handojo1 <3625624+handojo1@users.noreply.github.com> Date: Mon, 31 May 2021 09:46:28 +0700 Subject: [PATCH 3/3] fix date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33bbfb6..73f8bf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,6 @@ ENHANCEMENTS: * Output Codebuild role name since some terraform module requires the name instead of ARN -## v0.1.0 (Jan 1, 2019) +## v0.1.0 (Oct 8, 2020) * Initial release