Skip to content

benniemosher-dev/quest-infra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

quest-infra

CI Terraform

πŸ” Infrastructure to support the quest. πŸ”

πŸ“œ Usage:

To retrieve Cloudflare secrets:

Reach out to @benniemosher on Keybase and get access to his secrets repo then:

git clone keybase://team/benniemosher_dev/secrets
ln -s $HOME/Code/benniemosher-dev/secrets/cloudflare.auto.tfvars ./cloudflare.auto.tfvars
ln -s $HOME/Code/benniemosher-dev/secrets/tfcloud.auto.tfvars ./tfcloud.auto.tfvars
  • To install dependencies needed run:
    brew bundle install
  • To initialize Terraform in this folder:
    task infra:init
  • To update modules and providers in this folder:
    task init -- -upgrade
  • To validate the module in this folder:
    task infra:validate
  • To plan the infrastructure in this folder:
    task infra:plan
  • To plan specific resources of infrastructure in this folder:
    task infra:plan -- -target='cloudflare_record.this'
  • To apply the infrastructure in this folder:
    task infra:apply
  • To apply specific resources of infrastructure in this folder:
    task infra:apply -- -target='cloudflare_record.this'
  • To destroy the infrastructure in this folder:
    task infra:destroy
  • To destroy specific resources of infrastructure in this folder:
    task infra:destroy -- -target='cloudflare_record.this'

πŸ†’ Extras:

  • To find all the automation available in this folder:
    task --list-all
  • To estimate the cost of the infrastructure in this folder:
    task infra:cost
  • To update the documentation in this folder:
    task infra:docs
  • To lint the Terraform in this folder:
    task infra:lint
  • To validate security in this folder:
    task infra:sec

πŸ’° Cost

Project: benniemosher-dev/quest-infra

 Name                                                                             Monthly Qty  Unit                    Monthly Cost 
                                                                                                                                    
 module.container-registry.aws_ecr_repository.this                                                                                  
 └─ Storage                                                                 Monthly cost depends on usage: $0.10 per GB             
                                                                                                                                    
 module.container-service.module.logs.aws_cloudwatch_log_group.this                                                                 
 β”œβ”€ 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.encryption-key.aws_kms_key.this                                                                                             
 β”œβ”€ Customer master key                                                                     1  months                         $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.load-balancer.aws_alb.this                                                                                                  
 β”œβ”€ Network load balancer                                                                 730  hours                         $16.43 
 └─ Load balancer capacity units                                            Monthly cost depends on usage: $4.38 per LCU            
                                                                                                                                    
 module.network.module.default-vpc-flow-logs.aws_cloudwatch_log_group.this                                                          
 β”œβ”€ 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            
                                                                                                                                    
 OVERALL TOTAL                                                                                                               $17.43 
──────────────────────────────────
31 cloud resources were detected:
βˆ™ 5 were estimated, 4 of which include usage-based costs, see https://infracost.io/usage-file
βˆ™ 26 were free, rerun with --show-skipped to see details

πŸ“‹ Documentation

Requirements

Name Version
terraform ~> 1.3
aws ~> 4.40
cloudflare ~> 3.0
tfe ~> 0.38

Providers

Name Version
aws 4.47.0
cloudflare 3.30.0
tfe 0.40.0

Modules

Name Source Version
certificate github.com/benniemosher-dev/terraform-aws-acm v0.1.0
container-registry github.com/benniemosher-dev/terraform-aws-ecr v0.1.0
container-service github.com/benniemosher-dev/terraform-aws-ecs v0.1.0
encryption-key github.com/benniemosher-dev/terraform-aws-kms v0.1.0
load-balancer github.com/benniemosher-dev/terraform-aws-loadbalancer v0.2.0
network github.com/benniemosher-dev/terraform-aws-network v0.1.0

Resources

Name Type
aws_iam_access_key.tfcloud resource
aws_iam_user.tfcloud resource
aws_iam_user_policy.tfcloud resource
cloudflare_record.certificate resource
cloudflare_record.dns-records resource
tfe_variable.aws_access_key resource
tfe_variable.aws_secret_access_key resource
aws_caller_identity.current data source
aws_iam_policy_document.cloudwatch-kms data source
aws_iam_policy_document.tfcloud data source
aws_partition.current data source
aws_region.current data source
cloudflare_zone.zone data source
tfe_workspace.this data source

Inputs

Name Description Type Default Required
aws-config The config to connect Terraform to AWS.
object({
profile = optional(string, null)
region = optional(string, "us-east-1")
})
n/a yes
cloudflare-config The config to connect Terraform to Cloudflare.
object({
account-id = optional(string, null)
api-token = string
cidrs = list(string)
})
n/a yes
config The config for your organization in Github.
object({
org-name = string
project-name = string
})
n/a yes
tfcloud-config The config for connecting to TFCloud.
object({
token = string
})
n/a yes

Outputs

Name Description
load-balancer-dns The Load Balancer DNS name to reach the deployed web app.
url The URL for the web app.

Releases

No releases published

Sponsor this project

 

Packages

No packages published