

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Struktur rahasia JSON AWS Secrets Manager
<a name="reference_secret_json_structure"></a>

Anda dapat menyimpan teks atau biner apa pun dalam rahasia Secrets Manager hingga ukuran maksimum 65.536 Byte. 

Jika Anda menggunakan[Rotasi dengan fungsi Lambda](rotate-secrets_lambda.md), rahasia harus berisi bidang JSON tertentu yang diharapkan oleh fungsi rotasi. Misalnya, untuk rahasia yang berisi kredensil database, fungsi rotasi terhubung ke database untuk memperbarui kredensil, sehingga rahasia harus berisi informasi koneksi database.

Jika Anda menggunakan konsol untuk mengedit rotasi rahasia database, rahasia harus berisi pasangan nilai kunci JSON tertentu yang mengidentifikasi database. Secrets Manager menggunakan bidang ini untuk menanyakan database untuk menemukan VPC yang benar untuk menyimpan fungsi rotasi.

Nama kunci JSON peka huruf besar/kecil.

**Topics**
+ [Kredensi Amazon RDS dan Aurora](#reference_secret_json_structure_rds)
+ [Kredensi Amazon Redshift](#reference_secret_json_structure_RS)
+ [Kredensi Tanpa Server Amazon Redshift](#reference_secret_json_structure_RSServerless)
+ [Kredensi Amazon DocumentDB](#reference_secret_json_structure_docdb)
+ [Amazon Timestream untuk struktur rahasia InfluxDB](#reference_secret_json_structure_TIME)
+ [ElastiCache Kredensi Amazon](#reference_secret_json_structure_ELC)
+ [Kredensil Direktori Aktif](#reference_secret_json_structure_AD)

## Kredensi Amazon RDS dan Aurora
<a name="reference_secret_json_structure_rds"></a>

Untuk menggunakan [template fungsi rotasi yang disediakan oleh Secrets Manager](reference_available-rotation-templates.md#RDS_rotation_templates), gunakan struktur JSON berikut. Anda dapat menambahkan lebih banyak key/value pasangan, misalnya untuk memuat informasi koneksi untuk database replika di Wilayah lain.

------
#### [ DB2 ]

Untuk instans Amazon RDS Db2, karena pengguna tidak dapat mengubah kata sandi mereka sendiri, Anda harus memberikan kredensi admin dalam rahasia terpisah.

```
{
  "engine": "db2",
  "host": "<instance host name/resolvable DNS name>",
  "username": "<username>",
  "password": "<password>",
  "dbname": "<database name. If not specified, defaults to None>",
  "port": <TCP port number. If not specified, defaults to 3306>,
  "masterarn": "<ARN of the elevated secret>",
  "dbInstanceIdentifier": <optional: ID of the instance. Alternately, use dbClusterIdentifier. Required for configuring rotation in the console.>",
  "dbClusterIdentifier": <optional: ID of the cluster. Alternately, use dbInstanceIdentifier. Required for configuring rotation in the console.>"
}
```

------
#### [ MariaDB ]

```
{
  "engine": "mariadb",
  "host": "<instance host name/resolvable DNS name>",
  "username": "<username>",
  "password": "<password>",
  "dbname": "<database name. If not specified, defaults to None>",
  "port": <TCP port number. If not specified, defaults to 3306>,
  "masterarn": "<optional: ARN of the elevated secret. Required for the Strategi rotasi: pengguna bergantian.>",
  "dbInstanceIdentifier": <optional: ID of the instance. Alternately, use dbClusterIdentifier. Required for configuring rotation in the console.>",
  "dbClusterIdentifier": <optional: ID of the cluster. Alternately, use dbInstanceIdentifier. Required for configuring rotation in the console.>"
}
```

------
#### [ MySQL ]

```
{
  "engine": "mysql",
  "host": "<instance host name/resolvable DNS name>",
  "username": "<username>",
  "password": "<password>",
  "dbname": "<database name. If not specified, defaults to None>",
  "port": <TCP port number. If not specified, defaults to 3306>,
  "masterarn": "<optional: ARN of the elevated secret. Required for the Strategi rotasi: pengguna bergantian.>",
  "dbInstanceIdentifier": <optional: ID of the instance. Alternately, use dbClusterIdentifier. Required for configuring rotation in the console.>",
  "dbClusterIdentifier": <optional: ID of the cluster. Alternately, use dbInstanceIdentifier. Required for configuring rotation in the console.>"
}
```

------
#### [ Oracle ]

```
{
  "engine": "oracle",
  "host": "<instance host name/resolvable DNS name>",
  "username": "<username>",
  "password": "<password>",
  "dbname": "<database name>",
  "port": <TCP port number. If not specified, defaults to 1521>,
  "masterarn": "<optional: ARN of the elevated secret. Required for the Strategi rotasi: pengguna bergantian.>",
  "dbInstanceIdentifier": <optional: ID of the instance. Alternately, use dbClusterIdentifier. Required for configuring rotation in the console.>",
  "dbClusterIdentifier": <optional: ID of the cluster. Alternately, use dbInstanceIdentifier. Required for configuring rotation in the console.>"
}
```

------
#### [ Postgres ]

```
{
  "engine": "postgres",
  "host": "<instance host name/resolvable DNS name>",
  "username": "<username>",
  "password": "<password>",
  "dbname": "<database name. If not specified, defaults to 'postgres'>",
  "port": <TCP port number. If not specified, defaults to 5432>,
  "masterarn": "<optional: ARN of the elevated secret. Required for the Strategi rotasi: pengguna bergantian.>",
  "dbInstanceIdentifier": <optional: ID of the instance. Alternately, use dbClusterIdentifier. Required for configuring rotation in the console.>",
  "dbClusterIdentifier": <optional: ID of the cluster. Alternately, use dbInstanceIdentifier. Required for configuring rotation in the console.>"
}
```

------
#### [ SQLServer ]

```
{
  "engine": "sqlserver",
  "host": "<instance host name/resolvable DNS name>",
  "username": "<username>",
  "password": "<password>",
  "dbname": "<database name. If not specified, defaults to 'master'>",
  "port": <TCP port number. If not specified, defaults to 1433>,
  "masterarn": "<optional: ARN of the elevated secret. Required for the Strategi rotasi: pengguna bergantian.>",
  "dbInstanceIdentifier": <optional: ID of the instance. Alternately, use dbClusterIdentifier. Required for configuring rotation in the console.>",
  "dbClusterIdentifier": <optional: ID of the cluster.Alternately, use dbInstanceIdentifier.  Required for configuring rotation in the console.>"
}
```

------

## Kredensi Amazon Redshift
<a name="reference_secret_json_structure_RS"></a>

Untuk menggunakan [template fungsi rotasi yang disediakan oleh Secrets Manager](reference_available-rotation-templates.md#template-redshift), gunakan struktur JSON berikut. Anda dapat menambahkan lebih banyak key/value pasangan, misalnya untuk memuat informasi koneksi untuk database replika di Wilayah lain.

```
{
  "engine": "redshift",
  "host": "<instance host name/resolvable DNS name>",
  "username": "<username>",
  "password": "<password>",
  "dbname": "<database name. If not specified, defaults to None>",
  "dbClusterIdentifier": "<optional: database ID. Required for configuring rotation in the console.>"
  "port": <optional: TCP port number. If not specified, defaults to 5439>
  "masterarn": "<optional: ARN of the elevated secret. Required for the Strategi rotasi: pengguna bergantian.>"
}
```

## Kredensi Tanpa Server Amazon Redshift
<a name="reference_secret_json_structure_RSServerless"></a>

Untuk menggunakan [template fungsi rotasi yang disediakan oleh Secrets Manager](reference_available-rotation-templates.md#template-redshift), gunakan struktur JSON berikut. Anda dapat menambahkan lebih banyak key/value pasangan, misalnya untuk memuat informasi koneksi untuk database replika di Wilayah lain.

```
{
  "engine": "redshift",
  "host": "<instance host name/resolvable DNS name>",
  "username": "<username>",
  "password": "<password>",
  "dbname": "<database name. If not specified, defaults to None>",
  "namespaceName": "<optional: namespace name, Required for configuring rotation in the console.> "
  "port": <optional: TCP port number. If not specified, defaults to 5439>
  "masterarn": "<optional: ARN of the elevated secret. Required for the Strategi rotasi: pengguna bergantian.>"
}
```

## Kredensi Amazon DocumentDB
<a name="reference_secret_json_structure_docdb"></a>

Untuk menggunakan [template fungsi rotasi yang disediakan oleh Secrets Manager](reference_available-rotation-templates.md#NON-RDS_rotation_templates), gunakan struktur JSON berikut. Anda dapat menambahkan lebih banyak key/value pasangan, misalnya untuk memuat informasi koneksi untuk database replika di Wilayah lain.

```
{
  "engine": "mongo",
  "host": "<instance host name/resolvable DNS name>",
  "username": "<username>",
  "password": "<password>",
  "dbname": "<database name. If not specified, defaults to None>",
  "port": <TCP port number. If not specified, defaults to 27017>,
  "ssl": <true|false. If not specified, defaults to false>,
  "masterarn": "<optional: ARN of the elevated secret. Required for the Strategi rotasi: pengguna bergantian.>",
  "dbClusterIdentifier": "<optional: database cluster ID. Alternately, use dbInstanceIdentifier. Required for configuring rotation in the console.>"
  "dbInstanceIdentifier": "<optional: database instance ID. Alternately, use dbClusterIdentifier. Required for configuring rotation in the console.>"
}
```

## Amazon Timestream untuk struktur rahasia InfluxDB
<a name="reference_secret_json_structure_TIME"></a>

Untuk memutar rahasia Timestream, Anda dapat menggunakan template [Amazon Timestream untuk InfluxDB](reference_available-rotation-templates.md#template-TimeStream) rotasi.

*Untuk informasi selengkapnya, lihat [Cara Amazon TimeStream untuk InfluxDB menggunakan rahasia](https://docs.aws.amazon.com/timestream/latest/developerguide/timestream-for-influx-security-db-secrets.html) di Panduan Pengembang Amazon Timestream.*

Rahasia Timestream harus dalam struktur JSON yang benar untuk dapat menggunakan template rotasi. Untuk informasi selengkapnya, lihat [Apa yang ada di rahasia](https://docs.aws.amazon.com/timestream/latest/developerguide/timestream-for-influx-security-db-secrets.html#timestream-for-influx-security-db-secrets-definition) di Panduan *Pengembang Amazon Timestream*.

## ElastiCache Kredensi Amazon
<a name="reference_secret_json_structure_ELC"></a>

Contoh berikut menunjukkan struktur JSON untuk rahasia yang menyimpan ElastiCache kredensil.

```
{
  "password": "<password>",
  "username": "<username>" 
  "user_arn": "ARN of the Amazon EC2 user"
}
```

Untuk informasi selengkapnya, lihat [Memutar kata sandi secara otomatis untuk pengguna](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/User-Secrets-Manager.html) di *Panduan ElastiCache Pengguna Amazon*.

## Kredensil Direktori Aktif
<a name="reference_secret_json_structure_AD"></a>

AWS Directory Service menggunakan rahasia untuk menyimpan kredensil Active Directory. Untuk informasi selengkapnya, lihat [Menggabungkan instans Amazon EC2 Linux dengan mulus ke Direktori Aktif AD Terkelola](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/seamlessly_join_linux_instance.html) di Panduan *AWS Directory Service Administrasi*. Gabungan domain yang mulus memerlukan nama kunci dalam contoh berikut. Jika Anda tidak menggunakan gabungan domain tanpa batas, Anda dapat mengubah nama kunci dalam rahasia menggunakan variabel lingkungan seperti yang dijelaskan dalam kode templat fungsi rotasi.

Untuk memutar rahasia Active Directory, Anda dapat menggunakan [template rotasi Active Directory](reference_available-rotation-templates.md#template-AD).

------
#### [ Active Directory credential ]

```
{
  "awsSeamlessDomainUsername": "<username>",
  "awsSeamlessDomainPassword": "<password>"
}
```

Jika Anda ingin memutar rahasia, Anda menyertakan ID direktori domain.

```
{
  "awsSeamlessDomainDirectoryId": "d-12345abc6e",
  "awsSeamlessDomainUsername": "<username>",
  "awsSeamlessDomainPassword": "<password>"
}
```

Jika rahasia digunakan bersama dengan rahasia yang berisi keytab, Anda menyertakan rahasia keytab. ARNs

```
{
  "awsSeamlessDomainDirectoryId": "d-12345abc6e",
  "awsSeamlessDomainUsername": "<username>",
  "awsSeamlessDomainPassword": "<password>",
  "directoryServiceSecretVersion": 1,
  "schemaVersion": "1.0",
  "keytabArns": [
    "<ARN of child keytab secret 1>,
    "<ARN of child keytab secret 2>,
    "<ARN of child keytab secret 3>,
  ],
  "lastModifiedDateTime": "2021-07-19 17:06:58"
}
```

------
#### [ Active Directory keytab ]

Untuk informasi tentang menggunakan file tab tombol untuk mengautentikasi ke akun Active Directory di Amazon EC2, [lihat Menyebarkan dan mengonfigurasi otentikasi Direktori Aktif dengan SQL Server](https://aws.amazon.com/blogs/database/deploying-and-configuring-active-directory-authentication-with-sql-server-2017-on-amazon-linux-2/) 2017 di Amazon Linux 2.

```
{
  "awsSeamlessDomainDirectoryId": "d-12345abc6e",
  "schemaVersion": "1.0",
  "name": "< name>",
  "principals": [
    "aduser@MY.EXAMPLE.COM",
    "MSSQLSvc/test:1433@MY.EXAMPLE.COM"
  ],
  "keytabContents": "<keytab>",
  "parentSecretArn": "<ARN of parent secret>",
  "lastModifiedDateTime": "2021-07-19 17:06:58"
  "version": 1
}
```

------