using_terraform
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
using_terraform [2017/08/05 10:29] – walkeradmin | using_terraform [2017/08/05 13:48] – [Terraform Apply] walkeradmin | ||
---|---|---|---|
Line 5: | Line 5: | ||
---- | ---- | ||
- | Now that we have our script, we can start to use Terraform to test and run our completed | + | Now that we have our simple Terraform |
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Terraform Plan ==== | ||
+ | \\ | ||
+ | \\ | ||
+ | The terraform plan command is used to create an execution plan. Terraform performs a refresh, unless explicitly disabled, | ||
+ | \\ | ||
+ | \\ | ||
+ | As I only have one configuration file, I can just use the command: | ||
+ | \\ | ||
+ | terraform plan | ||
+ | \\ | ||
+ | For my configuration file, I get the following output. | ||
+ | \\ | ||
+ | < | ||
+ | Refreshing Terraform state in-memory prior to plan... | ||
+ | The refreshed state will be used to calculate this plan, but will not be | ||
+ | persisted to local or remote state storage. | ||
+ | |||
+ | The Terraform execution plan has been generated and is shown below. | ||
+ | Resources are shown in alphabetical order for quick scanning. Green resources | ||
+ | will be created (or destroyed and then created if an existing resource | ||
+ | exists), yellow resources are being changed in-place, and red resources | ||
+ | will be destroyed. Cyan entries are data sources to be read. | ||
+ | |||
+ | Note: You didn't specify an " | ||
+ | " | ||
+ | |||
+ | + aws_instance.example | ||
+ | ami: " | ||
+ | associate_public_ip_address: | ||
+ | availability_zone: | ||
+ | ebs_block_device.#: | ||
+ | ephemeral_block_device.#: | ||
+ | instance_state: | ||
+ | instance_type: | ||
+ | ipv6_address_count: | ||
+ | ipv6_addresses.#: | ||
+ | key_name: | ||
+ | network_interface.#: | ||
+ | network_interface_id: | ||
+ | placement_group: | ||
+ | primary_network_interface_id: | ||
+ | private_dns: | ||
+ | private_ip: | ||
+ | public_dns: | ||
+ | public_ip: | ||
+ | root_block_device.#: | ||
+ | security_groups.#: | ||
+ | security_groups.2525401260: | ||
+ | source_dest_check: | ||
+ | subnet_id: | ||
+ | tags.%: | ||
+ | tags.Name: | ||
+ | tenancy: | ||
+ | volume_tags.%: | ||
+ | vpc_security_group_ids.#: | ||
+ | |||
+ | |||
+ | Plan: 1 to add, 0 to change, 0 to destroy. | ||
+ | </ | ||
+ | \\ | ||
+ | This is the type of output you will get if your script file does not contain any errors. | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ---- | ||
+ | ==== Terraform Apply ==== | ||
+ | \\ | ||
+ | \\ | ||
+ | Before starting the Terraform apply option, I suggest you log in to your AWS account so that you can monitor the progress of the script. | ||
+ | \\ | ||
+ | \\ | ||
+ | Here is my AWS account with no configured EC2 Instances. | ||
+ | \\ | ||
+ | \\ | ||
+ | {{ : | ||
+ | \\ | ||
+ | In the above example we can see that there is no EC2 Instance configured on this AWS account. There is a default security group that we configured, as well as our key pair. These are both specified in our Terraform | ||
+ | \\ | ||
+ | \\ | ||
+ | If we select Running Instances, then this will be empty (unless you have manually created some.) | ||
+ | \\ | ||
+ | \\ | ||
+ | {{ : | ||
+ | \\ |
using_terraform.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1