Skip to content

Commit

Permalink
Add ephemeral storage support (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktibi authored May 19, 2022
1 parent cb93725 commit c2ba310
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 34 deletions.
58 changes: 30 additions & 28 deletions .terraform.lock.hcl

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

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ In order to run all checks at any point run the following command:
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4 |
| <a name="requirement_random"></a> [random](#requirement\_random) | 3.1.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.0.0 |
| <a name="provider_random"></a> [random](#provider\_random) | 3.1.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.14.0 |
| <a name="provider_random"></a> [random](#provider\_random) | 3.2.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_acm"></a> [acm](#module\_acm) | terraform-aws-modules/acm/aws | ~> 3.0 |
| <a name="module_aws_cw_logs"></a> [aws\_cw\_logs](#module\_aws\_cw\_logs) | cn-terraform/cloudwatch-logs/aws | 1.0.10 |
| <a name="module_ecs_fargate"></a> [ecs\_fargate](#module\_ecs\_fargate) | cn-terraform/ecs-fargate/aws | 2.0.34 |
| <a name="module_ecs_fargate"></a> [ecs\_fargate](#module\_ecs\_fargate) | cn-terraform/ecs-fargate/aws | 2.0.38 |

## Resources

Expand All @@ -63,21 +63,22 @@ In order to run all checks at any point run the following command:
| [aws_rds_cluster_instance.aurora_db_cluster_instances](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster_instance) | resource |
| [aws_route53_record.record_dns](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_security_group.aurora_sg](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
| [random_password.master_password](https://registry.terraform.io/providers/hashicorp/random/3.1.0/docs/resources/password) | resource |
| [random_password.master_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | List of Availability Zones | `list(string)` | n/a | yes |
| <a name="input_db_engine_version"></a> [db\_engine\_version](#input\_db\_engine\_version) | DB engine version | `string` | `"11.7"` | no |
| <a name="input_db_engine_version"></a> [db\_engine\_version](#input\_db\_engine\_version) | DB engine version | `string` | `"14.2"` | no |
| <a name="input_db_instance_size"></a> [db\_instance\_size](#input\_db\_instance\_size) | DB instance size | `string` | `"db.r4.large"` | no |
| <a name="input_db_name"></a> [db\_name](#input\_db\_name) | Default DB name | `string` | `"sonar"` | no |
| <a name="input_db_password"></a> [db\_password](#input\_db\_password) | DB password | `string` | `""` | no |
| <a name="input_db_username"></a> [db\_username](#input\_db\_username) | Default DB username | `string` | `"sonar"` | no |
| <a name="input_dns_zone_id"></a> [dns\_zone\_id](#input\_dns\_zone\_id) | Route 53 zone id | `string` | `""` | no |
| <a name="input_enable_autoscaling"></a> [enable\_autoscaling](#input\_enable\_autoscaling) | Enable auto scaling for datacenter edition | `bool` | `false` | no |
| <a name="input_enable_ssl"></a> [enable\_ssl](#input\_enable\_ssl) | Enable SSL | `bool` | `true` | no |
| <a name="input_ephemeral_storage_size"></a> [ephemeral\_storage\_size](#input\_ephemeral\_storage\_size) | The number of GBs to provision for ephemeral storage on Fargate tasks. Must be greater than or equal to 21 and less than or equal to 200 | `number` | `0` | no |
| <a name="input_https_record_domain_name"></a> [https\_record\_domain\_name](#input\_https\_record\_domain\_name) | Route 53 domain name | `string` | `""` | no |
| <a name="input_https_record_name"></a> [https\_record\_name](#input\_https\_record\_name) | Route 53 dns name | `string` | `""` | no |
| <a name="input_lb_enable_cross_zone_load_balancing"></a> [lb\_enable\_cross\_zone\_load\_balancing](#input\_lb\_enable\_cross\_zone\_load\_balancing) | Enable cross zone support for LB | `string` | `"true"` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module "ecs_fargate" {
container_memory = 8192
container_memory_reservation = 4096
enable_autoscaling = var.enable_autoscaling
ephemeral_storage_size = var.ephemeral_storage_size

lb_http_ports = var.lb_http_ports

Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ variable "enable_autoscaling" {
description = "Enable auto scaling for datacenter edition"
}

#------------------------------------------------------------------------------
# Sonarqube storage settings
#------------------------------------------------------------------------------

variable "ephemeral_storage_size" {
type = number
description = "The number of GBs to provision for ephemeral storage on Fargate tasks. Must be greater than or equal to 21 and less than or equal to 200"
default = 0
}

#------------------------------------------------------------------------------
# Sonarqube SSL settings
#------------------------------------------------------------------------------
Expand Down

2 comments on commit c2ba310

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’° Infracost estimate: monthly cost will increase by $388 πŸ“ˆ

Project Previous New Diff
cn-terraform/terraform-aws-sonarqube $0 $388 +$388
Infracost output
Project: cn-terraform/terraform-aws-sonarqube

+ module.base-network.aws_nat_gateway.nat_gw[0]
  +$32.85

    + NAT gateway
      +$32.85

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.base-network.aws_nat_gateway.nat_gw[1]
  +$32.85

    + NAT gateway
      +$32.85

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.base-network.aws_nat_gateway.nat_gw[2]
  +$32.85

    + NAT gateway
      +$32.85

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.base-network.aws_nat_gateway.nat_gw[3]
  +$32.85

    + NAT gateway
      +$32.85

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.sonar.aws_kms_key.encryption_key
  +$1.00

    + Customer master key
      +$1.00

    + Requests
      Monthly cost depends on usage
        +$0.03 per 10k requests

    + ECC GenerateDataKeyPair requests
      Monthly cost depends on usage
        +$0.10 per 10k requests

    + RSA GenerateDataKeyPair requests
      Monthly cost depends on usage
        +$0.10 per 10k requests

+ module.sonar.aws_rds_cluster.aurora_db
  Monthly cost depends on usage

    + Storage
      Monthly cost depends on usage
        +$0.10 per GB

    + I/O requests
      Monthly cost depends on usage
        +$0.20 per 1M requests

    + Backup storage
      Monthly cost depends on usage
        +$0.021 per GB

    + Snapshot export
      Monthly cost depends on usage
        +$0.01 per GB

+ module.sonar.aws_rds_cluster_instance.aurora_db_cluster_instances[0]
  +$59.86

    + Database instance (on-demand, db.t3.medium)
      +$59.86

+ module.sonar.aws_rds_cluster_instance.aurora_db_cluster_instances[1]
  +$59.86

    + Database instance (on-demand, db.t3.medium)
      +$59.86

+ module.sonar.aws_rds_cluster_instance.aurora_db_cluster_instances[2]
  +$59.86

    + Database instance (on-demand, db.t3.medium)
      +$59.86

+ module.sonar.aws_rds_cluster_instance.aurora_db_cluster_instances[3]
  +$59.86

    + Database instance (on-demand, db.t3.medium)
      +$59.86

+ module.sonar.module.aws_cw_logs.aws_cloudwatch_log_group.log_group
  Monthly cost depends on usage

    + Data ingested
      Monthly cost depends on usage
        +$0.50 per GB

    + Archival Storage
      Monthly cost depends on usage
        +$0.03 per GB

    + Insights queries data scanned
      Monthly cost depends on usage
        +$0.005 per GB

+ module.sonar.module.ecs_fargate.module.ecs-fargate-service.aws_ecs_service.service
  $0.00

    + Per GB per hour
      $0.00

    + Per vCPU per hour
      $0.00

+ module.sonar.module.ecs_fargate.module.ecs-fargate-service.module.ecs-alb.aws_lb.lb
  +$16.43

    + Application load balancer
      +$16.43

    + Load balancer capacity units
      Monthly cost depends on usage
        +$5.84 per LCU

+ module.sonar.module.ecs_fargate.module.ecs-fargate-service.module.ecs-alb.aws_s3_bucket.logs
  Monthly cost depends on usage

    + Standard
    
        + Storage
          Monthly cost depends on usage
            +$0.023 per GB
    
        + PUT, COPY, POST, LIST requests
          Monthly cost depends on usage
            +$0.005 per 1k requests
    
        + GET, SELECT, and all other requests
          Monthly cost depends on usage
            +$0.0004 per 1k requests
    
        + Select data scanned
          Monthly cost depends on usage
            +$0.002 per GB
    
        + Select data returned
          Monthly cost depends on usage
            +$0.0007 per GB

Monthly cost change for cn-terraform/terraform-aws-sonarqube
Amount:  +$388 ($0.00 β†’ $388)

──────────────────────────────────
Key: ~ changed, + added, - removed

68 cloud resources were detected:
βˆ™ 14 were estimated, 12 of which include usage-based costs, see https://infracost.io/usage-file
βˆ™ 54 were free, rerun with --show-skipped to see details
Is this comment useful? Yes, No

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’° Infracost estimate: monthly cost will increase by $388 πŸ“ˆ

Project Previous New Diff
cn-terraform/terraform-aws-sonarqube $0 $388 +$388
Infracost output
Project: cn-terraform/terraform-aws-sonarqube

+ module.base-network.aws_nat_gateway.nat_gw[0]
  +$32.85

    + NAT gateway
      +$32.85

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.base-network.aws_nat_gateway.nat_gw[1]
  +$32.85

    + NAT gateway
      +$32.85

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.base-network.aws_nat_gateway.nat_gw[2]
  +$32.85

    + NAT gateway
      +$32.85

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.base-network.aws_nat_gateway.nat_gw[3]
  +$32.85

    + NAT gateway
      +$32.85

    + Data processed
      Monthly cost depends on usage
        +$0.045 per GB

+ module.sonar.aws_kms_key.encryption_key
  +$1.00

    + Customer master key
      +$1.00

    + Requests
      Monthly cost depends on usage
        +$0.03 per 10k requests

    + ECC GenerateDataKeyPair requests
      Monthly cost depends on usage
        +$0.10 per 10k requests

    + RSA GenerateDataKeyPair requests
      Monthly cost depends on usage
        +$0.10 per 10k requests

+ module.sonar.aws_rds_cluster.aurora_db
  Monthly cost depends on usage

    + Storage
      Monthly cost depends on usage
        +$0.10 per GB

    + I/O requests
      Monthly cost depends on usage
        +$0.20 per 1M requests

    + Backup storage
      Monthly cost depends on usage
        +$0.021 per GB

    + Snapshot export
      Monthly cost depends on usage
        +$0.01 per GB

+ module.sonar.aws_rds_cluster_instance.aurora_db_cluster_instances[0]
  +$59.86

    + Database instance (on-demand, db.t3.medium)
      +$59.86

+ module.sonar.aws_rds_cluster_instance.aurora_db_cluster_instances[1]
  +$59.86

    + Database instance (on-demand, db.t3.medium)
      +$59.86

+ module.sonar.aws_rds_cluster_instance.aurora_db_cluster_instances[2]
  +$59.86

    + Database instance (on-demand, db.t3.medium)
      +$59.86

+ module.sonar.aws_rds_cluster_instance.aurora_db_cluster_instances[3]
  +$59.86

    + Database instance (on-demand, db.t3.medium)
      +$59.86

+ module.sonar.module.aws_cw_logs.aws_cloudwatch_log_group.log_group
  Monthly cost depends on usage

    + Data ingested
      Monthly cost depends on usage
        +$0.50 per GB

    + Archival Storage
      Monthly cost depends on usage
        +$0.03 per GB

    + Insights queries data scanned
      Monthly cost depends on usage
        +$0.005 per GB

+ module.sonar.module.ecs_fargate.module.ecs-fargate-service.aws_ecs_service.service
  $0.00

    + Per GB per hour
      $0.00

    + Per vCPU per hour
      $0.00

+ module.sonar.module.ecs_fargate.module.ecs-fargate-service.module.ecs-alb.aws_lb.lb
  +$16.43

    + Application load balancer
      +$16.43

    + Load balancer capacity units
      Monthly cost depends on usage
        +$5.84 per LCU

+ module.sonar.module.ecs_fargate.module.ecs-fargate-service.module.ecs-alb.aws_s3_bucket.logs
  Monthly cost depends on usage

    + Standard
    
        + Storage
          Monthly cost depends on usage
            +$0.023 per GB
    
        + PUT, COPY, POST, LIST requests
          Monthly cost depends on usage
            +$0.005 per 1k requests
    
        + GET, SELECT, and all other requests
          Monthly cost depends on usage
            +$0.0004 per 1k requests
    
        + Select data scanned
          Monthly cost depends on usage
            +$0.002 per GB
    
        + Select data returned
          Monthly cost depends on usage
            +$0.0007 per GB

Monthly cost change for cn-terraform/terraform-aws-sonarqube
Amount:  +$388 ($0.00 β†’ $388)

──────────────────────────────────
Key: ~ changed, + added, - removed

68 cloud resources were detected:
βˆ™ 14 were estimated, 12 of which include usage-based costs, see https://infracost.io/usage-file
βˆ™ 54 were free, rerun with --show-skipped to see details
Is this comment useful? Yes, No

Please sign in to comment.