diff --git a/examples/complete/README.md b/examples/complete/README.md new file mode 100644 index 0000000..414d487 --- /dev/null +++ b/examples/complete/README.md @@ -0,0 +1,29 @@ +# Complete Example + +This example demonstrates how to use the spacelift-automation component to manage Spacelift stacks, including the ability for Spacelift to manage its own configuration. + +Normally, this directory would contain a simple root module to spin up a basic example. To showcase a more practical use case where Spacelift manages its own infrastructure, we’ve moved the configuration to the expected path: [examples/complete/components/spacelift-automation/](./components/spacelift-automation/). + +By doing this, we provide an example of how to set up Spacelift to automate the management of your infrastructure stacks, including itself. + +## Use the Example + +1. Prerequisites: Replace [backend.tf.json](./components/spacelift-automation/backend.tf.json), [example.tfvars](./components/spacelift-automation/tfvars/example.tfvars), and [example.yaml](./components/spacelift-automation/stacks/example.yaml) values with your own. The values in this repo are hardcoded for Masterpoint's automation and testing needs. +1. Navigate to the spacelift-automation component directory: + ```sh + cd ./components/spacelift-automation/ + ``` +1. Initialize Terraform: + ```sh + tofu init + ``` +1. Select the worspace: + ```sh + tofu workspace select example + ``` +1. Review the Terraform plan: + ```sh + tofu plan -var-file tfvars/example.tfvars + ``` + +This will set up the Spacelift stack that manages itself. diff --git a/examples/complete/main.tf b/examples/complete/main.tf deleted file mode 100644 index be0ba25..0000000 --- a/examples/complete/main.tf +++ /dev/null @@ -1,13 +0,0 @@ -module "automation" { - source = "../../" - - github_enterprise = { - namespace = "masterpointio" - } - repository = "terraform-spacelift-automation" - branch = "feature/initial-version" # TODO: remove this - root_modules_path = "../../examples/complete/components" - enabled_root_modules = ["random-pet"] - aws_integration_enabled = true - aws_integration_id = "01J30JBKQTCD72ATZCRWHYST3C" -} diff --git a/examples/complete/providers.tf b/examples/complete/providers.tf deleted file mode 100644 index c95d538..0000000 --- a/examples/complete/providers.tf +++ /dev/null @@ -1 +0,0 @@ -provider "spacelift" {} diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf deleted file mode 100644 index 5d935ac..0000000 --- a/examples/complete/versions.tf +++ /dev/null @@ -1,10 +0,0 @@ -terraform { - required_version = ">= 1.6" - - required_providers { - spacelift = { - source = "spacelift-io/spacelift" - version = ">= 1.14" - } - } -}