mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #176 from Hestia-Homes/main
added model directory s3 bucket and prediction lambda (sap) ecr
This commit is contained in:
commit
57d68006ad
3 changed files with 20 additions and 7 deletions
|
|
@ -96,6 +96,13 @@ module "s3" {
|
|||
allowed_origins = var.allowed_origins
|
||||
}
|
||||
|
||||
module "s3" {
|
||||
source = "./modules/s3"
|
||||
bucketname = "retrofit-model-directory-${var.stage}"
|
||||
allowed_origins = var.allowed_origins
|
||||
}
|
||||
|
||||
|
||||
# Set up the route53 record for the API
|
||||
module "route53" {
|
||||
source = "./modules/route53"
|
||||
|
|
@ -108,6 +115,11 @@ module "route53" {
|
|||
|
||||
# Create an ECR repository for storage of the lambda's docker images
|
||||
module "ecr" {
|
||||
source = "./modules/ecr"
|
||||
environment = var.stage
|
||||
name = "fastapi-repository-${var.environment}"
|
||||
source = "./modules/ecr"
|
||||
}
|
||||
|
||||
module "ecr" {
|
||||
name = "lambda-sap-prediction-${var.environment}"
|
||||
source = "./modules/ecr"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
resource "aws_ecr_repository" "my_repository" {
|
||||
name = "fastapi-repository-${var.environment}"
|
||||
image_tag_mutability = "MUTABLE" # Allows overwriting image tags, change to IMMUTABLE if you want to prevent overwriting
|
||||
name = "${var.ecr_name}"
|
||||
image_tag_mutability = "MUTABLE"
|
||||
# Allows overwriting image tags, change to IMMUTABLE if you want to prevent overwriting
|
||||
|
||||
image_scanning_configuration {
|
||||
scan_on_push = true
|
||||
|
|
@ -15,7 +16,7 @@ resource "aws_ecr_lifecycle_policy" "my_repository_policy" {
|
|||
{
|
||||
rulePriority = 1
|
||||
description = "Retain only the last 10 images"
|
||||
selection = {
|
||||
selection = {
|
||||
tagStatus = "any"
|
||||
countType = "imageCountMoreThan"
|
||||
countNumber = 10
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
variable "environment" {
|
||||
description = "The environment for the ECR repository (dev or prod)"
|
||||
variable "ecr_name" {
|
||||
description = "The name for the ECR repository"
|
||||
type = string
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue