mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +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
|
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
|
# Set up the route53 record for the API
|
||||||
module "route53" {
|
module "route53" {
|
||||||
source = "./modules/route53"
|
source = "./modules/route53"
|
||||||
|
|
@ -108,6 +115,11 @@ module "route53" {
|
||||||
|
|
||||||
# Create an ECR repository for storage of the lambda's docker images
|
# Create an ECR repository for storage of the lambda's docker images
|
||||||
module "ecr" {
|
module "ecr" {
|
||||||
source = "./modules/ecr"
|
name = "fastapi-repository-${var.environment}"
|
||||||
environment = var.stage
|
source = "./modules/ecr"
|
||||||
|
}
|
||||||
|
|
||||||
|
module "ecr" {
|
||||||
|
name = "lambda-sap-prediction-${var.environment}"
|
||||||
|
source = "./modules/ecr"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
resource "aws_ecr_repository" "my_repository" {
|
resource "aws_ecr_repository" "my_repository" {
|
||||||
name = "fastapi-repository-${var.environment}"
|
name = "${var.ecr_name}"
|
||||||
image_tag_mutability = "MUTABLE" # Allows overwriting image tags, change to IMMUTABLE if you want to prevent overwriting
|
image_tag_mutability = "MUTABLE"
|
||||||
|
# Allows overwriting image tags, change to IMMUTABLE if you want to prevent overwriting
|
||||||
|
|
||||||
image_scanning_configuration {
|
image_scanning_configuration {
|
||||||
scan_on_push = true
|
scan_on_push = true
|
||||||
|
|
@ -15,7 +16,7 @@ resource "aws_ecr_lifecycle_policy" "my_repository_policy" {
|
||||||
{
|
{
|
||||||
rulePriority = 1
|
rulePriority = 1
|
||||||
description = "Retain only the last 10 images"
|
description = "Retain only the last 10 images"
|
||||||
selection = {
|
selection = {
|
||||||
tagStatus = "any"
|
tagStatus = "any"
|
||||||
countType = "imageCountMoreThan"
|
countType = "imageCountMoreThan"
|
||||||
countNumber = 10
|
countNumber = 10
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
variable "environment" {
|
variable "ecr_name" {
|
||||||
description = "The environment for the ECR repository (dev or prod)"
|
description = "The name for the ECR repository"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue