Skip to content

Commit dd9162f

Browse files
authored
feat(spaces): adds spaces + consolidates with the template (#62)
## what - This adds Spacelift Spaces and tests for them - Introduces a bunch of fixes and improvements from template module. ## why - Keeping our automation modules in order. ## references - [INT-70](https://www.notion.so/masterpoint/Move-Spacelift-Spaces-into-Automation-module-1e0859758a56807d9a20d15b3aac4136?pvs=4) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for managing multiple Spacelift Spaces dynamically via a new input variable. - Introduced a new resource for Spacelift Spaces with configurable attributes. - **Documentation** - Enhanced README with branding, organizational info, contribution guidelines, and updated Terraform provider constraints. - Added and updated configuration files for automated documentation generation. - **Chores** - Updated code owners and improved various configuration files for review, linting, and automation tools. - Upgraded tool and action versions across workflows and dependency management. - **Tests** - Added and updated tests to verify correct creation and configuration of Spacelift Spaces. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 0fa4144 commit dd9162f

16 files changed

+417
-199
lines changed

.coderabbit.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ language: en
77
tone_instructions: |
88
Provide feedback in a professional, friendly, constructive, and concise tone.
99
Offer clear, specific suggestions and best practices to help enhance the code quality and promote learning.
10+
Be concise and only comment on significant issues.
1011
1112
early_access: true
1213

@@ -26,21 +27,25 @@ knowledge_base:
2627
reviews:
2728
profile: chill
2829
auto_review:
29-
# Ignore reviewing if the title of the pull request contains any of these keywords (case-insensitive)
30+
# Disable incremental code review on each push
31+
auto_incremental_review: false
32+
# The keywords are case-insensitive
3033
ignore_title_keywords:
3134
- wip
3235
- draft
3336
- test
34-
# Set the commit status to 'pending' when the review is in progress and 'success' when it is complete.
3537
commit_status: false
36-
# Post review details on each review. Additionally, post a review status when a review is skipped in certain cases.
37-
review_status: false
3838
path_instructions:
3939
- path: "**/*.tf"
4040
instructions: |
41-
You're a Terraform expert who has thoroughly studied all the documentation from Hashicorp https://developer.hashicorp.com/terraform/docs and OpenTofu https://opentofu.org/docs/.
41+
You're a Terraform expert who has thoroughly studied all the documentation from Hashicorp https://developer.hashicorp.com/terraform/docs and OpenTofu https://opentofu.org/docs/.
4242
You have a strong grasp of Terraform syntax and prioritize providing accurate and insightful code suggestions.
4343
As a fan of the Cloud Posse / SweetOps ecosystem, you incorporate many of their best practices https://docs.cloudposse.com/best-practices/terraform/ while balancing them with general Terraform guidelines.
44+
changed_files_summary: false
45+
poem: false
46+
# Don't post review details on each review.
47+
review_status: false
48+
sequence_diagrams: false
4449
tools:
4550
# By default, all tools are enabled.
4651
# Masterpoint uses Trunk (https://trunk.io) so we do not need a lot of this feedback due to overlap.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Order is important: the last matching pattern takes the most precedence
55

66
# These owners will be the default owners for everything
7-
* @masterpointio/masterpoint-internal
7+
* @masterpointio/masterpoint-open-source

.github/configs/.prettierignore

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

.github/renovate.json5

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11
{
22
"extends": [
3-
"config:recommended",
4-
"github>aquaproj/aqua-renovate-config#2.6.0"
3+
"config:best-practices",
4+
"github>aquaproj/aqua-renovate-config#2.7.5"
55
],
6-
// Schedule once a month on the first day of the month before 4 AM.
7-
"schedule": ["* 0-3 1 * *"],
8-
"baseBranches": ["main", "master"],
9-
"labels": ["auto-upgrade"],
6+
"schedule": [
7+
"after 9am on the first day of the month"
8+
],
9+
"assigneesFromCodeOwners": true,
1010
"dependencyDashboardAutoclose": true,
11-
"packageRules": [{
12-
// Allow auto merge if it's not a major version update
13-
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
14-
"automerge": true
15-
}],
11+
"addLabels": [
12+
"auto-upgrade"
13+
],
14+
"enabledManagers": [
15+
"terraform"
16+
],
1617
"terraform": {
1718
"ignorePaths": [
18-
"**/context.tf",
19+
"**/context.tf" // Mixin file https://github.com/cloudposse/terraform-null-label/blob/main/exports/context.tf
1920
]
2021
},
21-
}
22+
"packageRules": [
23+
{
24+
"matchDepTypes": [
25+
"optionalDependencies"
26+
],
27+
// Allow auto merge if it's not a major version update
28+
"matchUpdateTypes": [
29+
"minor",
30+
"patch",
31+
"pin",
32+
"digest"
33+
],
34+
"automerge": true
35+
}
36+
]
37+
}

.github/workflows/release-please.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
permissions:
99
contents: write
1010
pull-requests: write
11+
issues: write
1112

1213
jobs:
1314
release-please:

.github/workflows/tf-test.yaml renamed to .github/workflows/test.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ permissions:
2020

2121
jobs:
2222
tf-test:
23-
name: ${{ matrix.tf }} Test
23+
name: 🧪 ${{ matrix.tf }} test
2424
runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
2727
tf: [tofu, terraform]
2828
steps:
29-
- uses: actions/checkout@v4
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3030

3131
- name: Aqua Cache
32-
uses: actions/cache@v4.2.3
32+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
3333
if: ${{ !github.event.act }} # Don't enable the cache step if we're using act for testing
3434
with:
3535
path: ~/.local/share/aquaproj-aqua
@@ -38,9 +38,9 @@ jobs:
3838
v1-aqua-installer-${{runner.os}}-${{runner.arch}}-
3939
4040
- name: Install Aqua
41-
uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1
41+
uses: aquaproj/aqua-installer@5e54e5cee8a95ee2ce7c04cb993da6dfad13e59c # v3.2.1
4242
with:
43-
aqua_version: v2.46.0
43+
aqua_version: v2.48.1
4444

4545
- name: Aqua Install
4646
shell: bash

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
# Output from other tools that might be used alongside Terraform/OpenTofu
3232
*.tfvars.json
33+
backend.tf.json
3334

3435
# Taskit files
3536
.taskit/

.terraform-docs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 0.20.0
2+
formatter: markdown table
3+
4+
recursive:
5+
enabled: false
6+
7+
settings:
8+
lockfile: false
9+
10+
output:
11+
file: README.md
12+
mode: inject
13+
template: |-
14+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
15+
{{ .Content }}
16+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

.terraform-docs.yml

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

.trunk/configs/.markdownlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ whitespace: false
1212
# Ignore MD041/first-line-heading/first-line-h1
1313
# Error: First line in a file should be a top-level heading
1414
MD041: false
15+
16+
# Ignore MD013/line-length
17+
MD013:
18+
strict: false
19+
line_length: 350

.trunk/trunk.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
33
version: 0.1
44
cli:
5-
version: 1.22.11
5+
version: 1.22.12
66
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
77
plugins:
88
sources:
99
- id: trunk
10-
ref: v1.6.7
10+
ref: v1.6.8
1111
uri: https://github.com/trunk-io/plugins
1212
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
1313
runtimes:
@@ -20,23 +20,24 @@ lint:
2020
# Incompatible with some Terraform features: https://github.com/tenable/terrascan/issues/1331
2121
- terrascan
2222
enabled:
23-
- tofu@1.9.0
23+
- tofu@1.9.1
2424
- actionlint@1.7.7
25-
- checkov@3.2.394
25+
- checkov@3.2.408
2626
- git-diff-check
2727
- markdownlint@0.44.0
2828
- prettier@3.5.3
2929
- tflint@0.56.0
30-
- trivy@0.61.0
31-
- trufflehog@3.88.20
30+
- trivy@0.61.1
31+
- trufflehog@3.88.25
3232
- yamllint@1.37.0
3333
ignore:
3434
- linters: [tofu]
3535
paths:
3636
- "**/backend.tf.json"
37-
- linters: [prettier, markdownlint]
37+
# Ignore CHANGELOG.md as release-please manages this file
38+
- linters: [ALL]
3839
paths:
39-
- CHANGELOG.md
40+
- "**/CHANGELOG.md"
4041
actions:
4142
enabled:
4243
- terraform-docs

README.md

Lines changed: 70 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
# `spacelift-automation`
1+
[![Banner][banner-image]](https://masterpoint.io/)
22

3-
[![Release](https://img.shields.io/github/release/masterpointio/terraform-spacelift-automation.svg)](https://github.com/masterpointio/terraform-spacelift-automation/releases/latest)
3+
# spacelift-automation
4+
5+
[![Release][release-badge]][latest-release]
6+
7+
💡 Learn more about Masterpoint [below](#who-we-are-𐦂𖨆𐀪𖠋).
8+
9+
## Purpose and Functionality
410

511
This Terraform child module provides infrastructure automation for projects in [Spacelift](https://docs.spacelift.io/).
612

7-
## Overview
13+
### Overview
814

915
This `spacelift-automation` child module is designed to streamline the deployment and management of all Spacelift infrastructure, including creating a Spacelift Stack to manage itself.
1016

@@ -225,7 +231,7 @@ This is to support easy local and outside-spacelift operations. Keeping variable
225231

226232
<!-- prettier-ignore-start -->
227233
<!-- markdownlint-disable -->
228-
<!-- BEGIN_TF_DOCS -->
234+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
229235
## Requirements
230236

231237
| Name | Version |
@@ -238,8 +244,8 @@ This is to support easy local and outside-spacelift operations. Keeping variable
238244

239245
| Name | Version |
240246
|------|---------|
241-
| <a name="provider_jsonschema"></a> [jsonschema](#provider\_jsonschema) | 0.2.1 |
242-
| <a name="provider_spacelift"></a> [spacelift](#provider\_spacelift) | 1.19.1 |
247+
| <a name="provider_jsonschema"></a> [jsonschema](#provider\_jsonschema) | >= 0.2.1 |
248+
| <a name="provider_spacelift"></a> [spacelift](#provider\_spacelift) | >= 1.14 |
243249

244250
## Modules
245251

@@ -253,6 +259,7 @@ This is to support easy local and outside-spacelift operations. Keeping variable
253259
|------|------|
254260
| [spacelift_aws_integration_attachment.default](https://registry.terraform.io/providers/spacelift-io/spacelift/latest/docs/resources/aws_integration_attachment) | resource |
255261
| [spacelift_drift_detection.default](https://registry.terraform.io/providers/spacelift-io/spacelift/latest/docs/resources/drift_detection) | resource |
262+
| [spacelift_space.default](https://registry.terraform.io/providers/spacelift-io/spacelift/latest/docs/resources/space) | resource |
256263
| [spacelift_stack.default](https://registry.terraform.io/providers/spacelift-io/spacelift/latest/docs/resources/stack) | resource |
257264
| [spacelift_stack_destructor.default](https://registry.terraform.io/providers/spacelift-io/spacelift/latest/docs/resources/stack_destructor) | resource |
258265
| [jsonschema_validator.runtime_overrides](https://registry.terraform.io/providers/bpedman/jsonschema/latest/docs/data-sources/validator) | data source |
@@ -307,6 +314,7 @@ This is to support easy local and outside-spacelift operations. Keeping variable
307314
| <a name="input_runtime_overrides"></a> [runtime\_overrides](#input\_runtime\_overrides) | Runtime overrides that are merged into the stack config.<br/> This allows for per-root-module overrides of the stack resources at runtime<br/> so you have more flexibility beyond the variable defaults and the static stack config files.<br/> Keys are the root module names and values match the StackConfig schema.<br/> See `stack-config.schema.json` for full details on the schema and<br/> `tests/fixtures/multi-instance/root-module-a/stacks/default-example.yaml` for a complete example. | `any` | `{}` | no |
308315
| <a name="input_space_id"></a> [space\_id](#input\_space\_id) | Place the created stacks in the specified space\_id. Mutually exclusive with space\_name. | `string` | `null` | no |
309316
| <a name="input_space_name"></a> [space\_name](#input\_space\_name) | Place the created stacks in the specified space\_name. Mutually exclusive with space\_id. | `string` | `null` | no |
317+
| <a name="input_spaces"></a> [spaces](#input\_spaces) | A map of Spacelift Spaces to create | <pre>map(object({<br/> description = optional(string, null)<br/> inherit_entities = optional(bool, false)<br/> labels = optional(list(string), null)<br/> parent_space_id = optional(string, "root")<br/> }))</pre> | `{}` | no |
310318
| <a name="input_terraform_smart_sanitization"></a> [terraform\_smart\_sanitization](#input\_terraform\_smart\_sanitization) | Indicates whether runs on this will use terraform's sensitive value system to sanitize<br/>the outputs of Terraform state and plans in spacelift instead of sanitizing all fields. | `bool` | `false` | no |
311319
| <a name="input_terraform_version"></a> [terraform\_version](#input\_terraform\_version) | Terraform version to use. | `string` | `"1.7.2"` | no |
312320
| <a name="input_terraform_workflow_tool"></a> [terraform\_workflow\_tool](#input\_terraform\_workflow\_tool) | Defines the tool that will be used to execute the workflow.<br/>This can be one of OPEN\_TOFU, TERRAFORM\_FOSS or CUSTOM. | `string` | `"OPEN_TOFU"` | no |
@@ -317,22 +325,69 @@ This is to support easy local and outside-spacelift operations. Keeping variable
317325
| Name | Description |
318326
|------|-------------|
319327
| <a name="output_spacelift_stacks"></a> [spacelift\_stacks](#output\_spacelift\_stacks) | A map of Spacelift stacks with selected attributes.<br/>To reduce the risk of accidentally exporting sensitive data, only a subset of attributes is exported. |
320-
<!-- END_TF_DOCS -->
328+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
321329
<!-- markdownlint-enable -->
322330
<!-- prettier-ignore-end -->
323331

324-
## Contributing
332+
## Built By
333+
334+
Powered by the [Masterpoint team](https://masterpoint.io/who-we-are/) and driven forward by contributions from the community ❤️
335+
336+
[![Contributors][contributors-image]][contributors-url]
337+
338+
## Contribution Guidelines
325339

326340
Contributions are welcome and appreciated!
327341

328-
Found an issue or want to request a feature? [Open an issue](https://github.com/masterpointio/terraform-spacelift-automation/issues/new)
342+
Found an issue or want to request a feature? [Open an issue][issues-url]
329343

330-
Want to fix a bug you found or add some functionality?
331-
Fork, clone, commit, push, and PR and we'll check it out.
344+
Want to fix a bug you found or add some functionality? Fork, clone, commit, push, and PR — we'll check it out.
332345

333-
If you have any issues or are waiting a long time for a PR to get merged then
334-
feel free to ping us at [hello@masterpoint.io](mailto:hello@masterpoint.io).
346+
## Who We Are 𐦂𖨆𐀪𖠋
335347

336-
## Built By
348+
Established in 2016, Masterpoint is a team of experienced software and platform engineers specializing in Infrastructure as Code (IaC). We provide expert guidance to organizations of all sizes, helping them leverage the latest IaC practices to accelerate their engineering teams.
349+
350+
### Our Mission
351+
352+
Our mission is to simplify cloud infrastructure so developers can innovate faster, safer, and with greater confidence. By open-sourcing tools and modules that we use internally, we aim to contribute back to the community, promoting consistency, quality, and security.
353+
354+
### Our Commitments
355+
356+
- 🌟 **Open Source**: We live and breathe open source, contributing to and maintaining hundreds of projects across multiple organizations.
357+
- 🌎 **1% for the Planet**: Demonstrating our commitment to environmental sustainability, we are proud members of [1% for the Planet](https://www.onepercentfortheplanet.org), pledging to donate 1% of our annual sales to environmental nonprofits.
358+
- 🇺🇦 **1% Towards Ukraine**: With team members and friends affected by the ongoing [Russo-Ukrainian war](https://en.wikipedia.org/wiki/Russo-Ukrainian_War), we donate 1% of our annual revenue to invasion relief efforts, supporting organizations providing aid to those in need. [Here's how you can help Ukraine with just a few clicks](https://masterpoint.io/updates/supporting-ukraine/).
359+
360+
## Connect With Us
361+
362+
We're active members of the community and are always publishing content, giving talks, and sharing our hard earned expertise. Here are a few ways you can see what we're up to:
363+
364+
[![LinkedIn][linkedin-badge]][linkedin-url] [![Newsletter][newsletter-badge]][newsletter-url] [![Blog][blog-badge]][blog-url] [![YouTube][youtube-badge]][youtube-url]
365+
366+
... and be sure to connect with our founder, [Matt Gowie](https://www.linkedin.com/in/gowiem/).
367+
368+
## License
369+
370+
[Apache License, Version 2.0][license-url].
371+
372+
[![Open Source Initiative][osi-image]][license-url]
373+
374+
Copyright © 2016-2025 [Masterpoint Consulting LLC](https://masterpoint.io/)
375+
376+
<!-- MARKDOWN LINKS & IMAGES -->
337377

338-
[![Masterpoint Logo](https://i.imgur.com/RDLnuQO.png)](https://masterpoint.io)
378+
[banner-image]: https://masterpoint-public.s3.us-west-2.amazonaws.com/v2/standard-long-fullcolor.png
379+
[license-url]: https://opensource.org/license/apache-2-0
380+
[osi-image]: https://i0.wp.com/opensource.org/wp-content/uploads/2023/03/cropped-OSI-horizontal-large.png?fit=250%2C229&ssl=1
381+
[linkedin-badge]: https://img.shields.io/badge/LinkedIn-Follow-0A66C2?style=for-the-badge&logoColor=white
382+
[linkedin-url]: https://www.linkedin.com/company/masterpoint-consulting
383+
[blog-badge]: https://img.shields.io/badge/Blog-IaC_Insights-55C1B4?style=for-the-badge&logoColor=white
384+
[blog-url]: https://masterpoint.io/updates/
385+
[newsletter-badge]: https://img.shields.io/badge/Newsletter-Subscribe-ECE295?style=for-the-badge&logoColor=222222
386+
[newsletter-url]: https://newsletter.masterpoint.io/
387+
[youtube-badge]: https://img.shields.io/badge/YouTube-Subscribe-D191BF?style=for-the-badge&logo=youtube&logoColor=white
388+
[youtube-url]: https://www.youtube.com/channel/UCeeDaO2NREVlPy9Plqx-9JQ
389+
[release-badge]: https://img.shields.io/github/v/release/masterpointio/terraform-spacelift-automation?color=0E383A&label=Release&style=for-the-badge&logo=github&logoColor=white
390+
[latest-release]: https://github.com/masterpointio/terraform-spacelift-automation/releases/latest
391+
[contributors-image]: https://contrib.rocks/image?repo=masterpointio/terraform-spacelift-automation
392+
[contributors-url]: https://github.com/masterpointio/terraform-spacelift-automation/graphs/contributors
393+
[issues-url]: https://github.com/masterpointio/terraform-spacelift-automation/issues

aqua.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
# - all
99
registries:
1010
- type: standard
11-
ref: v4.283.0 # renovate: depName=aquaproj/aqua-registry
11+
ref: v4.353.0 # renovate: depName=aquaproj/aqua-registry
1212
packages:
13-
- name: terraform-docs/terraform-docs@v0.19.0
14-
- name: hashicorp/terraform@v1.10.3
13+
- name: terraform-docs/terraform-docs@v0.20.0
14+
- name: hashicorp/terraform@v1.11.4
1515
tags: [terraform]
16-
- name: opentofu/opentofu@v1.9.0
16+
- name: opentofu/opentofu@v1.9.1
1717
tags: [tofu]
18-
- name: spacelift-io/spacectl@v1.8.0
18+
- name: spacelift-io/spacectl@v1.11.0

0 commit comments

Comments
 (0)