Difference between revisions of "Terraform state show aws instance.MYexample"

From wikieduonline
Jump to navigation Jump to search
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<pre>
+
{{lowercase}}
# aws_instance.MYexample:
+
resource "aws_instance" "MYexample" {
+
* <code>[[terraform state show]] aws_instance.MYexample</code>
    ami                                  = "ami-08d70e59c07c61a3a"
 
    arn                                  = "arn:aws:ec2:us-west-2:xxx8502465xx:instance/i-079b8300c42bea5c3"
 
    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-079b8300c42bea5c3"
 
    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-01d6b985e415407f8"
 
    private_dns                          = "ip-172-31-26-51.us-west-2.compute.internal"
 
    private_ip                          = "172.31.26.51"
 
    public_dns                          = "ec2-54-148-180-45.us-west-2.compute.amazonaws.com"
 
    public_ip                            = "54.148.180.45"
 
    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 {
+
[[Aws instance example: main.tf]]
        capacity_reservation_preference = "open"
 
    }
 
  
    credit_specification {
+
*<code>[[terraform state show]] aws_instance.MYexample</code>
        cpu_credits = "standard"
 
    }
 
  
    enclave_options {
+
# aws_instance.MYexample:
        enabled = false
+
resource "aws_instance" "MYexample" {
    }
+
    ami                                  = "ami-08d70e59c07c61a3a"
 
+
    arn                                  = "arn:aws:ec2:us-west-2:xxx8502465xx:instance/i- 079b8300c42bea5c3"
    metadata_options {
+
    associate_public_ip_address          = true
        http_endpoint              = "enabled"
+
    availability_zone                    = "us-west-2a"
        http_put_response_hop_limit = 1
+
    cpu_core_count                      = 1
        http_tokens                = "optional"
+
    cpu_threads_per_core                = 1
    }
+
    disable_api_termination              = false
 
+
    ebs_optimized                        = false
    root_block_device {
+
    get_password_data                    = false
        delete_on_termination = true
+
    hibernation                          = false
        device_name          = "/dev/sda1"
+
    id                                  = "i-079b8300c42bea5c3"
        encrypted            = false
+
    instance_initiated_shutdown_behavior = "stop"
        iops                  = 100
+
    instance_state                      = "running"
        tags                  = {}
+
    instance_type                        = "t2.micro"
        throughput            = 0
+
    ipv6_address_count                  = 0
        volume_id            = "vol-01da711ea83a11b16"
+
    ipv6_addresses                      = []
        volume_size          = 8
+
    monitoring                          = false
        volume_type          = "gp2"
+
    primary_network_interface_id        = "eni-01d6b985e415407f8"
    }
+
    private_dns                          = "ip-172-31-26-51.us-west-2.compute.internal"
}
+
    private_ip                          = "172.31.26.51"
</pre>
+
    public_dns                          = "ec2-54-148-180-45.us-west-2.compute.amazonaws.com"
 +
    public_ip                            = "54.148.180.45"
 +
    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                  = 100
 +
        tags                  = {}
 +
        throughput            = 0
 +
        volume_id            = "vol-01da711ea83a11b16"
 +
        volume_size          = 8
 +
        volume_type          = "gp2"
 +
    }
 +
}
  
 +
== Related ==
 +
* <code>[[terraform plan]]</code>
  
 
== See also ==
 
== See also ==
 
* {{main.tf}}
 
* {{main.tf}}
 +
* {{terraform state}}
 
* {{terraform cmd}}
 
* {{terraform cmd}}
 
* {{terraform}}
 
* {{terraform}}
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]

Latest revision as of 20:25, 27 October 2022

Aws instance example: main.tf

# aws_instance.MYexample:
resource "aws_instance" "MYexample" {
    ami                                  = "ami-08d70e59c07c61a3a"
    arn                                  = "arn:aws:ec2:us-west-2:xxx8502465xx:instance/i- 079b8300c42bea5c3"
    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-079b8300c42bea5c3"
    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-01d6b985e415407f8"
    private_dns                          = "ip-172-31-26-51.us-west-2.compute.internal"
    private_ip                           = "172.31.26.51"
    public_dns                           = "ec2-54-148-180-45.us-west-2.compute.amazonaws.com"
    public_ip                            = "54.148.180.45"
    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                  = 100
        tags                  = {}
        throughput            = 0
        volume_id             = "vol-01da711ea83a11b16"
        volume_size           = 8
        volume_type           = "gp2"
    }
}

Related[edit]

See also[edit]

Advertising: