Skip to content

Commit

Permalink
Merge pull request #36 from ministryofjustice/localstack
Browse files Browse the repository at this point in the history
Using localstack rather than real AWS Account
  • Loading branch information
Alejandro Garrido Mota authored Feb 2, 2021
2 parents 7c473b0 + bda6f7a commit 024865b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ jobs:
go-tests:
name: Run Terratest Unit Tests
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
services:
localstack:
image: localstack/localstack:latest
env:
SERVICES: iam,sts,s3
DEFAULT_REGION: eu-west-2
ports:
- 4566:4566
- 4571:4571
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
15 changes: 14 additions & 1 deletion test/unit-test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@ terraform {
}

provider "aws" {
region = "eu-west-2"
access_key = "mock_access_key"
secret_key = "mock_secret_key"
region = "eu-west-2"
s3_force_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true

endpoints {
ec2 = "http://localhost:4566"
iam = "http://localhost:4566"
s3 = "http://localhost:4566"
sts = "http://localhost:4566"
}
}

module "s3" {
Expand Down

0 comments on commit 024865b

Please sign in to comment.