diff --git a/README.md b/README.md index aba85d0..157f1d9 100644 --- a/README.md +++ b/README.md @@ -1 +1,25 @@ # terraform-hashicorp-s1 +A simple module to return HashiCorp's S-1 filing status + +## Requirements + +No requirements. + +## Providers + +| Name | Version | +|------|---------| +| sec | n/a | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| company\_name | name of company to lookup s-1 status | `string` | `"hashicorp"` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| s1\_status | status message regarding s-1 filing | + diff --git a/locals.tf b/locals.tf new file mode 100644 index 0000000..de28494 --- /dev/null +++ b/locals.tf @@ -0,0 +1,3 @@ +locals { + message = data.sec_s1_filing.company.status ? "has filed their s-1" : "has not filed their s-1" +} diff --git a/main.tf b/main.tf index 21d272c..5472626 100644 --- a/main.tf +++ b/main.tf @@ -6,20 +6,3 @@ terraform { } } -variable "company_name" { - type = string - description = "name of company to lookup s-1 status" - default = "hashicorp" -} - -locals { - message = data.sec_s1_filing.company.status ? "has filed their s-1" : "has not filed their s-1" -} - -data "sec_s1_filing" "company" { - name = var.company_name -} - -output "s1_status" { - value = "${data.sec_s1_filing.company.name} ${local.message}" -} diff --git a/outputs.tf b/outputs.tf new file mode 100644 index 0000000..793173c --- /dev/null +++ b/outputs.tf @@ -0,0 +1,4 @@ +output "s1_status" { + description = "status message regarding s-1 filing" + value = "${data.sec_s1_filing.company.name} ${local.message}" +} diff --git a/s1_filing.tf b/s1_filing.tf new file mode 100644 index 0000000..038d0b2 --- /dev/null +++ b/s1_filing.tf @@ -0,0 +1,3 @@ +data "sec_s1_filing" "company" { + name = var.company_name +} diff --git a/variables.tf b/variables.tf new file mode 100644 index 0000000..d136892 --- /dev/null +++ b/variables.tf @@ -0,0 +1,5 @@ +variable "company_name" { + type = string + description = "name of company to lookup s-1 status" + default = "hashicorp" +}