Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Remove reliance on remote backend #30

Merged
merged 1 commit into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/go-terratest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ jobs:
with:
terraform_version: 1.0.1
terraform_wrapper: false
- name: set terraform workspace
run: |
#CONFIGURE TERRAFORM AND WORKSPACE
terraform -chdir="test/unit-test" init
terraform -chdir="test/unit-test" workspace select testing-test
- name: Download Go Modules
working-directory: test
run: go mod download
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.env
.terraform.lock.hcl
.terraform/
.idea/
.idea/
terraform.tfstate
terraform.tfstate.backup
13 changes: 0 additions & 13 deletions test/unit-test/backend.tf

This file was deleted.

6 changes: 3 additions & 3 deletions test/unit-test/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ locals {

# Merge tags from the environment json file with additional ones
tags = merge(
jsondecode(data.http.environments_file.body).tags,
jsondecode(data.http.environments_file.response_body).tags,
{ "is-production" = local.is-production },
{ "environment-name" = terraform.workspace },
{ "source-code" = "https://github.com/ministryofjustice/modernisation-platform" }
)

environment = trimprefix(terraform.workspace, "${var.networking[0].application}-")
environment = trimprefix("testing-test", "${var.networking[0].application}-")
vpc_name = var.networking[0].business-unit
subnet_set = var.networking[0].set
vpc_all = "${local.vpc_name}-${local.environment}"
subnet_set_name = "${var.networking[0].business-unit}-${local.environment}-${var.networking[0].set}"

is_live = [substr(terraform.workspace, length(local.application_name), length(terraform.workspace)) == "-production" || substr(terraform.workspace, length(local.application_name), length(terraform.workspace)) == "-preproduction" ? "live" : "non-live"]
provider_name = "core-vpc-${local.environment}"
provider_name = "testing-test"

domain_types = { for dvo in aws_acm_certificate.external.domain_validation_options : dvo.domain_name => {
name = dvo.resource_record_name
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
provider "aws" {
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids[terraform.workspace]}:role/MemberInfrastructureAccess"
role_arn = "arn:aws:iam::${local.environment_management.account_ids["testing-test"]}:role/MemberInfrastructureAccess"
}
}

Expand Down