Skip to content

Add API for creating instance_amazon_s3_configuration for audit events

What does this MR do and why?

Add API for creating instance_amazon_s3_configurations for audit event streaming.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Visit GraphiQL explorer https://gdk.test:3000/-/graphql-explorer
  2. Run the following mutation to create a new AuditEvents::Instance::AmazonS3Configuration
mutation createInstanceAmazonS3Configuration {
  auditEventsInstanceAmazonS3ConfigurationCreate(input: {name: "AWS S3 Sanbox Instance", awsRegion: "us-east-1", accessKeyXid: "AKIA1234AKIA1234", secretAccessKey: "SECRET123SECRET123", bucketName: "gitlab-audit-logs"}) {
    errors,
    instanceAmazonS3Configuration{
      id,
      name,
      bucketName,
      accessKeyXid,
      awsRegion
    }
  }
  1. You will get a response with the following format
{
  "data": {
    "auditEventsInstanceAmazonS3ConfigurationCreate": {
      "errors": [],
      "instanceAmazonS3Configuration": {
        "id": "gid://gitlab/AuditEvents::Instance::AmazonS3Configuration/9",
        "name": "AWS S3 Sanbox Instance",
        "bucketName": "gitlab-audit-logs",
        "accessKeyXid": "AKIA1234AKIA1234",
        "awsRegion": "us-east-1"
      }
    }
  }
}
  1. Run the following in rails console and verify that a new record was created with correct attributes
AuditEvents::Instance::AmazonS3Configuration.last

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #423235 (closed)

Edited by Huzaifa Iftikhar

Merge request reports

Loading