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

feat(ci): Add base template of tfmod #1

Merged
merged 4 commits into from
Sep 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ README-generated.md
.tflint_example.hcl

tfmod-scaffold/
scripts

25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,36 @@ Enjoy it by following steps:
<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.
| Name | Version |
|---------------------------------------------------------------------------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.2 |
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.1 |

## Providers

No providers.
| Name | Version |
|------------------------------------------------------|---------|
| <a name="provider_null"></a> [null](#provider\_null) | >= 3.1 |

## Modules

No modules.

## Resources

No resources.
| Name | Type |
|------------------------------------------------------------------------------------------------------------|----------|
| [null_resource.nop](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------------------------------------------------|---------------|----------|---------|:--------:|
| <a name="input_echo"></a> [echo](#input\_echo) | Hello, world! | `string` | n/a | yes |
| Name | Description | Type | Default | Required |
|-----------------------------------------------------------------|------------------|----------|---------|:--------:|
| <a name="input_echo_text"></a> [echo\_text](#input\_echo\_text) | The text to echo | `string` | n/a | yes |

## Outputs

| Name | Description |
|--------------------------------------------------|-------------|
| <a name="output_echo"></a> [echo](#output\_echo) | n/a |
| Name | Description |
|-------------------------------------------------------------------|------------------|
| <a name="output_echo_text"></a> [echo\_text](#output\_echo\_text) | The text to echo |
<!-- END_TF_DOCS -->
3 changes: 2 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
output "echo_text" {
value = var.echo_text
value = var.echo_text
description = "The text to echo"
}

1 change: 0 additions & 1 deletion scripts

This file was deleted.

7 changes: 3 additions & 4 deletions test/e2e/terraform_test.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package e2e

import (
"regexp"
"regexp"
"testing"

test_helper "github.com/Azure/terraform-module-test-helper"
test_helper "github.com/Azure/terraform-module-test-helper"
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
)

func TestExamplesBasic(t *testing.T) {
test_helper.RunE2ETest(t, "../../", "examples/basic", terraform.Options{
test_helper.RunE2ETest(t, "../../", "examples/basic", terraform.Options{
Upgrade: true,
}, func(t *testing.T, output test_helper.TerraformOutput) {
gotEchoText, ok := output["echo_text"].(string)
assert.True(t, ok)
assert.Regexp(t, regexp.MustCompile("Hello, world!"), gotEchoText)
})
}

1 change: 0 additions & 1 deletion test/upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ func TestExampleUpgrade_basic(t *testing.T) {
Upgrade: true,
}, currentMajorVersion)
}

2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
variable "echo_text" {
type = string
description = "The text to echo"
}

10 changes: 10 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = ">= 1.2"

required_providers {
null = {
source = "hashicorp/null"
version = ">= 3.1"
}
}
}