Skip to content

Commit

Permalink
providers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ujstor committed Jun 23, 2024
1 parent 4c6693c commit 1589898
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tf-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: terraform-lint
on:
push:
branches: [ master ]
branches: [ lambda ]
pull_request:

jobs:
Expand Down
8 changes: 8 additions & 0 deletions aws-infra/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module "lambda" {
source = "./modules/lambda"

# providers = {
# aws = aws.snadbox
# }

lambda_config = {
work_dir = "../"
bin_name = "bootstrap"
Expand All @@ -16,6 +20,10 @@ module "lambda" {
module "api_gateway" {
source = "./modules/API-gateway"

# providers = {
# aws = aws.snadbox
# }

api_gw_conf = {
name = "portfolio-web"
protocol_type = "HTTP"
Expand Down
7 changes: 1 addition & 6 deletions aws-infra/modules/API-gateway/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.48.0"
version = "~> 5.0"
}
}
required_version = ">=0.15.1"
}

provider "aws" {
region = var.aws_region
}
6 changes: 0 additions & 6 deletions aws-infra/modules/API-gateway/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
variable "aws_region" {
description = "AWS region"
type = string
default = "us-east-1"
}

variable "api_gw_conf" {
description = "API Gateway configuration"
type = object({
Expand Down
9 changes: 2 additions & 7 deletions aws-infra/modules/lambda/terrafrom.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.48.0"
version = "~> 5.0"
}
archive = {
source = "hashicorp/archive"
version = "2.4.2"
version = "~> 2.0"
}
}
required_version = ">=0.15.1"
}

provider "aws" {
region = var.aws_region
}
6 changes: 0 additions & 6 deletions aws-infra/modules/lambda/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
variable "aws_region" {
description = "AWS region"
type = string
default = "us-east-1"
}

variable "lambda_config" {
description = "Lambda function configuration"
type = object({
Expand Down
8 changes: 2 additions & 6 deletions aws-infra/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ output "lambda_arn" {
value = module.lambda.lambda_arn
}

# output "Dynamodb_arn" {
# description = "DynamoDB ARN"
# value = module.dynamodb.dynamodb_arn
# }

output "api_gateway_url" {
value = module.api_gateway.api_gateway_url
description = "API gateway URL"
value = module.api_gateway.api_gateway_url
}
22 changes: 22 additions & 0 deletions aws-infra/terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
archive = {
source = "hashicorp/archive"
version = "~> 2.0"
}
}
required_version = ">= 1.0.0, < 2.0.0"
}
provider "aws" {
region = "us-east-1"
# alias = "snadbox"

# assume_role {
# role_arn = "arn:aws:iam::730335647984:role/OrganizationAccountAccessRole"
# }
}

0 comments on commit 1589898

Please sign in to comment.