Prima di aggingere nuovo account

This commit is contained in:
2024-05-24 18:25:35 +02:00
parent 80c2c6b0b8
commit 5eda24ef8f
2 changed files with 4 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ import os
import json import json
import boto3 import boto3
from uuid import uuid4 from uuid import uuid4
from mypy_boto3_s3 import S3Client
from pydantic import BaseModel from pydantic import BaseModel
from typing import Dict, Optional from typing import Dict, Optional
from redirects_base import Content, Customer, Redirects, Tag from redirects_base import Content, Customer, Redirects, Tag
@@ -102,12 +103,13 @@ def getObjectKeys(record: Record) -> list[str]:
keys.reverse() keys.reverse()
return keys return keys
def processAdd(record: Record, redirects: Redirects, client) -> None: def processAdd(record: Record, redirects: Redirects, client: S3Client) -> None:
# splitta la chiave per capire la directory # splitta la chiave per capire la directory
keys = getObjectKeys(record=record) keys = getObjectKeys(record=record)
# crea il primo utente se necessario o selezionalo # crea il primo utente se necessario o selezionalo
cust_name = keys.pop() cust_name = keys.pop()
# cerca la chiave utente dal nome e nel caso non sia presente creane uno nuovo
cust_id = searchCustomerKey(redirects=redirects, cust_name=cust_name, default=uuid4().hex) cust_id = searchCustomerKey(redirects=redirects, cust_name=cust_name, default=uuid4().hex)
assert(cust_id is not None) # uuid cannot return none assert(cust_id is not None) # uuid cannot return none

View File

@@ -10,6 +10,7 @@ terraform {
# Configure the AWS Provider # Configure the AWS Provider
provider "aws" { provider "aws" {
region = "eu-west-1" region = "eu-west-1"
profile = "StandOut_Terraform"
} }
# Create a VPC # Create a VPC