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

feat: add var for volume size #39

Merged
merged 1 commit into from
Dec 16, 2024
Merged

feat: add var for volume size #39

merged 1 commit into from
Dec 16, 2024

Conversation

DrInTech22
Copy link
Owner

No description provided.

Copy link

💰 Infracost report

Consider fixing these issues, they don't align with your company's FinOps policies & the Well-Architected Framework.

FinOps policies
🔴 EBS - consider upgrading gp2 volumes to gp3

gp3 volumes are the latest generation of general-purpose SSD-based EBS volumes that enable you to provision performance independent of storage capacity, while providing up to 20% lower price per GB than existing gp2 volumes. With gp3 volumes, you can scale IOPS (input/output operations per second) and throughput without needing to provision additional block storage capacity. This means you only pay for the storage you need.

resource aws_instance.ec2

  • Set root_block_device.volume_type to gp3.

in project DrInTech22/full-stack-gitops/terraform

Tagging policies
🔴 FinOps tags

This example Tagging policy shows how you can enforce required FinOps tag keys/values in pull requests. This example checks for the tags 'Service' (can have any value) and 'Environment' (must be Dev/Stage/Prod) on all taggable resources being changed in the pull request. You can adjust it from https://dashboard.infracost.io > Governance > Tagging policies. You have a 14 day trial of this feature as it's part of Infracost Cloud.

resource aws_instance.ec2

  • Missing mandatory tag Environment. Must be one of Dev, Stage, Prod. Consider using default tags to avoid adding tags to individual resources.
  • Missing mandatory tag root_block_device.Environment. Must be one of Dev, Stage, Prod. Consider using default tags to avoid adding tags to individual resources.
  • Missing mandatory tags: Service, root_block_device.Service. Consider using default tags to avoid adding tags to individual resources.

in project DrInTech22/full-stack-gitops/terraform

Monthly estimate increased by $35 📈
Changed project Baseline cost Usage cost* Total change New monthly cost
DrInTech22/full-stack-gitops/terraform +$35 - +$35 (+100%) $69

*Usage costs can be estimated by updating Infracost Cloud settings, see docs for other options.

Estimate details
Key: * usage cost, ~ changed, + added, - removed

──────────────────────────────────
Project: DrInTech22/full-stack-gitops/terraform

~ aws_instance.ec2
  +$35 ($35 → $69)

    ~ Instance usage (Linux/UNIX, on-demand, t2.medium → t2.large)
      +$34 ($34 → $68)

    ~ root_block_device

        ~ Storage (general purpose SSD, gp2)
          +$0.80 ($0.80 → $2)

Monthly cost change for DrInTech22/full-stack-gitops/terraform
Amount:  +$35 ($35 → $69)
Percent: +100%

──────────────────────────────────
Key: * usage cost, ~ changed, + added, - removed

*Usage costs can be estimated by updating Infracost Cloud settings, see docs for other options.

13 cloud resources were detected:
∙ 7 were estimated
∙ 6 were free

This comment will be updated when code changes.

Copy link

Terraform Plan 📖success

Show Plan
[command]/home/runner/work/_temp/3780bf83-fb19-41fd-a21f-053b06f92050/terraform-bin show -no-color tfplan.out

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_instance.ec2 will be updated in-place
  ~ resource "aws_instance" "ec2" {
        id                                   = "i-02fb04f9765c52555"
      ~ instance_type                        = "t2.medium" -> "t2.large"
        tags                                 = {
            "Name" = "MainEC2Instance"
        }
        # (38 unchanged attributes hidden)

      ~ root_block_device {
            tags                  = {}
          ~ volume_size           = 8 -> 16
            # (9 unchanged attributes hidden)
        }

        # (7 unchanged blocks hidden)
    }

  # local_file.ansible_inventory will be created
  + resource "local_file" "ansible_inventory" {
      + content              = <<-EOT
            [web_servers]
            54.146.58.8 ansible_user=ubuntu ansible_ssh_private_key_file=./hello.pem
        EOT
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "inventory.ini"
      + id                   = (known after apply)
    }

