From ccac4dd2241826541f117de0ec9801533fcee57a Mon Sep 17 00:00:00 2001 From: theprashantyadav <79893616+theprashantyadav@users.noreply.github.com> Date: Fri, 13 Oct 2023 22:45:42 +0530 Subject: [PATCH] Update acm and github action version (#50) * feat: update gitinnore and acm version * feat: update github-action version * feat: update tf version * feat: updated fail name --------- Co-authored-by: anmolnagpal --- .github/workflows/auto_assignee.yml | 2 +- .github/workflows/changelog.yml | 2 +- .github/workflows/tf-checks.yml | 8 +- .github/workflows/tflint.yml | 4 +- .github/workflows/tfsec.yml | 2 +- .gitignore | 207 ++++++++++++++++++++++++- _example/alb/example.tf | 2 +- _example/alb/versions.tf | 6 +- _example/clb/versions.tf | 4 +- _example/nlb/{exampe.tf => example.tf} | 2 +- _example/nlb/versions.tf | 4 +- main.tf | 6 +- variables.tf | 4 - versions.tf | 4 +- 14 files changed, 227 insertions(+), 30 deletions(-) rename _example/nlb/{exampe.tf => example.tf} (99%) diff --git a/.github/workflows/auto_assignee.yml b/.github/workflows/auto_assignee.yml index a07d2fa..88ebb73 100644 --- a/.github/workflows/auto_assignee.yml +++ b/.github/workflows/auto_assignee.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: jobs: assignee: - uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.6 secrets: GITHUB: ${{ secrets.GITHUB }} with: diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 1ee6f78..7d9ffdf 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: changelog: - uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.6 secrets: inherit with: branch: 'master' diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml index ef4f19a..7ca5c6a 100644 --- a/.github/workflows/tf-checks.yml +++ b/.github/workflows/tf-checks.yml @@ -6,14 +6,14 @@ on: workflow_dispatch: jobs: alb: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6 with: working_directory: './_example/alb/' nlb: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6 with: working_directory: './_example/nlb/' clb: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6 with: - working_directory: './_example/clb/' \ No newline at end of file + working_directory: './_example/clb/' diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml index ee98182..7c664c9 100644 --- a/.github/workflows/tflint.yml +++ b/.github/workflows/tflint.yml @@ -6,6 +6,6 @@ on: workflow_dispatch: jobs: tf-lint: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.6 secrets: - GITHUB: ${{ secrets.GITHUB }} \ No newline at end of file + GITHUB: ${{ secrets.GITHUB }} diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index c203751..e5e4394 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: jobs: tfsec: - uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.6 secrets: inherit with: working_directory: '.' diff --git a/.gitignore b/.gitignore index dfee340..cc1c6b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,210 @@ # ignored files +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* +### Eclipse template + +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet +### Windows template +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk +### Ansible template +*.retry +### macOS template +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +### Archives template +# It's better to unpack these files and commit the raw source because +# git has its own built in compression methods. +*.7z +*.jar +*.rar +*.zip +*.gz +*.tgz +*.bzip +*.bz2 +*.xz +*.lzma +*.cab + +# Packing-only formats +*.iso +*.tar + +# Package management formats +*.dmg +*.xpi +*.gem +*.egg +*.deb +*.rpm +*.msi +*.msm +*.msp +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +/.idea/ +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ +# User-specific stuff: +.idea/* +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# TFstste +*.tfstate* + +deployment/_logs/ansible-log.json +deployment/_logs/ansible-log.log +deployment/_logs/facts/* +deployment/_logs/retry/* +_app/* +ansible-log.json +.terraform +terraform.tfstate + *.tfstate *.tfstate.backup -.terraform -.idea *.iml *.terraform.lock.hcl +*.lock.hcl diff --git a/_example/alb/example.tf b/_example/alb/example.tf index c2044ee..26d5e26 100644 --- a/_example/alb/example.tf +++ b/_example/alb/example.tf @@ -104,7 +104,7 @@ module "ec2" { module "acm" { source = "clouddrove/acm/aws" - version = "1.4.0" + version = "1.4.1" name = local.name environment = local.environment diff --git a/_example/alb/versions.tf b/_example/alb/versions.tf index 5b25067..ef355e6 100644 --- a/_example/alb/versions.tf +++ b/_example/alb/versions.tf @@ -1,11 +1,11 @@ # Terraform version terraform { - required_version = ">= 1.5.5" + required_version = ">= 1.6.1" required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.13.1" + version = ">= 5.20.1" } } -} \ No newline at end of file +} diff --git a/_example/clb/versions.tf b/_example/clb/versions.tf index c95376a..ef355e6 100644 --- a/_example/clb/versions.tf +++ b/_example/clb/versions.tf @@ -1,11 +1,11 @@ # Terraform version terraform { - required_version = ">= 1.5.5" + required_version = ">= 1.6.1" required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.13.1" + version = ">= 5.20.1" } } } diff --git a/_example/nlb/exampe.tf b/_example/nlb/example.tf similarity index 99% rename from _example/nlb/exampe.tf rename to _example/nlb/example.tf index 157d52b..a8966ab 100644 --- a/_example/nlb/exampe.tf +++ b/_example/nlb/example.tf @@ -103,7 +103,7 @@ module "ec2" { module "acm" { source = "clouddrove/acm/aws" - version = "1.4.0" + version = "1.4.1" name = local.name environment = local.environment diff --git a/_example/nlb/versions.tf b/_example/nlb/versions.tf index c95376a..ef355e6 100644 --- a/_example/nlb/versions.tf +++ b/_example/nlb/versions.tf @@ -1,11 +1,11 @@ # Terraform version terraform { - required_version = ">= 1.5.5" + required_version = ">= 1.6.1" required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.13.1" + version = ">= 5.20.1" } } } diff --git a/main.tf b/main.tf index 3076d97..afa0be9 100644 --- a/main.tf +++ b/main.tf @@ -286,9 +286,7 @@ resource "aws_lb_target_group_attachment" "attachment" { } locals { - arns = aws_lb_target_group.main.*.arn targets = range(var.instance_count) - ports = [for d in var.target_groups : d.backend_port] # Nested loop over both lists, and flatten the result. arns_targets = distinct(flatten([ for arn_key, arn in var.target_groups : [ @@ -304,8 +302,8 @@ locals { resource "aws_lb_target_group_attachment" "nattachment" { for_each = var.load_balancer_type == "network" && var.enable && var.with_target_group ? { for k, v in local.arns_targets : k => v } : {} - target_group_arn = element(aws_lb_target_group.main.*.arn, each.value.key) #local.arns_targets[count.index].arn - target_id = var.target_id[each.value.target] #each.value.target + target_group_arn = element(aws_lb_target_group.main[*].arn, each.value.key) #local.arns_targets[count.index].arn + target_id = var.target_id[each.value.target] #each.value.target port = each.value.port } diff --git a/variables.tf b/variables.tf index 5952c3a..9e31b9b 100644 --- a/variables.tf +++ b/variables.tf @@ -18,7 +18,6 @@ variable "repository" { } } - variable "environment" { type = string default = "test" @@ -58,7 +57,6 @@ variable "load_balancer_type" { description = "The type of load balancer to create. Possible values are application or network. The default value is application." } - variable "subnet_mapping" { default = [] type = list(map(string)) @@ -131,7 +129,6 @@ variable "listener_type" { description = "The type of routing action. Valid values are forward, redirect, fixed-response, authenticate-cognito and authenticate-oidc." } - variable "listener_certificate_arn" { type = string sensitive = true @@ -198,7 +195,6 @@ variable "load_balancer_update_timeout" { description = "Timeout value when updating the ALB." } - variable "http_listener_type" { type = string default = "redirect" diff --git a/versions.tf b/versions.tf index c95376a..ef355e6 100644 --- a/versions.tf +++ b/versions.tf @@ -1,11 +1,11 @@ # Terraform version terraform { - required_version = ">= 1.5.5" + required_version = ">= 1.6.1" required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.13.1" + version = ">= 5.20.1" } } }