Skip to content

Commit

Permalink
Additional changes for CI/CD renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
BanaSeba committed Jan 10, 2025
1 parent 3d34e4e commit 43e661a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/nameai-api-lambda-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ jobs:
ENS_SUBGRAPH_URL_MAINNET: ${{ secrets.ENS_SUBGRAPH_URL_MAINNET }}
ENS_SUBGRAPH_URL_SEPOLIA: ${{ secrets.ENS_SUBGRAPH_URL_SEPOLIA }}
AWS_REGION: ${{ secrets.AWS_REGION }}
CERTIFICATE_NAME: ${{ secrets.NAMERANK_CERTIFICATE_NAME }} # todo: rename secrets to NAMEAI_* (?)
HOSTED_ZONE_NAME: ${{ secrets.NAMERANK_HOSTED_ZONE_NAME }}
CERTIFICATE_NAME: ${{ secrets.NAMEAI_CERTIFICATE_NAME }}
HOSTED_ZONE_NAME: ${{ secrets.NAMEAI_HOSTED_ZONE_NAME }}
run: |
if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then
STAGE="prod"
DOMAIN_NAME=${{ secrets.NAMERANK_PROD_DOMAIN_NAME }}
DOMAIN_NAME=${{ secrets.NAMEAI_PROD_DOMAIN_NAME }}
elif [[ ${{ github.ref }} == 'refs/heads/staging' ]]; then
STAGE="staging"
DOMAIN_NAME=${{ secrets.NAMERANK_STAGING_DOMAIN_NAME }}
DOMAIN_NAME=${{ secrets.NAMEAI_STAGING_DOMAIN_NAME }}
else
echo "Deployment is only supported for main and staging branches"
exit 1
Expand Down
16 changes: 8 additions & 8 deletions apps/api.nameai.dev/terraform/modules/lambda_api/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ data "aws_iam_policy_document" "assume_role" {
locals {
common_tags = {
Environment = var.env
Project = "namerank"
Project = "nameai"
ManagedBy = "terraform"
}
}
Expand Down Expand Up @@ -52,8 +52,8 @@ resource "aws_iam_role_policy_attachment" "lambda_logs" {
}


resource "aws_lambda_function" "namerank_lambda" {
function_name = "namerank-lambda-${var.env}"
resource "aws_lambda_function" "nameai_lambda" {
function_name = "nameai-lambda-${var.env}"
role = aws_iam_role.iam_for_lambda.arn
memory_size = "1769"
timeout = 60
Expand All @@ -74,24 +74,24 @@ resource "aws_lambda_function" "namerank_lambda" {
}

tags = merge(local.common_tags, {
Function = "namerank-api"
Function = "nameai-api"
})
}

resource "aws_lambda_provisioned_concurrency_config" "concurrency_config" {
function_name = aws_lambda_function.namerank_lambda.function_name
function_name = aws_lambda_function.nameai_lambda.function_name
provisioned_concurrent_executions = 1
qualifier = aws_lambda_function.namerank_lambda.version
qualifier = aws_lambda_function.nameai_lambda.version
}

resource "aws_lambda_function_url" "lambda_url" {
function_name = aws_lambda_function.namerank_lambda.function_name
function_name = aws_lambda_function.nameai_lambda.function_name
authorization_type = "NONE"
}

resource "aws_cloudfront_distribution" "api_distribution" {
enabled = true
comment = "Distribution for namerank API ${var.env}"
comment = "Distribution for nameai API ${var.env}"
price_class = "PriceClass_100"

aliases = [var.domain_name]
Expand Down

0 comments on commit 43e661a

Please sign in to comment.