Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ yarn-error.log
*.tfstate.backup
*.tfvars
.terraform
.terraform.lock.hcl
1 change: 0 additions & 1 deletion backend-configs/env.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
bucket = ""
dynamodb_table = ""
region = "eu-west-3"
4 changes: 3 additions & 1 deletion env-configs/env.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
domain_name = "subdomain.domain.fr"
tfstate_bucket = ""
zone_name = ""
subdomain_name = ""
environment = "env"
3 changes: 2 additions & 1 deletion layers/api-gateway/00-backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

terraform {
backend "s3" {
key = "api-gateway-infrastructure/eu-west-3/terraform.tfstate"
key = "api-gateway-infrastructure/eu-west-3/terraform.tfstate"
use_lockfile = true
}
}
9 changes: 6 additions & 3 deletions layers/api-gateway/00-datasources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ data "terraform_remote_state" "lambda_authorizer" {

config = {
region = "eu-west-3"
bucket = "iroco-tfstates-store-${var.environment}"
# bucket = "iroco-tfstates-store-${var.environment}"
bucket = var.tfstate_bucket
key = "authorizer-service/eu-west-3/terraform.tfstate"
}
}
Expand All @@ -33,7 +34,9 @@ data "terraform_remote_state" "cur_service" {

config = {
region = "eu-west-3"
bucket = "iroco-tfstates-store-${var.environment}"
key = "cur/eu-west-3/terraform.tfstate"
# bucket = "iroco-tfstates-store-${var.environment}"
bucket = var.tfstate_bucket
# key = "cur/eu-west-3/terraform.tfstate"
key = "cur-analyzer-service/eu-west-3/terraform.tfstate"
}
}
4 changes: 4 additions & 0 deletions layers/api-gateway/00-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ variable "aws_lambda_payload_cur_part_function_name" {
variable "aws_lambda_payload_cur_part_invoke_arn" {
description = "Invoke ARN of the lambda (in the outputs of the payload-cur-part lambda repository)"
}
variable "tfstate_bucket" {
type = string
description = "The tfstate bucket where to fetch some information from the other layers."
}
4 changes: 2 additions & 2 deletions layers/api-gateway/00-versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
# SPDX-License-Identifier: Apache-2.0

terraform {
required_version = ">= 1.0.0"
required_version = "~> 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = "5.68.0"
version = "~> 5.0"
}
}
}
3 changes: 0 additions & 3 deletions layers/api-gateway/backend-configs/env.tfvars.example

This file was deleted.

4 changes: 1 addition & 3 deletions layers/api-gateway/tfvars/env.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
environment = "env"

aws_lambda_payload_cur_part_function_name = ""
aws_lambda_payload_cur_part_invoke_arn = "arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:<account>:function:<function_name>/invocations"
aws_lambda_payload_cur_part_invoke_arn = "arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:<account_id>:function:<function_name>/invocations"
3 changes: 2 additions & 1 deletion layers/data/00-backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

terraform {
backend "s3" {
key = "infrastructure/eu-west-3/data/terraform.tfstate"
key = "infrastructure/eu-west-3/data/terraform.tfstate"
use_lockfile = true
}
}
2 changes: 1 addition & 1 deletion layers/data/00-datasources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ data "terraform_remote_state" "network" {

config = {
region = "eu-west-3"
bucket = "iroco-tfstates-store-${var.environment}"
bucket = var.tfstate_bucket
key = "infrastructure/eu-west-3/network/terraform.tfstate"
}
}
Expand Down
5 changes: 5 additions & 0 deletions layers/data/00-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ variable "project_type" {
description = "The type of project."
default = "infrastructure"
}

variable "tfstate_bucket" {
type = string
description = "The tfstate bucket where to fetch some information from the other layers."
}
4 changes: 2 additions & 2 deletions layers/data/00-versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
# SPDX-License-Identifier: Apache-2.0

terraform {
required_version = ">= 1.0.0"
required_version = "~> 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = "5.68.0"
version = "~> 5.0"
}
}
}
20 changes: 20 additions & 0 deletions layers/iroco2-authorizer/00-backend.tf.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 Ippon Technologies
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#terraform {
# backend "s3" {
# key = "authorizer-service/eu-west-3/terraform.tfstate"
# }
#}
26 changes: 26 additions & 0 deletions layers/iroco2-authorizer/00-datasources.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2025 Ippon Technologies
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
data "aws_region" "current" {}

data "aws_caller_identity" "current" {}



data "aws_kms_public_key" "by_id" {
count= (var.create_key_signature ? 0 : 1)
#key_id = data.terraform_remote_state.data.outputs.iroco_identity_provider_key_id
key_id = var.kms_key_id
}
22 changes: 22 additions & 0 deletions layers/iroco2-authorizer/00-outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2025 Ippon Technologies
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
output "aws_lambda_invoke_arn" {
value = aws_lambda_function.lambda_function.invoke_arn
}

output "aws_lambda_function_name" {
value = aws_lambda_function.lambda_function.function_name
}
25 changes: 25 additions & 0 deletions layers/iroco2-authorizer/00-providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2025 Ippon Technologies
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
provider "aws" {
default_tags {
tags = {
namespace = var.namespace
project_type = var.project_type
project = var.project_name
environment = var.environment
}
}
}
107 changes: 107 additions & 0 deletions layers/iroco2-authorizer/00-variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Copyright 2025 Ippon Technologies
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
variable "namespace" {
type = string
description = "The namespace in which the project is."
default = "iroco2"
}

variable "environment" {
type = string
description = "The name of the environment we are deploying to"
}

variable "project_name" {
type = string
description = "Project's name"
default = "authorizer"
}

variable "project_type" {
type = string
description = "The type of project."
default = "application"
}

variable "cors_allowed_origins" {
description = "The allowed origins for the CORS."
default = null
}

variable "clerk_public_key" {
description = "Clerk public key"
type = string
default = "clerk_public_key"
}

variable "clerk_issuer" {
description = "Clerk issuer"
type = string
default = "clerk_issuer"
}

variable "clerk_audience" {
description = "Clerk audience"
type = string
default = "clerk_audience"
}

variable "create_key_signature" {
type = bool
description = "Create a KMS key for signatures"
default = false
}

variable "key_policy" {
type = string
description = "JSON encoded KMS Key policy (use jsonencode)"
default = null
}

variable "kms_description" {
type = string
description = "IROCO2 KMS Key Pair Description"
default = "IROCO2 KMS Key pair (public and private keys) for signing and verifying signed objects"
}

variable "region" {
type = string
default = null
description = "Region for KMS Key"
}

variable "tags" {
type = map(string)
default = null
description = "KMS key tags"
}

variable "kms_key_id" {
type = string
description = "KMS Key ARN or (if in same account) alias or ID "
}

variable "enable_key_rotation" {
type = string
description = "enable KMS key rotation or not"
default = true
}

variable "customer_master_key_spec" {
type = string
description = "Master Key specs"
default = "RSA_4096"
}
29 changes: 29 additions & 0 deletions layers/iroco2-authorizer/00-versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2025 Ippon Technologies
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
terraform {
required_version = ">= 1.0.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = "5.68.0"
}
archive = {
source = "hashicorp/archive"
version = "2.6.0"
}
}
}
Loading
Loading