From 3eddf5e6935dac82b930196c4d8ea01bd3525036 Mon Sep 17 00:00:00 2001 From: Vladyslav Kurmaz Date: Sun, 28 Apr 2024 13:33:39 +0300 Subject: [PATCH] feat: v24.4.1 (#40) * feat: tag immutability, closed #39 * feat(aws): remove sshuttle dependency, closed #38 * feat(aws): dependency between nginx helm release, alb and dns records, closed 37 * feat: bump release version to 24.4.1 --- .env.template | 1 + aws/.tln.conf | 2 +- aws/app/data.tf | 4 ++++ aws/app/main.tf | 3 ++- aws/provider/main.tf | 2 +- aws/provider/variables.tf | 6 +++++- version | 2 +- 7 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.env.template b/.env.template index b138aa5..9bbadff 100644 --- a/.env.template +++ b/.env.template @@ -16,6 +16,7 @@ TF_VAR_tenant_id= #TF_VAR_registry= #TF_VAR_repositories= +#TF_VAR_image_tag_mutability= TF_VAR_domain_name=myproject.dev TF_VAR_dns_records=myproject.dev,api,admin diff --git a/aws/.tln.conf b/aws/.tln.conf index 81bc468..8c7d6e6 100644 --- a/aws/.tln.conf +++ b/aws/.tln.conf @@ -8,7 +8,7 @@ module.exports = { }, dotenvs: async (tln) => { if (fs.existsSync('.env')) return ['.env']; else return [] }, inherits: async (tln) => [], - depends: async (tln) => ['kubectl-1.29.0', 'helm-3.14.0', 'terraform-1.7.5', 'aws-cli-2.15.15', 'sshuttle'], + depends: async (tln) => ['kubectl-1.29.0', 'helm-3.14.0', 'terraform-1.7.5', 'aws-cli-2.15.15'], steps: async (tln) => [ { id: 'ls-ec2', builder: async (tln, script) => { script.set(['aws ec2 describe-instances --output yaml --query "Reservations[*].Instances[*].{Instance:InstanceId}"']); diff --git a/aws/app/data.tf b/aws/app/data.tf index 7188774..f4a4edf 100644 --- a/aws/app/data.tf +++ b/aws/app/data.tf @@ -46,6 +46,10 @@ data "aws_lb" "primary" { "kubernetes.io/cluster/${module.shared.k8s_name}" = "owned", "kubernetes.io/service-name" = "nginx-ingress/nginx-ingress-nginx-controller" } + + depends_on = [ + helm_release.nginx + ] } data "aws_secretsmanager_secret" "rds_pg" { diff --git a/aws/app/main.tf b/aws/app/main.tf index 4dfe6b1..9267ad2 100644 --- a/aws/app/main.tf +++ b/aws/app/main.tf @@ -18,6 +18,7 @@ resource "aws_route53_record" "record" { evaluate_target_health = false } depends_on = [ - helm_release.nginx + helm_release.nginx, + data.aws_lb.primary ] } diff --git a/aws/provider/main.tf b/aws/provider/main.tf index 70d0a6f..3e0ee65 100644 --- a/aws/provider/main.tf +++ b/aws/provider/main.tf @@ -8,7 +8,7 @@ resource "aws_ecr_repository" "primary" { for_each = var.repositories != "" ? toset(split(",", var.repositories)) : [] name = each.key - image_tag_mutability = "MUTABLE" + image_tag_mutability = var.image_tag_mutability encryption_configuration { encryption_type = "KMS" diff --git a/aws/provider/variables.tf b/aws/provider/variables.tf index cbb71c4..cbda8e0 100644 --- a/aws/provider/variables.tf +++ b/aws/provider/variables.tf @@ -8,4 +8,8 @@ variable "project_id" { variable "repositories" { type = string default = "" -} \ No newline at end of file +} +variable "image_tag_mutability" { + type = string + default = "" +} diff --git a/version b/version index 84e5de6..071c786 100644 --- a/version +++ b/version @@ -1 +1 @@ -24.4.0 \ No newline at end of file +24.4.1 \ No newline at end of file