Difference between revisions of "Terraform show"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
No state. | No state. | ||
+ | == Example == | ||
+ | <pre> | ||
+ | terraform show | ||
+ | # aws_instance.app_server: | ||
+ | resource "aws_instance" "app_server" { | ||
+ | ami = "ami-830c94e3" | ||
+ | arn = "arn:aws:ec2:us-west-2:672850566589:instance/i-0598bc37b772faaa3" | ||
+ | associate_public_ip_address = true | ||
+ | availability_zone = "us-west-2a" | ||
+ | cpu_core_count = 1 | ||
+ | cpu_threads_per_core = 1 | ||
+ | disable_api_termination = false | ||
+ | ebs_optimized = false | ||
+ | get_password_data = false | ||
+ | hibernation = false | ||
+ | id = "i-0598bc37b772faaa3" | ||
+ | instance_initiated_shutdown_behavior = "stop" | ||
+ | instance_state = "running" | ||
+ | instance_type = "t2.micro" | ||
+ | ipv6_address_count = 0 | ||
+ | ipv6_addresses = [] | ||
+ | monitoring = false | ||
+ | primary_network_interface_id = "eni-0cf3cce58b77056bb" | ||
+ | private_dns = "ip-172-31-24-141.us-west-2.compute.internal" | ||
+ | private_ip = "172.31.24.141" | ||
+ | public_dns = "ec2-54-202-75-92.us-west-2.compute.amazonaws.com" | ||
+ | public_ip = "54.202.75.92" | ||
+ | secondary_private_ips = [] | ||
+ | security_groups = [ | ||
+ | "default", | ||
+ | ] | ||
+ | source_dest_check = true | ||
+ | subnet_id = "subnet-6551cf1d" | ||
+ | tags = { | ||
+ | "Name" = "ExampleAppServerInstance" | ||
+ | } | ||
+ | tags_all = { | ||
+ | "Name" = "ExampleAppServerInstance" | ||
+ | } | ||
+ | tenancy = "default" | ||
+ | vpc_security_group_ids = [ | ||
+ | "sg-a95bbfa2", | ||
+ | ] | ||
+ | capacity_reservation_specification { | ||
+ | capacity_reservation_preference = "open" | ||
+ | } | ||
+ | |||
+ | credit_specification { | ||
+ | cpu_credits = "standard" | ||
+ | } | ||
+ | |||
+ | enclave_options { | ||
+ | enabled = false | ||
+ | } | ||
+ | |||
+ | metadata_options { | ||
+ | http_endpoint = "enabled" | ||
+ | http_put_response_hop_limit = 1 | ||
+ | http_tokens = "optional" | ||
+ | } | ||
+ | |||
+ | root_block_device { | ||
+ | delete_on_termination = true | ||
+ | device_name = "/dev/sda1" | ||
+ | encrypted = false | ||
+ | iops = 0 | ||
+ | tags = {} | ||
+ | throughput = 0 | ||
+ | volume_id = "vol-0c66c62a8d104731f" | ||
+ | volume_size = 8 | ||
+ | volume_type = "standard" | ||
+ | } | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | == Changelog == | ||
* terraform show: The [[JSON]] plan output now indicates which state values are sensitive. (#28889) | * terraform show: The [[JSON]] plan output now indicates which state values are sensitive. (#28889) | ||
Revision as of 09:53, 24 August 2021
terraform show No state.
Example
terraform show # aws_instance.app_server: resource "aws_instance" "app_server" { ami = "ami-830c94e3" arn = "arn:aws:ec2:us-west-2:672850566589:instance/i-0598bc37b772faaa3" associate_public_ip_address = true availability_zone = "us-west-2a" cpu_core_count = 1 cpu_threads_per_core = 1 disable_api_termination = false ebs_optimized = false get_password_data = false hibernation = false id = "i-0598bc37b772faaa3" instance_initiated_shutdown_behavior = "stop" instance_state = "running" instance_type = "t2.micro" ipv6_address_count = 0 ipv6_addresses = [] monitoring = false primary_network_interface_id = "eni-0cf3cce58b77056bb" private_dns = "ip-172-31-24-141.us-west-2.compute.internal" private_ip = "172.31.24.141" public_dns = "ec2-54-202-75-92.us-west-2.compute.amazonaws.com" public_ip = "54.202.75.92" secondary_private_ips = [] security_groups = [ "default", ] source_dest_check = true subnet_id = "subnet-6551cf1d" tags = { "Name" = "ExampleAppServerInstance" } tags_all = { "Name" = "ExampleAppServerInstance" } tenancy = "default" vpc_security_group_ids = [ "sg-a95bbfa2", ] capacity_reservation_specification { capacity_reservation_preference = "open" } credit_specification { cpu_credits = "standard" } enclave_options { enabled = false } metadata_options { http_endpoint = "enabled" http_put_response_hop_limit = 1 http_tokens = "optional" } root_block_device { delete_on_termination = true device_name = "/dev/sda1" encrypted = false iops = 0 tags = {} throughput = 0 volume_id = "vol-0c66c62a8d104731f" volume_size = 8 volume_type = "standard" } }
Changelog
- terraform show: The JSON plan output now indicates which state values are sensitive. (#28889)
See also
terraform
[untaint | fmt
|apply
|show
|state
|init | plan | console | output
|validate
|destroy
|debug
|import
|providers
|get
|graph
|workspaces
|resource
|login
|-var-file
|state mv
|state pull
|state push
|state replace-provider
|state rm
|force-unlock
|env
|tfe
|--version
|remote-exec
|delete on termination
| deprecated commands |terraform --help
]- Terraform, OpenTofu, Terrakube.org, Installation, Terraform AWS, Terraform GCP, Terraform commands, Terraform Cloud, Terraform Enterprise (TFE), HCL, HIL, meta-arguments, providers, modules, resource, provisioners, data sources, backends: remote backends, examples, configuration files, state files, variables, types, Terraform Registry, conditionals:
depends_on
, functions, Blocks, dynamic blocks, errors, Terragrunt, Terraformer, Terratest, Terraform certifications, Terraform map type, Terraform Associate, Terraform: list type,TF_VAR_, TF_LOG
, Terraform provider versioning, Terraform Style Conventions, Required version, Terraform plugin, Terraform Named Values, tags, Changelog,tfsec, tflint
, Operators, Expressions:for, splat
, Debugging, Namespaces, Terraform Landing Zones, CDKTF, Atmos
Advertising: