Skip to content

Commit 3b42e14

Browse files
committed
feat: LLMO-204 Provisioning API for cdn logs S3 bucket
1 parent c898c87 commit 3b42e14

File tree

14 files changed

+3627
-2431
lines changed

14 files changed

+3627
-2431
lines changed

docs/openapi/api.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ tags:
5151
description: APIs for taking and retrieving webpage screenshots, specifically for consent banner analysis
5252
- name: llmo
5353
description: LLMO (Large Language Model Optimizer) operations
54+
- name: cdn-logs
55+
description: APIs for CDN logs infrastructure
5456

5557
paths:
5658
/audits/latest/{auditType}:
@@ -235,6 +237,8 @@ paths:
235237
$ref: './llmo-api.yaml#/llmo-customer-intent-item'
236238
/sites/{siteId}/llmo/cdn-logs-filter:
237239
$ref: './llmo-api.yaml#/llmo-cdn-logs-filter'
240+
/cdn-logs-infrastructure/provision:
241+
$ref: './tools-api.yaml#/cdn-logs-infrastructure-provision'
238242

239243
components:
240244
securitySchemes:

docs/openapi/schemas.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,3 +3506,42 @@ LlmoConfig:
35063506
description: The CDN logs filter configuration for filtering log entries
35073507
$ref: '#/LlmoCdnLogsFilter'
35083508
additionalProperties: false
3509+
3510+
# CDN Logs Schemas
3511+
CdnLogsBucketRequest:
3512+
type: object
3513+
required:
3514+
- orgId
3515+
properties:
3516+
orgId:
3517+
type: string
3518+
description: Organization identifier (alphanumeric, optionally ending with @AdobeOrg)
3519+
example: "adobe123"
3520+
orgName:
3521+
type: string
3522+
description: Organization name (optional)
3523+
example: "Adobe Inc"
3524+
3525+
CdnLogsBucketResponse:
3526+
type: object
3527+
properties:
3528+
message:
3529+
type: string
3530+
description: Success message describing what was created/retrieved
3531+
example: "Bucket 'cdn-logs-adobe123' created successfully with new credentials"
3532+
bucketName:
3533+
type: string
3534+
description: The S3 bucket name
3535+
example: "cdn-logs-adobe"
3536+
accessKey:
3537+
type: string
3538+
description: AWS access key for the bucket
3539+
example: "AKIAIOSFODNN7EXAMPLE"
3540+
secretKey:
3541+
type: string
3542+
description: AWS secret key for the bucket
3543+
example: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
3544+
region:
3545+
type: string
3546+
description: AWS region where the bucket was created
3547+
example: "us-east-1"

docs/openapi/tools-api.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,49 @@ file-download:
362362
$ref: './responses.yaml#/500'
363363
security:
364364
- scoped_api_key: [ ]
365+
366+
cdn-logs-infrastructure-provision:
367+
put:
368+
tags:
369+
- cdn-logs
370+
summary: Provision CDN logs infrastructure
371+
description: |
372+
Provisions S3 bucket and IAM credentials for CDN logs storage.
373+
This endpoint follows an idempotent pattern:
374+
375+
**If resources do NOT exist:** Creates a new S3 bucket with proper encryption,
376+
access controls, IAM policy, IAM user, and stores credentials in AWS Secrets Manager.
377+
378+
**If resources already exist:** Retrieves the existing bucket and credentials
379+
without creating duplicates.
380+
381+
This ensures that calling the endpoint multiple times with the same organization ID
382+
will not create duplicate resources, making it safe for automated provisioning workflows.
383+
384+
**AWS resources provisioned:**
385+
- S3 bucket with AES256 encryption and public access blocked
386+
- IAM policy for bucket access (write-only to /raw folder)
387+
- IAM user with access keys
388+
- Credentials stored in AWS Secrets Manager with proper tagging
389+
operationId: provisionCdnLogsInfrastructure
390+
requestBody:
391+
required: true
392+
content:
393+
application/json:
394+
schema:
395+
$ref: './schemas.yaml#/CdnLogsBucketRequest'
396+
responses:
397+
'200':
398+
description: Infrastructure provisioned successfully
399+
content:
400+
application/json:
401+
schema:
402+
$ref: './schemas.yaml#/CdnLogsBucketResponse'
403+
'400':
404+
description: Bad request - missing or invalid parameters
405+
'403':
406+
description: Forbidden - admin access required
407+
'500':
408+
description: Internal server error
409+
security:
410+
- admin_key: []

0 commit comments

Comments
 (0)