Adds base agent and base infra

This commit is contained in:
2025-09-03 14:18:54 -03:00
parent a831f2a833
commit 0e16e11069
20 changed files with 2001 additions and 0 deletions

50
infra/__main__.py Normal file
View File

@@ -0,0 +1,50 @@
"""An AWS Python Pulumi program"""
import pulumi
from pulumi_aws import aws
from pulumi_aws import s3
import pulumi_aws_apigateway as apigateway
import json
role = aws.iam.Role("mylambda-role",
assume_role_policy=json.dumps({
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": { "Service": "lambda.amazonaws.com" },
"Action": "sts:AssumeRole"
}]
})
)
# Create an AWS resource (S3 Bucket)
bucket = s3.Bucket('br-edu-ifsp-ifsp-ret-s3-bucket-chatbot-editais-d',
tags={
"nome":"bucket-chatbot-editais",
"ambiente":"dev",
"projeto":"chatbot-editais",
"responsavel":"dti.prd@ifsp.edu.br",
"criticidade":"baixa",
"data-de-criacao":"03-09-2025",
"backup":"nunca",
"servico":"sistemas",
"prospeccao":"sim",
"poc":"sim",
"ia":"sim",
"modelo":"claude-sonnet-4"
})
f = aws.lambda_.Function("mylambda",
runtime=aws.lambda_.Runtime.PYTHON3D8,
code=pulumi.AssetArchive({
".": pulumi.FileArchive("./handler"),
}),
timeout=300,
handler="handler.handler",
role=role.arn,
opts=pulumi.ResourceOptions(depends_on=[policy]),
)
api = apigateway.RestAPI('api', routes=[
apigateway.RouteArgs(path="/", method="GET", event_handler=f),
])
# Export the name of the bucket
pulumi.export('bucket_name', bucket.id)