> ## Documentation Index
> Fetch the complete documentation index at: https://biznetgio.creations.ren/llms.txt
> Use this file to discover all available pages before exploring further.

# Object Storage (Pulumi)

> Resource dan function Pulumi buat NEO Object Storage

NEO Object Storage itu storage S3-compatible punya Biznet GIO (`/object-storages` API group). Provider manage subscription, bucket, kredensial S3, dan objek individual lewat API control-plane.

<Info>
  Setiap create/upgrade bikin **order berbayar beneran**. Upgrade quota cuma bisa naik dan ditagih increment.
</Info>

## `biznetgio:index:ObjectStorage`

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    import * as biznetgio from "@shirasakaren/biznetgio";

    const storage = new biznetgio.ObjectStorage("archive", {
      productId: 8,
      cycle: "m",
      label: "data-archive",
      quota: 10,   // grow-only; upgrade sends the increment
      payWithCreditCard: true,
    });

    export const storageStatus = storage.status;
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import pulumi
    import pulumi_biznetgio

    storage = pulumi_biznetgio.ObjectStorage(
        "archive",
        product_id=8,
        cycle="m",
        label="data-archive",
        quota=10,   # grow-only; upgrade sends the increment
        pay_with_credit_card=True,
    )

    pulumi.export("storageStatus", storage.status)
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    package main

    import (
        biznetgio "github.com/shirasakaren/pulumi-biznetgio/sdk/go/pulumi-biznetgio"
        "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )

    func main() {
        pulumi.Run(func(ctx *pulumi.Context) error {
            storage, err := biznetgio.NewObjectStorage(ctx, "archive", &biznetgio.ObjectStorageArgs{
                ProductId:         pulumi.Int(8),
                Cycle:             pulumi.String("m"),
                Label:             pulumi.String("data-archive"),
                Quota:             pulumi.Int(10),
                PayWithCreditCard: pulumi.Bool(true),
            })
            if err != nil {
                return err
            }

            ctx.Export("storageStatus", storage.Status)
            return nil
        })
    }
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    using System;
    using System.Collections.Generic;
    using Pulumi;
    using Shirasakaren.Biznetgio;

    return await Deployment.RunAsync(() =>
    {
        var storage = new ObjectStorage("archive", new ObjectStorageArgs
        {
            ProductId = 8,
            Cycle = "m",
            Label = "data-archive",
            Quota = 10,
            PayWithCreditCard = true,
        });

        return new Dictionary<string, object?>
        {
            ["storageStatus"] = storage.Status,
        };
    });
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    package demo;

    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import ren.shirasaka.biznetgio.*;

    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }

        private static void stack(Context ctx) {
            var storage = new ObjectStorage("archive",
                ObjectStorageArgs.builder()
                    .productId(8)
                    .cycle("m")
                    .label("data-archive")
                    .quota(10)
                    .payWithCreditCard(true)
                    .build());

            ctx.export("storageStatus", storage.status());
        }
    }
    ```
  </Tab>

  <Tab title="YAML">
    ```yaml theme={null}
    resources:
      storage:
        type: biznetgio:index:ObjectStorage
        properties:
          productId: 8
          cycle: m
          label: data-archive
          quota: 10
          payWithCreditCard: true
    ```
  </Tab>
</Tabs>

| Input               | Type   | Required | Notes                                   |
| ------------------- | ------ | -------- | --------------------------------------- |
| `productId`         | int64  | yes      |                                         |
| `cycle`             | string | yes      | `m a q s b t p4 p5`                     |
| `label`             | string | yes      | 6-16 char, `[a-zA-Z0-9-_]`; create-only |
| `quota`             | int64  | no       | default `10` GB, cuma bisa naik         |
| `promocode`         | string | no       | create-only                             |
| `payWithCreditCard` | bool   | no       | default `true`                          |

Outputs: `orderId`, `status` (`Active`/`Pending`/`Suspended`/`Terminated`), `raw` (secret). Read error kalau status instance `terminated`. Import pake numeric account id.

## `biznetgio:index:ObjectStorageBucket`

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const bucket = new biznetgio.ObjectStorageBucket("assets", {
      accountId: storage.id,
      name: "my-assets",
      acl: "private",
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    bucket = pulumi_biznetgio.ObjectStorageBucket(
        "assets",
        account_id=storage.id,
        name="my-assets",
        acl="private",
    )
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    bucket, err := biznetgio.NewObjectStorageBucket(ctx, "assets", &biznetgio.ObjectStorageBucketArgs{
        AccountId: storage.ID(),
        Name:      pulumi.String("my-assets"),
        Acl:       pulumi.String("private"),
    })
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    var bucket = new ObjectStorageBucket("assets", new ObjectStorageBucketArgs
    {
        AccountId = storage.Id,
        Name = "my-assets",
        Acl = "private",
    });
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    var bucket = new ObjectStorageBucket("assets",
        ObjectStorageBucketArgs.builder()
            .accountId(storage.id())
            .name("my-assets")
            .acl("private")
            .build());
    ```
  </Tab>

  <Tab title="YAML">
    ```yaml theme={null}
    bucket:
      type: biznetgio:index:ObjectStorageBucket
      properties:
        accountId: ${storage.id}
        name: my-assets
        acl: private
    ```
  </Tab>
</Tabs>

| Input       | Type   | Required | Notes                                                                                                                   |
| ----------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `accountId` | string | yes      | account id instance                                                                                                     |
| `name`      | string | yes      | min 3 char, `[a-zA-Z0-9-_]`; immutable                                                                                  |
| `acl`       | string | no       | default `""`; salah satu dari `private`, `public-read`, `public-read-write`, `authenticated-read`, `log-delivery-write` |

