Skip to content
Open
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: 1 addition & 1 deletion .github/workflows/ci-terraform-examples-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
'examples/gcp-bootstrap-cft',
'examples/gcp-bootstrap-simple',
]
terraform_version: [ '~1.6.0', '~1.7.0', '~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0', '~1.12.0', 'latest' ]
terraform_version: [ '~1.7.0', '~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0', '~1.12.0', 'latest' ]
uses: ./.github/workflows/ci-terraform-example.yaml
with:
terraform_version: ${{ matrix.terraform_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-terraform-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
'examples-dev/aws',
'examples-dev/gcp',
]
terraform_version: [ '~1.6.0', '~1.7.0', '~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0', '~1.12.0', 'latest' ]
terraform_version: [ '~1.7.0', '~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0', '~1.12.0', 'latest' ]
uses: ./.github/workflows/ci-terraform-example.yaml
with:
terraform_version: ${{ matrix.terraform_version }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci-terraform-modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
terraform_version: [
# '~1.6.0', # doesn't support mock_provider
'~1.7.0', '~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0', '~1.12.0', 'latest' ]
terraform_version: [ '~1.7.0', '~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0', '~1.12.0', 'latest' ]
module:
# Modules that only need validation
- { name: 'psoxy-constants', test: false }
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ You will need all the following in your deployment environment (eg, your laptop)
| [git](https://git-scm.com/) | 2.17+ | `git --version` |
| [Maven](https://maven.apache.org/) | 3.6+ ; 3.9.10+ required for java 24 | `mvn -v` |
| [Java JDK 17+](https://openjdk.org/install/) | 17, 21, 24 (see notes) | `mvn -v \| grep Java` |
| [Terraform](https://www.terraform.io/) | 1.6+, < 2.0 | `terraform version` |
| [Terraform](https://www.terraform.io/) | 1.7+, < 2.0 | `terraform version` |


NOTE: we will support Java versions for duration of official support windows, in particular the LTS versions. Minor versions, such as 18-20, 22-23 which are out of official support, may work but are not routinely tested.

NOTE: Using `terraform` is not strictly necessary, but it is the only supported method. You may provision your infrastructure via your host's CLI, web console, or another infrastructure provisioning tool, but we don't offer documentation or support in doing so. Adapting one of our [terraform examples](https://github.com/Worklytics/psoxy/tree/main/infra/examples) or writing your own config that re-uses our [modules](https://github.com/Worklytics/psoxy/tree/main/infra/modules) will simplify things greatly.

NOTE: from v0.4.59, we've relaxed Terraform version constraint on our modules to allow up to 1.9.x. However, we are not officially supporting this, as we strive to maintain compatibility with both OpenTofu and Terraform.
NOTE: from v0.6.x, we require Terraform 1.7.x as minimum. We strive to maintain compatibility with both OpenTofu and Terraform.

Depending on your Cloud Host / Data Sources, you will need:

Expand Down
8 changes: 4 additions & 4 deletions docs/development/terraform-versions.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Terraform Version Compatibility

We use CI to automate testing against *latest* version of each minor version of Terraform
(eg 1.3.x, 1.4.x, etc that we support).
(eg 1.7.x, 1.8.x, etc that we support).

Given that Hashicorp has changed Terraform licensing to ELv2; and that Linux foundation has forked
Terraform from 1.5.x to [create OpenTofu](https://opentofu.org/blog/the-opentofu-fork-is-now-available/),
we are targeting compatibility with 1.6.x feature set.
we are targeting compatibility with 1.7.x feature set.

Do NOT use any features from 1.3.x or later, as we wish to allow all our terraform modules/examples
to work with Terraform back to 1.3.x, which is vintage Sept 2022.
Do NOT use any features from 1.9.x or later, as we wish to allow all our terraform modules/examples
to work with Terraform 1.7.x minimum, which is vintage 2024.

In particular, **features to NOT use**:
- `removed` block - introduced in 1.7 (this is our major constraint to maintain compatibility with OpenTofu)
Expand Down
4 changes: 2 additions & 2 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Module module.psoxy (from git::https://github.com/worklytics/psoxy//infra/module
│ this version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.
```

The solution is to downgrade your Terraform version to one that's supported by our modules (>= 1.3.x, <= 1.7.x as of March 2024).
The solution is to use a Terraform version that's supported by our modules (>= 1.7.x, < 2.0 as of v0.6.x).

_If you're running Terraform in cloud/CI environment,_ including Terraform Cloud, GitHub Actions, etc, you can likely explicitly set the desired Terraform version in your workspace settings / terraform setup action.

_If you're running Terraform on your laptop or in a VM,_ use your package manager to downgrade or something like [`tfenv`](https://github.com/tfutils/tfenv) to concurrently use distinct Terraform versions on the machine. (set version <= 1.7.x in `.terraform-version` file in the root of your Terraform configuration for the proxy).
_If you're running Terraform on your laptop or in a VM,_ use your package manager to upgrade or something like [`tfenv`](https://github.com/tfutils/tfenv) to concurrently use distinct Terraform versions on the machine. (set version >= 1.7.x in `.terraform-version` file in the root of your Terraform configuration for the proxy).
2 changes: 1 addition & 1 deletion infra/examples-dev/aws/.terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.6
1.7.5
2 changes: 1 addition & 1 deletion infra/examples-dev/aws/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3, < 2.0"
required_version = ">= 1.7, < 2.0"

required_providers {
# for the infra that will host Psoxy instances
Expand Down
2 changes: 1 addition & 1 deletion infra/examples-dev/gcp/.terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.6
1.7.5
2 changes: 1 addition & 1 deletion infra/examples-dev/gcp/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3, < 2.0"
required_version = ">= 1.7, < 2.0"

required_providers {
google = {
Expand Down
2 changes: 1 addition & 1 deletion infra/modules/aws-host/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3, < 2.0"
required_version = ">= 1.7, < 2.0"

required_providers {
aws = {
Expand Down
2 changes: 1 addition & 1 deletion infra/modules/gcp-host/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.6, < 2.0" # should work with 1.6, but we don't automate testing against that version anymore
required_version = ">= 1.7, < 2.0"
}

# constants
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3, < 2.0"
required_version = ">= 1.7, < 2.0"
}

terraform {
Expand Down
11 changes: 5 additions & 6 deletions infra/modules/worklytics-connectors-msft-365/main.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
terraform {
required_version = ">= 1.3, < 2.0"
required_version = ">= 1.7, < 2.0"
}

locals {
environment_id_prefix = "${var.environment_id}${length(var.environment_id) > 0 ? "-" : ""}"
environment_id_display_name_qualifier = length(var.environment_id) > 0 ? " ${var.environment_id} " : ""
}

# beginning of current month - used for example API calls to provide recent but fairly stable dates
# this will only change monthly, preventing churning while keeping examples relevant
resource "time_static" "month_start" {
rfc3339 = formatdate("YYYY-MM-01'T'00:00:00Z", timestamp())
# a timestamp used to seed example test API calls, so that they're likely to return interesting data, but the terraform test scripts don't churn too much
resource "time_rotating" "example_timestamp" {
rotation_days = 365
}

module "worklytics_connector_specs" {
Expand All @@ -25,7 +24,7 @@ module "worklytics_connector_specs" {
msft_teams_example_call_guid = var.msft_teams_example_call_guid
msft_teams_example_call_record_guid = var.msft_teams_example_call_record_guid
msft_teams_example_online_meeting_join_url = var.msft_teams_example_online_meeting_join_url
example_api_calls_sample_date = time_static.month_start.id
example_api_calls_sample_date = time_rotating.example_timestamp.id
}

locals {
Expand Down
10 changes: 10 additions & 0 deletions infra/modules/worklytics-connectors-msft-365/migration_0_6_1.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# migration to drop time_static
# use of `removed` here makes min Terraform version 1.6.x, which as of 0.5.x we allow down to 1.3.x
removed {
from = time_static.month_start

lifecycle {
destroy = true # shouldn't matter
}

}
2 changes: 1 addition & 1 deletion infra/modules/worklytics-connectors/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3, < 2.0"
required_version = ">= 1.7, < 2.0"
}

module "worklytics_connector_specs" {
Expand Down
16 changes: 16 additions & 0 deletions tools/check-prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ if ! terraform -v &> /dev/null ; then
exit 1
fi

# Check Terraform version
TERRAFORM_VERSION=`terraform -v | head -n 1`
TERRAFORM_VERSION_MAJOR_MINOR=$(echo $TERRAFORM_VERSION | sed -n 's/^Terraform v\([0-9]*\.[0-9]*\).*$/\1/p')
printf "Your Terraform version is ${BLUE}${TERRAFORM_VERSION}${NC}.\n"

# Parse Terraform version components
TF_MAJOR=$(echo "$TERRAFORM_VERSION_MAJOR_MINOR" | cut -d. -f1)
TF_MINOR=$(echo "$TERRAFORM_VERSION_MAJOR_MINOR" | cut -d. -f2)
if (( TF_MAJOR < 1 || (TF_MAJOR == 1 && TF_MINOR < 7) )); then
printf "${RED}This Terraform version is unsupported.${NC} Psoxy requires Terraform 1.7.x or later.\n"
printf "We recommend you upgrade. See https://developer.hashicorp.com/terraform/downloads\n"
printf "Terraform is used to provision the infrastructure that will host your Psoxy instances\n"
if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install terraform${NC}\n"; fi
exit 1
fi

# Check Maven installation

if ! mvn -v &> /dev/null ; then
Expand Down
Loading