Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reliance on remote backend #17

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
13 changes: 0 additions & 13 deletions test/unit-test/backend.tf

This file was deleted.

4 changes: 2 additions & 2 deletions test/unit-test/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ 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}"
Expand Down
3 changes: 2 additions & 1 deletion test/unit-test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ locals {
}
}
}

data "aws_vpc" "shared" {
tags = {
"Name" = "${var.networking[0].business-unit}-${local.environment}"
Expand Down Expand Up @@ -69,7 +70,7 @@ module "lb_access_logs_enabled" {
loadbalancer_ingress_rules = local.loadbalancer_ingress_rules
loadbalancer_egress_rules = local.loadbalancer_egress_rules
tags = local.tags
account_number = local.environment_management.account_ids[terraform.workspace]
account_number = local.environment_management.account_ids["testing-test"]
region = "eu-west-2"
enable_deletion_protection = false
idle_timeout = 60
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