Skip to content

Commit d1fc2f7

Browse files
committed
feat: add support for provisioning cdn logs infra for onboarding
1 parent a47d43b commit d1fc2f7

File tree

11 files changed

+3600
-1536
lines changed

11 files changed

+3600
-1536
lines changed

docs/index.html

Lines changed: 181 additions & 53 deletions
Large diffs are not rendered by default.

docs/openapi/api.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ tags:
4949
description: APIs for scraping web pages
5050
- name: llmo
5151
description: LLMO (Large Language Model Optimizer) operations
52+
- name: cdn-logs
53+
description: CDN logs infrastructure provisioning for organizations
5254

5355
paths:
5456
/audits/latest/{auditType}:
@@ -215,6 +217,8 @@ paths:
215217
$ref: './tools-api.yaml#/import-job-progress'
216218
/tools/import/jobs/{jobId}/result:
217219
$ref: './tools-api.yaml#/import-job-result'
220+
/tools/cdn-logs/buckets/{imsOrgName}/{imsOrgId}:
221+
$ref: './tools-api.yaml#/cdn-logs-buckets'
218222
/sites/{siteId}/llmo/sheet-data/{dataSource}:
219223
$ref: './llmo-api.yaml#/llmo-sheet-data'
220224
/sites/{siteId}/llmo/sheet-data/{sheetType}/{dataSource}:

docs/openapi/schemas.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3490,3 +3490,64 @@ LlmoConfig:
34903490
description: The customer intent configuration containing key-value pairs
34913491
$ref: '#/LlmoCustomerIntent'
34923492
additionalProperties: false
3493+
3494+
CdnLogsBucketResponse:
3495+
type: object
3496+
description: Response from CDN logs bucket provisioning operation
3497+
required:
3498+
- message
3499+
- imsOrgName
3500+
- imsOrgId
3501+
- bucketName
3502+
- bucketArn
3503+
- bucketExists
3504+
- configuration
3505+
properties:
3506+
message:
3507+
type: string
3508+
description: Descriptive message about what was created or retrieved
3509+
example: "Successfully created CDN logs bucket and credentials for organization: adobe (ID: 1234567890ABCDEF12345678@AdobeOrg)"
3510+
imsOrgName:
3511+
type: string
3512+
description: Organization name
3513+
example: "adobe"
3514+
imsOrgId:
3515+
type: string
3516+
description: Organization identifier
3517+
example: "1234567890ABCDEF12345678@AdobeOrg"
3518+
bucketName:
3519+
type: string
3520+
description: Generated CDN logs bucket name
3521+
example: "cdn-logs-adobe-1234567890"
3522+
bucketArn:
3523+
type: string
3524+
description: CDN logs bucket ARN
3525+
example: "arn:aws:s3:::cdn-logs-adobe-1234567890"
3526+
bucketExists:
3527+
type: boolean
3528+
description: Whether the bucket already existed before this request
3529+
example: false
3530+
credentials:
3531+
type: object
3532+
description: CDN logs access credentials
3533+
properties:
3534+
accessKey:
3535+
type: string
3536+
description: AWS access key ID for CDN logs
3537+
example: "AKIAIOSFODNN7EXAMPLE"
3538+
secretKey:
3539+
type: string
3540+
description: AWS secret access key for CDN logs (only returned during creation)
3541+
example: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
3542+
secretArn:
3543+
type: string
3544+
description: AWS Secrets Manager ARN where CDN logs credentials are stored
3545+
example: "arn:aws:secretsmanager:us-east-1:123456789012:secret:adobe-1234567890-AbCdEf"
3546+
secretPath:
3547+
type: string
3548+
description: AWS Secrets Manager path for CDN logs credentials
3549+
example: "/helix-deploy/spacecat-services/customer-secrets/adobe_1234567890/latest"
3550+
additionalProperties: false
3551+
additionalProperties: false
3552+
3553+

docs/openapi/tools-api.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,62 @@ file-download:
362362
$ref: './responses.yaml#/500'
363363
security:
364364
- scoped_api_key: [ ]
365+
366+
cdn-logs-buckets:
367+
put:
368+
tags:
369+
- cdn-logs
370+
summary: Create or return CDN logs bucket for organization
371+
description: |
372+
Creates a new CDN logs S3 bucket with full configuration for an organization, or returns existing bucket details.
373+
374+
The CDN logs bucket name is generated from the organization name and ID using AWS naming conventions.
375+
Organization names must contain only letters, numbers, and hyphens.
376+
Organization IDs must contain only uppercase letters, numbers, and optionally end with @AdobeOrg.
377+
378+
For new CDN logs infrastructure, creates:
379+
- S3 bucket with encryption and security settings optimized for CDN logs
380+
- IAM policy and user for CDN logs access
381+
- CDN logs access credentials stored in AWS Secrets Manager
382+
383+
If the CDN logs bucket already exists, returns the existing bucket information.
384+
operationId: provisionCdnLogsBucket
385+
security:
386+
- ims_key: [ ]
387+
- scoped_api_key: [ ]
388+
parameters:
389+
- name: imsOrgName
390+
in: path
391+
required: true
392+
description: IMS Organization name (letters, numbers, and hyphens only)
393+
schema:
394+
type: string
395+
pattern: '^[a-zA-Z0-9-]+$'
396+
example: "adobe"
397+
- name: imsOrgId
398+
in: path
399+
required: true
400+
description: IMS Organization identifier (uppercase letters, numbers, optionally ending with @AdobeOrg)
401+
schema:
402+
type: string
403+
pattern: '^[A-Z0-9]+(@AdobeOrg)?$'
404+
example: "1234567890ABCDEF12345678@AdobeOrg"
405+
responses:
406+
'200':
407+
description: CDN logs bucket and/or credentials already exist, returning details
408+
content:
409+
application/json:
410+
schema:
411+
$ref: './schemas.yaml#/CdnLogsBucketResponse'
412+
'201':
413+
description: CDN logs bucket and/or credentials created successfully
414+
content:
415+
application/json:
416+
schema:
417+
$ref: './schemas.yaml#/CdnLogsBucketResponse'
418+
'400':
419+
$ref: './responses.yaml#/400'
420+
'500':
421+
$ref: './responses.yaml#/500'
422+
423+

0 commit comments

Comments
 (0)