Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*/.terraform/*
**/.terraform/*
*.tfstate
*.tfstate.*
crash.log
override.tf
override.tf.json
*_override.tf
*_override.tf.json
22 changes: 22 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@ terraform {

provider "aws" {
profile = "default"
region = "us-west-2"
region = "us-east-1"
}

resource "aws_instance" "app_server" {
ami = "ami-830c94e3"
instance_type = "t2.micro"

tags = {
Name = "ExampleAppServerInstance"
}
module "ec2mod" {
source = "./ec2mod"
}
8 changes: 8 additions & 0 deletions ec2mod/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "aws_instance" "app_server" {
ami = "ami-026b57f3c383c2eec"
instance_type = "t2.micro"

tags = {
Name = "ExampleAppServerInstance"
}
}
9 changes: 9 additions & 0 deletions terraform.tfstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": 4,
"terraform_version": "1.3.1",
"serial": 4,
"lineage": "2cda08f2-e425-f13b-e30b-8d758914054d",
"outputs": {},
"resources": [],
"check_results": []
}
117 changes: 117 additions & 0 deletions terraform.tfstate.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"version": 4,
"terraform_version": "1.3.1",
"serial": 2,
"lineage": "2cda08f2-e425-f13b-e30b-8d758914054d",
"outputs": {},
"resources": [
{
"module": "module.ec2mod",
"mode": "managed",
"type": "aws_instance",
"name": "app_server",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"ami": "ami-026b57f3c383c2eec",
"arn": "arn:aws:ec2:us-east-1:391340846210:instance/i-0c8f491a5cf4949ae",
"associate_public_ip_address": true,
"availability_zone": "us-east-1b",
"capacity_reservation_specification": [
{
"capacity_reservation_preference": "open",
"capacity_reservation_target": []
}
],
"cpu_core_count": 1,
"cpu_threads_per_core": 1,
"credit_specification": [
{
"cpu_credits": "standard"
}
],
"disable_api_termination": false,
"ebs_block_device": [],
"ebs_optimized": false,
"enclave_options": [
{
"enabled": false
}
],
"ephemeral_block_device": [],
"get_password_data": false,
"hibernation": false,
"host_id": null,
"iam_instance_profile": "",
"id": "i-0c8f491a5cf4949ae",
"instance_initiated_shutdown_behavior": "stop",
"instance_state": "running",
"instance_type": "t2.micro",
"ipv6_address_count": 0,
"ipv6_addresses": [],
"key_name": "",
"launch_template": [],
"metadata_options": [
{
"http_endpoint": "enabled",
"http_put_response_hop_limit": 1,
"http_tokens": "optional",
"instance_metadata_tags": "disabled"
}
],
"monitoring": false,
"network_interface": [],
"outpost_arn": "",
"password_data": "",
"placement_group": "",
"placement_partition_number": null,
"primary_network_interface_id": "eni-0a7789ba7afe07ee2",
"private_dns": "ip-172-31-17-48.ec2.internal",
"private_ip": "172.31.17.48",
"public_dns": "ec2-54-173-162-244.compute-1.amazonaws.com",
"public_ip": "54.173.162.244",
"root_block_device": [
{
"delete_on_termination": true,
"device_name": "/dev/xvda",
"encrypted": false,
"iops": 100,
"kms_key_id": "",
"tags": {},
"throughput": 0,
"volume_id": "vol-0ec1ece117c473d4d",
"volume_size": 8,
"volume_type": "gp2"
}
],
"secondary_private_ips": [],
"security_groups": [
"default"
],
"source_dest_check": true,
"subnet_id": "subnet-0a8b4265f34af84df",
"tags": {
"Name": "ExampleAppServerInstance"
},
"tags_all": {
"Name": "ExampleAppServerInstance"
},
"tenancy": "default",
"timeouts": null,
"user_data": null,
"user_data_base64": null,
"volume_tags": null,
"vpc_security_group_ids": [
"sg-0dd2ae990f7359aae"
]
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9LCJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
}
]
}
],
"check_results": []
}