Skip to content

Commit f47c823

Browse files
committed
chore: unify ci workflow
Use a shared workflow from shared-workflows repo
1 parent c30f4fd commit f47c823

File tree

9 files changed

+60
-146
lines changed

9 files changed

+60
-146
lines changed

.github/workflows/workflow.yaml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
name: Terraform CI
2-
3-
on: push
2+
on:
3+
push:
4+
merge_group:
5+
types: [checks_requested]
46

57
jobs:
6-
validate:
7-
name: Validate
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Check out code
11-
uses: actions/checkout@v1
12-
13-
- uses: hashicorp/setup-terraform@v3
14-
with:
15-
terraform_version: "1.5"
16-
17-
# note: we can only validate the example atm. see https://github.com/hashicorp/terraform/issues/28490
18-
- run: terraform init -backend=false
19-
working-directory: examples/basic-aws-integration
20-
21-
- run: terraform validate
22-
working-directory: examples/basic-aws-integration
23-
24-
- run: terraform fmt -recursive -check
8+
build:
9+
uses: meshcloud/shared-workflows/.github/workflows/terraform-meshplatform-modules-build-workflow.yml@main

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [v0.3.0]
99

1010
### Added
11+
1112
- Added workload identity federation
1213
- Added option to disable access keys
1314

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,22 @@ For an overview of the module structure, refer to [generated terraform docs](./T
113113
EOF
114114
```
115115
116-
2. Download the example `main.tf` and `outputs.tf` files.
117-
118-
```sh
119-
# Downloads main.tf and outputs.tf files into ~/terraform-aws-meshplatform
120-
wget https://raw.githubusercontent.com/meshcloud/terraform-aws-meshplatform/main/examples/basic-aws-integration/main.tf -O ~/terraform-aws-meshplatform/main.tf
121-
wget https://raw.githubusercontent.com/meshcloud/terraform-aws-meshplatform/main/examples/basic-aws-integration/outputs.tf -O ~/terraform-aws-meshplatform/outputs.tf
116+
2. Create a terraform file that calls this module and produces outputs. Similar to:
117+
118+
```hcl
119+
module "meshplatform" {
120+
source = "git::https://github.com/meshcloud/terraform-aws-meshplatform.git"
121+
# FILL INPUTS
122+
}
123+
output "meshplatform" {
124+
sensitive = true
125+
value = module.meshplatform
126+
}
122127
```
123128
124-
3. Open `~/terraform-aws-meshplatform/main.tf` with a text editor. Modify the module variables and Terraform state backend settings in the file.
129+
> It is highly recommended to configure a [terraform backend](https://developer.hashicorp.com/terraform/language/settings/backends/configuration), otherwise you risk losing track of your applied resources.
125130
126-
4. Execute the module.
131+
3. Execute the module.
127132
128133
```sh
129134
# Changes into ~/terraform-aws-meshplatform and applies terraform
@@ -132,23 +137,19 @@ For an overview of the module structure, refer to [generated terraform docs](./T
132137
terraform apply
133138
```
134139
135-
5. Access terraform output and pass it securely to meshcloud.
140+
4. Use the information from terraform output to configure the platform in meshStack.
136141
137142
```sh
138-
# The JSON output contains sensitive values that must not be transmitted to meshcloud in plain text.
143+
# The JSON output contains sensitive values that must not be transmitted anywhere other then the platform config screen in meshStack.
139144
terraform output -json
140145
```
141146
142-
## Example Usages
143-
144-
Check [examples](./examples/) for different use cases. As a quick start we recommend using [basic-aws-integration](./examples/basic-aws-integration) example.
145-
146147
[^1]: This How-To guides you through the setup from your Cloudshell. You can also run the terraform scripts on your local machine.
147148
[^2]: You can also use other [ways to assign values input variables](https://www.terraform.io/language/values/variables#assigning-values-to-root-module-variables).
148149
149150
## Contributing Guide
150151
151-
Before opening a Pull Request, we recommend following the below steps to get a faster approval:
152+
Before opening a Pull Request, please do the following:
152153
153154
1. Install [pre-commit](https://pre-commit.com/#install)
154155

TERRAFORM_DOCS.md

Whitespace-only changes.

default.nix

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{ pkgs ? import <nixpkgs> { }, system ? builtins.currentSystem }:
2+
3+
let
4+
# fake opentofu as terraform so that tools like terraform-docs pre-commit hook (which doesn't have tofu support)
5+
# fall back to tofu
6+
tofu_terraform =
7+
pkgs.stdenv.mkDerivation {
8+
name = "tofu-terraform";
9+
phases = [ "installPhase" ];
10+
installPhase = ''
11+
mkdir -p $out/bin
12+
echo '#!/usr/bin/env sh' > $out/bin/terraform
13+
echo 'tofu $@' > $out/bin/terraform
14+
chmod +x $out/bin/terraform
15+
'';
16+
};
17+
18+
in
19+
20+
pkgs.mkShell {
21+
NIX_SHELL = "terraform-meshplatform-modules";
22+
shellHook = ''
23+
echo starting terraform-meshplatform-modules shell
24+
'';
25+
26+
buildInputs = [
27+
pkgs.pre-commit
28+
pkgs.opentofu
29+
pkgs.tflint
30+
pkgs.terraform-docs
31+
32+
# fake tofu as terraform
33+
tofu_terraform
34+
];
35+
}

examples/basic-aws-integration/main.tf

Lines changed: 0 additions & 50 deletions
This file was deleted.

examples/basic-aws-integration/outputs.tf

Lines changed: 0 additions & 58 deletions
This file was deleted.

modules/meshcloud-cost-explorer/ce-management-account-access/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
| Name | Version |
1111
|------|---------|
12-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.21.0 |
12+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.7.0 |
1313

1414
## Modules
1515

modules/meshcloud-replicator/replicator-management-account-access/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
| Name | Version |
1111
|------|---------|
12-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.21.0 |
12+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.7.0 |
1313

1414
## Modules
1515

0 commit comments

Comments
 (0)