Skip to content

Commit

Permalink
feat: The DA has been refactored so that it will work the latest depe…
Browse files Browse the repository at this point in the history
…ndant modules and the latest terraform version (#24)

BREAKING CHANGE: Upgrading from a previous version to this version will destroy and recreate infrastructure
  • Loading branch information
terraform-ibm-modules-ops authored Oct 23, 2024
1 parent 666c769 commit 5537833
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 95 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Update status and "latest release" badges:
1. For the status options, see https://terraform-ibm-modules.github.io/documentation/#/badge-status
2. Update the "latest release" badge to point to the correct module's repo. Replace "terraform-ibm-module-template" in two places.
-->
[![Incubating (Not yet consumable)](https://img.shields.io/badge/status-Incubating%20(Not%20yet%20consumable)-red)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
[![Stable (With quality checks)](https://img.shields.io/badge/Status-Stable%20(With%20quality%20checks)-green)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-web-app-mzr-da?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-web-app-mzr-da/releases/latest)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
Expand Down
58 changes: 29 additions & 29 deletions solutions/e2e/README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions solutions/e2e/app-tier.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ data "ibm_is_image" "app_is_image" {
}

module "app_tier_autoscale" {
source = "github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vsi-autoscale?ref=v1.0.0"
source = "github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vsi-autoscale?ref=v1.0.2"
prefix = "${var.prefix}-app-tier"
resource_group_id = local.vpc_data.resource_group_id
resource_group_id = local.vpc_data.vpc_data.resource_group
zone = "${var.region}-1"
image_id = data.ibm_is_image.app_is_image.id
subnets = local.app_tier_subnets
vpc_id = local.vpc_data.id
vpc_id = local.vpc_data.vpc_id
placement_group_id = null
machine_type = var.app_machine_type
ssh_key_ids = [module.landing_zone.ssh_key_data[0].id]
Expand Down
6 changes: 3 additions & 3 deletions solutions/e2e/data-tier.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ resource "random_password" "password" {

module "data_tier_vsi" {
source = "terraform-ibm-modules/landing-zone-vsi/ibm"
version = "4.0.0"
resource_group_id = local.vpc_data.resource_group_id
version = "4.2.0"
resource_group_id = local.vpc_data.vpc_data.resource_group
prefix = "${var.prefix}-data-vsi"
vpc_id = local.vpc_data.id
vpc_id = local.vpc_data.vpc_id
subnets = local.data_tier_subnets
image_id = data.ibm_is_image.data_is_image.id
ssh_key_ids = [module.landing_zone.ssh_key_data[0].id]
Expand Down
11 changes: 5 additions & 6 deletions solutions/e2e/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
##############################################################################

module "landing_zone" {
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone.git//patterns/vsi?ref=v5.20.2"
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone.git//patterns/vsi/module?ref=v6.1.2"
prefix = var.prefix
region = var.region
ibmcloud_api_key = var.ibmcloud_api_key
ssh_public_key = var.ssh_key
override_json_string = templatefile("${path.module}/override.tftpl", { prefix = var.prefix })
}
Expand Down Expand Up @@ -40,7 +39,7 @@ module "sm_resource_group" {
count = var.sm_instance_rg_existing || (!var.sm_instance_rg_existing && var.sm_instance_rg_name != null) ? 1 : 0

source = "terraform-ibm-modules/resource-group/ibm"
version = "1.1.5"
version = "1.1.6"

resource_group_name = !var.sm_instance_rg_existing ? var.sm_instance_rg_name : null
existing_resource_group_name = var.sm_instance_rg_existing ? var.sm_instance_rg_name : null
Expand All @@ -66,7 +65,7 @@ module "private_secret_engine" {
depends_on = [ibm_resource_instance.secrets_manager]
count = (var.use_sm && var.existing_sm_instance_guid == null) ? 1 : 0
source = "terraform-ibm-modules/secrets-manager-private-cert-engine/ibm"
version = "1.2.2"
version = "1.3.3"
secrets_manager_guid = local.sm_guid
region = local.sm_region
root_ca_name = var.root_ca_name
Expand All @@ -83,7 +82,7 @@ module "private_secret_engine" {
# Create a secret group to place the certificate in
module "secrets_manager_group" {
source = "terraform-ibm-modules/secrets-manager-secret-group/ibm"
version = "1.1.4"
version = "1.2.2"
count = var.use_sm ? 1 : 0
region = local.sm_region
secrets_manager_guid = local.sm_guid
Expand All @@ -98,7 +97,7 @@ module "secrets_manager_group" {
module "secrets_manager_private_certificate" {
depends_on = [module.private_secret_engine]
source = "terraform-ibm-modules/secrets-manager-private-cert/ibm"
version = "1.1.3"
version = "1.3.1"
count = var.use_sm ? 1 : 0
cert_name = "${var.prefix}-cts-vpn-private-cert"
cert_description = "Example private cert"
Expand Down
7 changes: 4 additions & 3 deletions solutions/e2e/version.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
terraform {
required_version = ">= 1.3.0"
# Lock DA into an exact provider version - renovate automation will keep it updated
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.60.0"
version = "1.70.1"
}
random = {
source = "hashicorp/random"
version = "3.6.0"
version = "3.6.3"
}
null = {
source = "hashicorp/null"
version = "3.2.2"
version = "3.2.3"
}
}
}
10 changes: 5 additions & 5 deletions solutions/e2e/web-tier.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ locals {

## VPC data for workload
vpc_data = flatten([
for vpc in module.landing_zone.vpc_resource_list : [
for vpc in module.landing_zone.vpc_data : [
vpc
] if strcontains(vpc.name, local.workload_vpc)
] if strcontains(vpc.vpc_name, local.workload_vpc)
])[0]

web_tier_subnets = flatten([
Expand Down Expand Up @@ -36,13 +36,13 @@ data "ibm_is_image" "web_is_image" {

module "web_tier_autoscale" {
depends_on = [ibm_iam_authorization_policy.s2s_lb_to_sm]
source = "github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vsi-autoscale?ref=v1.0.0"
source = "github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vsi-autoscale?ref=v1.0.2"
prefix = "${var.prefix}-web-tier"
resource_group_id = local.vpc_data.resource_group_id
resource_group_id = local.vpc_data.vpc_data.resource_group
zone = "${var.region}-1"
image_id = data.ibm_is_image.web_is_image.id
subnets = local.web_tier_subnets
vpc_id = local.vpc_data.id
vpc_id = local.vpc_data.vpc_id
placement_group_id = null
machine_type = var.web_machine_type
ssh_key_ids = [module.landing_zone.ssh_key_data[0].id]
Expand Down
31 changes: 16 additions & 15 deletions tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module github.com/terraform-ibm-modules/terraform-ibm-web-app-mzr-da

go 1.21
go 1.22.0

toolchain go1.22.4
toolchain go1.23.2

require (
github.com/gruntwork-io/terratest v0.47.2
github.com/stretchr/testify v1.9.0
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.35.2
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.41.1
)

require (
Expand All @@ -16,12 +17,13 @@ require (
cloud.google.com/go/iam v1.1.1 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/IBM-Cloud/bluemix-go v0.0.0-20240423071914-9e96525baef4 // indirect
github.com/IBM-Cloud/power-go-client v1.6.0 // indirect
github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be // indirect
github.com/IBM-Cloud/power-go-client v1.8.3 // indirect
github.com/IBM/cloud-databases-go-sdk v0.7.0 // indirect
github.com/IBM/go-sdk-core/v5 v5.17.3 // indirect
github.com/IBM/platform-services-go-sdk v0.63.1 // indirect
github.com/IBM/project-go-sdk v0.3.0 // indirect
github.com/IBM/go-sdk-core/v5 v5.18.0 // indirect
github.com/IBM/platform-services-go-sdk v0.69.3 // indirect
github.com/IBM/project-go-sdk v0.3.6 // indirect
github.com/IBM/schematics-go-sdk v0.3.0 // indirect
github.com/IBM/vpc-go-sdk v1.0.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
Expand Down Expand Up @@ -62,12 +64,11 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/gruntwork-io/terratest v0.46.15 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.7.4 // indirect
github.com/hashicorp/go-getter v1.7.6 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl/v2 v2.17.0 // indirect
Expand Down Expand Up @@ -100,13 +101,13 @@ require (
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.127.0 // indirect
Expand Down
Loading

0 comments on commit 5537833

Please sign in to comment.