A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.hashicorp.com/terraform/tutorials/cloud-get-started/cloud-change below:

Change infrastructure | Terraform | HashiCorp Developer

Now that you have provisioned infrastructure with HCP Terraform, you are ready to make changes to that infrastructure.

HCP Terraform offers multiple ways to set variable values for your configuration. In the previous tutorial, you defined your variables in the web UI. Now, you will use per-run variables passed on the command line to modify your EC2 instance configuration.

The landing page for a workspace includes an overview of its current state and configuration.

The top of the workspace overview page reports the following information:

The rest of the page shows details about the most recent run and current settings for your workspace.

The workspace's menu lists available actions and configurations for the workspace.

Navigate to the Runs page, and notice the run attributes that you can filter the list of runs by.

Use variables to make your configuration flexible enough to use in different contexts. Setting variable values is one of the most common ways to customize Terraform configuration, and HCP Terraform supports multiple ways to manage variables.

Like Terraform Community Edition, you can pass per-run variables to HCP Terraform using command line flags. When using the CLI-driven workflow for HCP Terraform, any variables passed using the -var flag will override workspace-specific variables. However, HCP Terraform will not save the new value in your workspace unless you update the variable in the UI. This feature can be useful when you want to test or temporarily apply a change that you expect to revert on the next apply, so your stored variable values continue to reflect the desired eventual configuration.

In your terminal, start a new Terraform run for your workspace. Use a command line variable to update the instance type for your EC2 instance to t2.small.

$ terraform apply -var="instance_type=t2.small"
Running apply in HCP Terraform. Output will stream here. Pressing Ctrl-C
will cancel the remote apply if it's still pending. If the apply started it
will stop streaming the logs, but will not stop the apply running remotely.

Preparing the remote apply...

To view this run in a browser, visit:
https://app.terraform.io/app/hashicorp-training/learn-terraform/runs/run-zRZTVvu....
##...

Once again, Terraform will trigger a run in your learn-terraform workspace and stream the output to your terminal. You can also review the details for the run in the workspace itself.

The Terraform AWS provider determined that it can modify your instance type in place. Approve the run to resize your EC2 instance.

Review the documentation on variables in HCP Terraform to learn more about variable precedence in a workspace.

In these tutorials, you created an HCP Terraform account and organization, authenticated from the command line, created an HCP Terraform workspace, and used the CLI-driven workflow to create and modify infrastructure.

In the next tutorial, you will update your workspace settings to instead use the VCS-driven workflow and trigger Terraform operations off of pull requests.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4