-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee8eeea
commit c3d38b3
Showing
8 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: terraform | ||
on: push | ||
|
||
jobs: | ||
tfsec: | ||
uses: skyleague/node-standards/.github/workflows/reusable-tfsec.yml@main | ||
with: | ||
terraform-version: "1.7.1" | ||
working-directory: "./" | ||
# tfsec-var-files: '["test/default.tfvars", "test/a.tfvars"]' | ||
|
||
tests: | ||
name: tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup terraform and cache | ||
uses: skyleague/node-standards/.github/actions/setup-terraform@main | ||
with: | ||
terraform-version: "1.7.1" | ||
working-directory: "./test" | ||
github-app-id: ${{ secrets.GITHUB_APP_ID }} | ||
github-app-pem: ${{ secrets.GITHUB_APP_PEM }} | ||
- name: terraform init | ||
run: terraform init | ||
working-directory: "./test" | ||
- name: terraform test | ||
run: terraform test | ||
working-directory: "./test" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
variable "name" { | ||
type = string | ||
} | ||
|
||
variable "file" { | ||
type = string | ||
} | ||
|
||
variable "template_parameters" { | ||
type = map(string) | ||
default = null | ||
} | ||
|
||
module "sfn" { | ||
source = "../" | ||
|
||
name = var.name | ||
definition = { | ||
file = "${abspath(path.module)}/${var.file}" | ||
template_parameters = var.template_parameters | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"definition": "{\"foo\":\"${bar}\", \"region\":\"${aws_region}\"}", | ||
"lambda_arns": "[]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
mock_provider "aws" { | ||
alias = "mock" | ||
|
||
override_data { | ||
target = module.sfn.data.aws_iam_policy_document.tracing | ||
values = { | ||
json = "{}" | ||
} | ||
} | ||
|
||
override_data { | ||
target = module.sfn.data.aws_region.current | ||
values = { | ||
name = "eu-west-1" | ||
} | ||
} | ||
} | ||
|
||
run "template_parameters_replaced_correctly" { | ||
command = plan | ||
|
||
providers = { | ||
aws = aws.mock | ||
} | ||
|
||
variables { | ||
name = "foo" | ||
file = "stubs/definition.json" | ||
template_parameters = { | ||
bar = "baz" | ||
} | ||
} | ||
|
||
assert { | ||
condition = jsondecode(module.sfn.state_machine.definition) == { foo = "baz", region = "eu-west-1" } | ||
error_message = "Template was not rendered correctly" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters