-
[Github] Fork this repository.
-
[Spacelift] Go to https://spacelift.io/aws/free-trial and login with github. With it, you do not need to do any additional setup (see Spacelift getting started).
-
[NaverCloud] Generate
NCLOUD_ACCESS_KEY
andNCLOUD_SECRET_KEY
. -
[Spacelift] Create a stack:
- [Connect to source code] As a repository, choose the forked repository;
- [Connect to source code] As a project root:
demo_2_naver/
; - [Vendor] OpenTofu;
- Save & Continue.
-
[Spacelift] Add as secret env variables for your stack
NCLOUD_ACCESS_KEY
andNCLOUD_SECRET_KEY
. -
[Spacelift] Create a context with one env variable
NCLOUD_REGION
, valueKR
. -
[Spacelift] Attach the context to your stack.
-
[Spacelift] (Optional) Add Plan Policy
only sampling
:package spacelift sample { true }
Attach the policy to your stack; see the docs.
-
[Spacelift] Trigger the run:
- You will see output from
tofu plan
; - Spacelift will ask you for the confirmation;
- After you confirm, you will see output from
tofu apply
; - Compare the Simplified view vs Full view;
- In the full view, you can explore the input for the plan policy. Notice how much information you have available. You can also plug the output from linters (tflint or conftest) and security tools (wiz, tfsec,...). To learn more, check this blog post.
- You will see output from
-
[NaverCloud] You should see the server up and running in your console.
Imagine you need to add a tag for tracking costs cost_center
:
-
[Github] Open a PR where you add a new tag to the
naver_server
:tag_list { tag_key = "cost_center" tag_value = "8899" }
in
demo_2_ncloud/my_vm.tf
, OpenTofu resourcenaver_server
. -
[Spacelift] Go to PRs in your stack, you will see Spacelift proposed run that validates the change.
-
[Spacelift] Compare simplified to the full view.
- https://spacelift.io/how-it-works
- https://docs.spacelift.io/getting-started
- https://spacelift.io/blog/scalable-infrastructure
- https://docs.spacelift.io/concepts/configuration/environment#per-stage-environment-variables
- https://spacelift.io/blog/integrating-security-tools-with-spacelift
- https://docs.spacelift.io/concepts/policy/terraform-plan-policy