diff --git a/README.md b/README.md index 4f2c08c..19f6046 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,9 @@ for example. | [capacity\_provider\_strategy](#input\_capacity\_provider\_strategy) | Capacity provider strategies to use for the service. Can be one or more. |
list(object({
capacity_provider = string
weight = string
base = optional(string, null)
}))
| `null` | no | | [cloudwatch\_logs](#input\_cloudwatch\_logs) | CloudWatch logs configuration for the containers of this service. CloudWatch logs will be used as the default log configuration if Firelens is disabled and for the fluentbit and otel containers. |
object({
enabled = optional(bool, true)
name = optional(string, "")
retention_in_days = optional(number, 7)
})
| `{}` | no | | [cluster\_id](#input\_cluster\_id) | The ECS cluster id that should run this service | `string` | n/a | yes | +| [code\_build\_environment\_compute\_type](#input\_code\_build\_environment\_compute\_type) | Information about the compute resources the CodeBuild stage of the deployment pipeline will use. | `string` | `"BUILD_LAMBDA_1GB"` | no | +| [code\_build\_environment\_image](#input\_code\_build\_environment\_image) | Docker image to use for the CodeBuild stage of the deployment pipeline. The image needs to include python. | `string` | `"aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.12"` | no | +| [code\_build\_environment\_type](#input\_code\_build\_environment\_type) | Type of build environment for the CodeBuild stage of the deployment pipeline. | `string` | `"ARM_LAMBDA_CONTAINER"` | no | | [code\_build\_log\_retention\_in\_days](#input\_code\_build\_log\_retention\_in\_days) | Log retention in days of the CodeBuild CloudWatch log group. | `number` | `7` | no | | [code\_build\_role\_name](#input\_code\_build\_role\_name) | Use an existing role for codebuild permissions that can be reused for multiple services. Otherwise a separate role for this service will be created. | `string` | `""` | no | | [code\_pipeline\_artifact\_bucket](#input\_code\_pipeline\_artifact\_bucket) | Use an existing bucket for codepipeline artifacts that can be reused for multiple services. Otherwise a separate bucket for each service will be created. | `string` | `""` | no | diff --git a/main.tf b/main.tf index b8c4e73..93c08d4 100644 --- a/main.tf +++ b/main.tf @@ -229,6 +229,9 @@ module "code_deploy" { cluster_name = var.cluster_id container_name = local.container_name + code_build_environment_compute_type = var.code_build_environment_compute_type + code_build_environment_image = var.code_build_environment_image + code_build_environment_type = var.code_build_environment_type codestar_notifications_detail_type = var.codestar_notifications_detail_type codestar_notifications_event_type_ids = var.codestar_notifications_event_type_ids codestar_notifications_target_arn = var.codestar_notifications_target_arn diff --git a/modules/deployment/backend.tf b/modules/deployment/backend.tf index dbc484a..1384338 100644 --- a/modules/deployment/backend.tf +++ b/modules/deployment/backend.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.9" + version = ">= 5.32" } } } diff --git a/modules/deployment/code_build.tf b/modules/deployment/code_build.tf index e48aa47..c838da4 100644 --- a/modules/deployment/code_build.tf +++ b/modules/deployment/code_build.tf @@ -33,9 +33,9 @@ resource "aws_codebuild_project" "this" { } environment { - compute_type = "BUILD_GENERAL1_SMALL" - image = "aws/codebuild/amazonlinux2-x86_64-standard:4.0" - type = "LINUX_CONTAINER" + compute_type = var.code_build_environment_compute_type + image = var.code_build_environment_image + type = var.code_build_environment_type environment_variable { name = "CONTAINER_NAME" @@ -49,9 +49,6 @@ resource "aws_codebuild_project" "this" { version: 0.2 phases: - install: - runtime-versions: - python: 3.9 build: commands: - | diff --git a/modules/deployment/variables.tf b/modules/deployment/variables.tf index 394798d..f43edcd 100644 --- a/modules/deployment/variables.tf +++ b/modules/deployment/variables.tf @@ -46,6 +46,24 @@ variable "code_pipeline_role" { type = string } +variable "code_build_environment_compute_type" { + description = "Information about the compute resources the CodeBuild stage of the deployment pipeline will use." + default = "BUILD_LAMBDA_1GB" + type = string +} + +variable "code_build_environment_image" { + description = "Docker image to use for the CodeBuild stage of the deployment pipeline. The image needs to include python." + default = "aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.12" + type = string +} + +variable "code_build_environment_type" { + description = "Type of build environment for the CodeBuild stage of the deployment pipeline." + default = "ARM_LAMBDA_CONTAINER" + type = string +} + variable "code_build_role" { default = "" description = "Use an existing role for codebuild permissions that can be reused for multiple services." diff --git a/variables.tf b/variables.tf index df65090..945233e 100644 --- a/variables.tf +++ b/variables.tf @@ -149,6 +149,24 @@ variable "code_pipeline_role_name" { type = string } +variable "code_build_environment_compute_type" { + description = "Information about the compute resources the CodeBuild stage of the deployment pipeline will use." + default = "BUILD_LAMBDA_1GB" + type = string +} + +variable "code_build_environment_image" { + description = "Docker image to use for the CodeBuild stage of the deployment pipeline. The image needs to include python." + default = "aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.12" + type = string +} + +variable "code_build_environment_type" { + description = "Type of build environment for the CodeBuild stage of the deployment pipeline." + default = "ARM_LAMBDA_CONTAINER" + type = string +} + variable "code_build_role_name" { default = "" description = "Use an existing role for codebuild permissions that can be reused for multiple services. Otherwise a separate role for this service will be created."