Output: `raw` (secret). Composite id `<accountId>:<name>`; cuma `acl` yang update in place.

## `biznetgio:index:ObjectStorageCredential`

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const credential = new biznetgio.ObjectStorageCredential("main", {
      accountId: storage.id,
      active: true,   // set false to disable without deleting
    });
    export const accessKey = credential.accessKey;
    export const secretKey = credential.secretKey;
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    credential = pulumi_biznetgio.ObjectStorageCredential(
        "main",
        account_id=storage.id,
        active=True,   # set false to disable without deleting
    )
    pulumi.export("accessKey", credential.access_key)
    pulumi.export("secretKey", credential.secret_key)
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    credential, err := biznetgio.NewObjectStorageCredential(ctx, "main", &biznetgio.ObjectStorageCredentialArgs{
        AccountId: storage.ID(),
        Active:    pulumi.Bool(true),
    })
    ctx.Export("accessKey", credential.AccessKey)
    ctx.Export("secretKey", credential.SecretKey)
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    var credential = new ObjectStorageCredential("main", new ObjectStorageCredentialArgs
    {
        AccountId = storage.Id,
        Active = true,
    });
    // credential.AccessKey, credential.SecretKey
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    var credential = new ObjectStorageCredential("main",
        ObjectStorageCredentialArgs.builder()
            .accountId(storage.id())
            .active(true)
            .build());
    ctx.export("accessKey", credential.accessKey());
    ctx.export("secretKey", credential.secretKey());
    ```
  </Tab>

  <Tab title="YAML">
    ```yaml theme={null}
    credential:
      type: biznetgio:index:ObjectStorageCredential
      properties:
        accountId: ${storage.id}
        active: true
    ```
  </Tab>
</Tabs>

| Input       | Type   | Required | Notes                                        |
| ----------- | ------ | -------- | -------------------------------------------- |
| `accountId` | string | yes      |                                              |
| `active`    | bool   | no       | default `true`; update toggle enable/disable |

Outputs: `accessKey` (secret - return sekali pas create), `secretKey` (secret - ditampilin cuma sekali; value state terakhir dipertahankan saat refresh), `raw` (secret).

Composite id `<accountId>:<16-hex sha256 prefix of accessKey>` - access key plaintext gak pernah muncul di id; delete resolve key dari list credentials.

## `biznetgio:index:ObjectStorageObject`

Harus set tepat satu dari `source` atau `content` - kalau nggak, validation gagal.

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const obj = new biznetgio.ObjectStorageObject("index", {
      accountId: storage.id,
      bucket: bucket.name,
      key: "site/index.html",
      source: "./index.html",
      acl: "public-read",
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    obj = pulumi_biznetgio.ObjectStorageObject(
        "index",
        account_id=storage.id,
        bucket=bucket.name,
        key="site/index.html",
        source="./index.html",
        acl="public-read",
    )
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    obj, err := biznetgio.NewObjectStorageObject(ctx, "index", &biznetgio.ObjectStorageObjectArgs{
        AccountId: storage.ID(),
        Bucket:    bucket.Name,
        Key:       pulumi.String("site/index.html"),
        Source:    pulumi.String("./index.html"),
        Acl:       pulumi.String("public-read"),
    })
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    var obj = new ObjectStorageObject("index", new ObjectStorageObjectArgs
    {
        AccountId = storage.Id,
        Bucket = bucket.Name,
        Key = "site/index.html",
        Source = "./index.html",
        Acl = "public-read",
    });
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    var obj = new ObjectStorageObject("index",
        ObjectStorageObjectArgs.builder()
            .accountId(storage.id())
            .bucket(bucket.name())
            .key("site/index.html")
            .source("./index.html")
            .acl("public-read")
            .build());
    ```
  </Tab>

  <Tab title="YAML">
    ```yaml theme={null}
    obj:
      type: biznetgio:index:ObjectStorageObject
      properties:
        accountId: ${storage.id}
        bucket: ${bucket.name}
        key: site/index.html
        source: ./index.html
        acl: public-read
    ```
  </Tab>
</Tabs>

| Input       | Type           | Required | Notes                                             |
| ----------- | -------------- | -------- | ------------------------------------------------- |
| `accountId` | string         | yes      |                                                   |
| `bucket`    | string         | yes      |                                                   |
| `key`       | string         | yes      | path objek (directory + filename)                 |
| `source`    | string         | no       | path file lokal; one-of sama `content`            |
| `content`   | string, secret | no       | konten inline; one-of sama `source`               |
| `acl`       | string         | no       | default `""`; canned values sama kayak bucket ACL |

Output: `raw` (secret). Composite id `<accountId>:<bucket>:<key>`; ganti content = ganti objek, cuma `acl` yang update in place.

<Note>
  Resource ini **gak** cocok buat objek gede atau bulk sync. Buat workload beneran, pake tooling S3-compatible (AWS CLI, rclone, SDKs) dengan credential dari `ObjectStorageCredential` - Biznet GIO publish S3 endpoint per-region berbentuk `nos.<region>.neo.id`.
</Note>

## Functions

### `biznetgio:index:objectStorageInstances`

Argument `status` (filter optional). Return `instances`: `id`, `label`, `status`, `productId`, `quota`, `raw` (secret).

### `biznetgio:index:objectStorageBuckets`

Argument `accountId` (string). Return `buckets`: `name`, `acl`, `raw` (secret).

### `biznetgio:index:objectStorageCredentials`

Argument `accountId` (string). Return `credentials`: `accessKey` (secret), `active`. Secret key gak pernah di-return.
