Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Updated the object-based configuration in variable.tf #79

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# ignored files
# Terraform state files - Contains sensitive infrastructure state information
*.tfstate
*.tfstate.backup

# Local Terraform directory - Contains downloaded providers and modules
.terraform

# IDE settings directory for IntelliJ
.idea

# IntelliJ project files
*.iml

# Go dependency file
go.sum

# Terraform lock file - Contains provider version constraints
*.terraform.lock.hcl

# Terraform crash log file - Generated during crashes
crash.log

# Variable definitions files - May contain sensitive values
*.tfvars
12 changes: 6 additions & 6 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ usage: |-
#Root Volume
root_block_device = [
{
volume_type = "gp2"
volume_type = "gp3"
volume_size = 15
delete_on_termination = true
}
]

#EBS Volume
ebs_volume_enabled = false
ebs_volume_type = "gp2"
ebs_volume_type = "gp3"
ebs_volume_size = 30

#Tags
Expand Down Expand Up @@ -131,15 +131,15 @@ usage: |-
#Root Volume
root_block_device = [
{
volume_type = "gp2"
volume_type = "gp3"
volume_size = 15
delete_on_termination = true
}
]

#EBS Volume
ebs_volume_enabled = true
ebs_volume_type = "gp2"
ebs_volume_type = "gp3"
ebs_volume_size = 30

#Tags
Expand Down Expand Up @@ -187,15 +187,15 @@ usage: |-
#Root Volume
root_block_device = [
{
volume_type = "gp2"
volume_type = "gp3"
volume_size = 15
delete_on_termination = true
}
]

#EBS Volume
ebs_volume_enabled = true
ebs_volume_type = "gp2"
ebs_volume_type = "gp3"
ebs_volume_size = 30

#Tags
Expand Down
2 changes: 1 addition & 1 deletion docs/io.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
| ebs\_optimized | If true, the launched EC2 instance will be EBS-optimized. | `bool` | `false` | no |
| ebs\_volume\_enabled | Flag to control the ebs creation. | `bool` | `false` | no |
| ebs\_volume\_size | Size of the EBS volume in gigabytes. | `number` | `30` | no |
| ebs\_volume\_type | The type of EBS volume. Can be standard, gp2 or io1. | `string` | `"gp2"` | no |
| ebs\_volume\_type | The type of EBS volume. Can be standard, gp3 or io1. | `string` | `"gp3"` | no |
| egress\_ipv4\_cidr\_block | List of CIDR blocks. Cannot be specified with source\_security\_group\_id or self. | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| egress\_ipv4\_from\_port | Egress Start port (or ICMP type number if protocol is icmp or icmpv6). | `number` | `0` | no |
| egress\_ipv4\_protocol | Protocol. If not icmp, icmpv6, tcp, udp, or all use the protocol number | `string` | `"-1"` | no |
Expand Down
24 changes: 14 additions & 10 deletions examples/basic/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,19 @@ module "ec2" {

#instance
instance_count = 1
ami = "ami-08d658f84a6d84a80"
instance_type = "c4.xlarge"
instance_configuration = {
ami = "ami-08d658f84a6d84a80"
instance_type = "t4g.small"

#Root Volume
root_block_device = [
{
volume_type = "gp3"
volume_size = 15
delete_on_termination = true
}
]
}

#Networking
subnet_ids = ["subnet-xxxxxxxx"]
Expand All @@ -28,14 +39,7 @@ module "ec2" {
#IAM
iam_instance_profile = "iam-profile-xxxxxxxxx"

#Root Volume
root_block_device = [
{
volume_type = "gp2"
volume_size = 15
delete_on_termination = true
}
]

#Tags
instance_tags = { "snapshot" = true }

Expand Down
31 changes: 18 additions & 13 deletions examples/complete/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,21 @@ module "ec2" {
ssh_allowed_ports = [22]
#Instance
instance_count = 1
ami = "ami-0f8e81a3da6e2510a"
instance_type = "t2.nano"
instance_configuration = {
ami = "ami-0f8e81a3da6e2510a"
instance_type = "t4g.small"

#Root Volume
root_block_device = [
{
volume_type = "gp3"
volume_size = 15
delete_on_termination = true
}
]
#Mount EBS With User Data
user_data = file("user-data.sh")
}

#Keypair
public_key = ""
Expand All @@ -103,23 +116,15 @@ module "ec2" {
#IAM
iam_instance_profile = module.iam-role.name

#Root Volume
root_block_device = [
{
volume_type = "gp2"
volume_size = 15
delete_on_termination = true
}
]


#EBS Volume
ebs_volume_enabled = true
ebs_volume_type = "gp2"
ebs_volume_type = "gp3"
ebs_volume_size = 30

#Tags
instance_tags = { "snapshot" = true }

#Mount EBS With User Data
user_data = file("user-data.sh")

}
33 changes: 18 additions & 15 deletions examples/spot_instance/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,23 @@ module "spot-ec2" {
public_key = ""

# Spot-instance
spot_price = "0.3"
spot_wait_for_fulfillment = true
spot_type = "persistent"
spot_instance_interruption_behavior = "terminate"
spot_instance_enabled = true
spot_instance_count = 1
instance_type = "c4.xlarge"
spot_configuration = {
spot_price = "0.3"
wait_for_fulfillment = true
spot_type = "persistent"
instance_interruption_behavior = "terminate"
spot_instance_enabled = true
spot_instance_count = 1
instance_type = "t4g.small"

root_block_device = [
{
volume_type = "gp3"
volume_size = 15
delete_on_termination = true
}
]
}

#Networking
subnet_ids = ["subnet-xxxxxxxx"]
Expand All @@ -32,17 +42,10 @@ module "spot-ec2" {
iam_instance_profile = "iam-profile-xxxxxxxxx"

#Root Volume
root_block_device = [
{
volume_type = "gp2"
volume_size = 15
delete_on_termination = true
}
]

#EBS Volume
ebs_volume_enabled = true
ebs_volume_type = "gp2"
ebs_volume_type = "gp3"
ebs_volume_size = 30

#Tags
Expand Down
Loading