From the course: DevOps Foundations: Your First Project

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Reviewing the OpenTofu plan

Reviewing the OpenTofu plan

Infrastructure provision with OpenTofu is done in two steps. The plan step and the apply step. The plan step shows you what OpenTofu is going to create, change or delete. This way you can spot-check your work and make sure that OpenTofu will create what you're expecting to have created. The apply step, well, applies those changes. Let's take the HCL that we saw earlier and turn it into a plan. First, we'll need to initialize OpenTofu with "open tofu init". The way we do that is by running "docker compose run --rm open tofu init". This will fetch code for the provider that we need and perform other configurations. What OpenTofu is doing here is fetching the AWS provider that makes all of those resources work, as well as the random provider, which was used for the random string resource that we saw before. You'll know that OpenTofu has finished initializing when you see this green message over here saying that OpenTofu has been successfully initialized. So now that OpenTofu is…

Contents