Plan: 1 to add, 1 to change, 0 to destroy.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  + create%0A  ~ update in-place%0A%0ATerraform will perform the following actions:%0A%0A  # aws_instance.ec2 will be updated in-place%0A  ~ resource "aws_instance" "ec2" {%0A        id                                   = "i-02fb04f9765c52555"%0A      ~ instance_type                        = "t2.medium" -> "t2.large"%0A        tags                                 = {%0A            "Name" = "MainEC2Instance"%0A        }%0A        # (38 unchanged attributes hidden)%0A%0A      ~ root_block_device {%0A            tags                  = {}%0A          ~ volume_size           = 8 -> 16%0A            # (9 unchanged attributes hidden)%0A        }%0A%0A        # (7 unchanged blocks hidden)%0A    }%0A%0A  # local_file.ansible_inventory will be created%0A  + resource "local_file" "ansible_inventory" {%0A      + content              = <<-EOT%0A            [web_servers]%0D%0A            54.146.58.8 ansible_user=ubuntu ansible_ssh_private_key_file=./hello.pem%0A        EOT%0A      + content_base64sha256 = (known after apply)%0A      + content_base64sha512 = (known after apply)%0A      + content_md5          = (known after apply)%0A      + content_sha1         = (known after apply)%0A      + content_sha256       = (known after apply)%0A      + content_sha512       = (known after apply)%0A      + directory_permission = "0777"%0A      + file_permission      = "0777"%0A      + filename             = "inventory.ini"%0A      + id                   = (known after apply)%0A    }%0A%0APlan: 1 to add, 1 to change, 0 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

New Infracost Breakdown 💰

Show Breakdown
Project: main

 Name                                                      Monthly Qty  Unit                  Monthly Cost   
                                                                                                             
 aws_instance.ec2                                                                                            
 ├─ Instance usage (Linux/UNIX, on-demand, t2.large)               730  hours                       $67.74   
 └─ root_block_device                                                                                        
    └─ Storage (general purpose SSD, gp2)                           16  GB                           $1.60   
                                                                                                             
 aws_route53_record.db_record                                                                                
 ├─ Standard queries (first 1B)                       Monthly cost depends on usage: $0.40 per 1M queries    
 ├─ Latency based routing queries (first 1B)          Monthly cost depends on usage: $0.60 per 1M queries    
 └─ Geo DNS queries (first 1B)                        Monthly cost depends on usage: $0.70 per 1M queries    
                                                                                                             
 aws_route53_record.frontend_record                                                                          
 ├─ Standard queries (first 1B)                       Monthly cost depends on usage: $0.40 per 1M queries    
 ├─ Latency based routing queries (first 1B)          Monthly cost depends on usage: $0.60 per 1M queries    
 └─ Geo DNS queries (first 1B)                        Monthly cost depends on usage: $0.70 per 1M queries    
                                                                                                             
 aws_route53_record.traefik_record                                                                           
 ├─ Standard queries (first 1B)                       Monthly cost depends on usage: $0.40 per 1M queries    
 ├─ Latency based routing queries (first 1B)          Monthly cost depends on usage: $0.60 per 1M queries    
 └─ Geo DNS queries (first 1B)                        Monthly cost depends on usage: $0.70 per 1M queries    
                                                                                                             
 aws_route53_record.www_db_record                                                                            
 ├─ Standard queries (first 1B)                       Monthly cost depends on usage: $0.40 per 1M queries    
 ├─ Latency based routing queries (first 1B)          Monthly cost depends on usage: $0.60 per 1M queries    
 └─ Geo DNS queries (first 1B)                        Monthly cost depends on usage: $0.70 per 1M queries    
                                                                                                             
 aws_route53_record.www_frontend_record                                                                      
 ├─ Standard queries (first 1B)                       Monthly cost depends on usage: $0.40 per 1M queries    
 ├─ Latency based routing queries (first 1B)          Monthly cost depends on usage: $0.60 per 1M queries    
 └─ Geo DNS queries (first 1B)                        Monthly cost depends on usage: $0.70 per 1M queries    
                                                                                                             
 aws_route53_record.www_traefik_record                                                                       
 ├─ Standard queries (first 1B)                       Monthly cost depends on usage: $0.40 per 1M queries    
 ├─ Latency based routing queries (first 1B)          Monthly cost depends on usage: $0.60 per 1M queries    
 └─ Geo DNS queries (first 1B)                        Monthly cost depends on usage: $0.70 per 1M queries    
                                                                                                             
 OVERALL TOTAL                                                                                     $69.34 

*Usage costs can be estimated by updating Infracost Cloud settings, see docs for other options.

──────────────────────────────────
13 cloud resources were detected:
∙ 7 were estimated
∙ 6 were free

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Project                                            ┃ Baseline cost ┃ Usage cost* ┃ Total cost ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━┫
┃ main                                               ┃           $69 ┃           - ┃        $69 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━┛

Pushed by: @DrInTech22, Action: pull_request

@DrInTech22 DrInTech22 merged commit e97653a into infra_main Dec 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant