Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
refactored infra
  • Loading branch information
briand787b committed Dec 14, 2019
1 parent e68e542 commit 83e0bf2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 30 deletions.
14 changes: 11 additions & 3 deletions infrastructure/main.tf
Expand Up @@ -4,6 +4,17 @@ provider "aws" {
region = "us-east-1"
}

provider "github" {
token = var.github_token
version = "~> 2.2"
organization = "briand787b"
}

provider digitalocean {
token = var.digitalocean_token
version = "~> 1.11"
}

// backend
terraform {
backend "s3" {
Expand All @@ -24,7 +35,6 @@ module "cloudwatch" {
module "codesuite" {
source = "./modules/codesuite"

github_token = var.github_token
docker_hub_password = var.docker_hub_password
postman_api_key = var.postman_api_key
postman_collection_id = var.postman_collection_id
Expand All @@ -33,6 +43,4 @@ module "codesuite" {

module "inlets" {
source = "./modules/inlets"

digitalocean_token = var.digitalocean_token
}
9 changes: 0 additions & 9 deletions infrastructure/modules/codesuite/code_build.tf
@@ -1,7 +1,3 @@
resource "aws_s3_bucket" "build_cache" {
bucket = "piqlit-codebuild-cache"
}

resource "aws_cloudwatch_log_stream" "codebuild_log_stream" {
name = "codebuild_log_stream"
log_group_name = var.codebuild_log_group.name
Expand Down Expand Up @@ -43,11 +39,6 @@ resource "aws_codebuild_project" "codebuild" {
}
}

cache {
type = "S3"
location = aws_s3_bucket.build_cache.arn
}

logs_config {
cloudwatch_logs {
group_name = var.codebuild_log_group.name
Expand Down
6 changes: 0 additions & 6 deletions infrastructure/modules/codesuite/github.tf
@@ -1,9 +1,3 @@
provider "github" {
token = var.github_token
version = "~> 2.2"
organization = "briand787b"
}

data "github_repository" "piqlit" {
full_name = "briand787b/piqlit"
}
4 changes: 0 additions & 4 deletions infrastructure/modules/codesuite/variables.tf
@@ -1,7 +1,3 @@
variable "github_token" {
type = string
}

variable "postman_api_key" {
type = string
}
Expand Down
5 changes: 0 additions & 5 deletions infrastructure/modules/inlets/digital_ocean.tf
@@ -1,8 +1,3 @@
provider digitalocean {
token = var.digitalocean_token
version = "~> 1.11"
}

data "digitalocean_account" "account" {}

# # Create a new Web Droplet in the nyc2 region
Expand Down
3 changes: 0 additions & 3 deletions infrastructure/modules/inlets/variables.tf
@@ -1,3 +0,0 @@
variable "digitalocean_token" {
type = string
}

0 comments on commit 83e0bf2

Please sign in to comment.