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 #21

Merged
merged 2 commits 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
8 changes: 0 additions & 8 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# How to run the tests

Initialise terraform workspace within the `test/unit-test` directory

```
cd test/unit-test
aws-vault exec mod -- terraform init
aws-vault exec mod -- terraform workspace select testing-test
```

Run the tests from within the `test` directory

```
Expand Down
13 changes: 0 additions & 13 deletions test/unit-test/backend.tf

This file was deleted.

2 changes: 1 addition & 1 deletion test/unit-test/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ 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" }
Expand Down
4 changes: 2 additions & 2 deletions test/unit-test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module "vm-import" {

source = "github.com/ministryofjustice/modernisation-platform-terraform-aws-vm-import?ref=v1.0.2"

bucket_prefix = local.application_data.accounts[local.environment].bucket_prefix
bucket_prefix = local.application_data.accounts["test"].bucket_prefix
tags = local.tags
application_name = local.application_name
account_number = local.environment_management.account_ids[terraform.workspace]
account_number = local.environment_management.account_ids["testing-test"]

}
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