

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

# Langkah 2. Buat AWS Service Catalog produk
<a name="step-2-create-blueprint-product"></a>

Untuk membuat AWS Service Catalog produk, ikuti langkah-langkah di [Membuat produk](https://docs.aws.amazon.com//servicecatalog/latest/adminguide/productmgmt-cloudresource.html) di *Panduan AWS Service Catalog Administrator*. Anda akan menambahkan cetak biru akun Anda sebagai templat saat membuat produk. AWS Service Catalog 

**penting**  
*Sebagai hasil dari HashiCorp lisensi Terraform yang diperbarui, AWS Service Catalog mengubah dukungan untuk produk *Terraform Open Source* dan menyediakan produk ke jenis produk baru, yang disebut Eksternal.* Untuk mempelajari lebih lanjut tentang bagaimana perubahan ini memengaruhi AFC, termasuk cara memperbarui cetak biru akun yang ada ke jenis produk Eksternal, tinjau [Transisi ke](af-customization-page.md#service-catalog-external-product-type) jenis produk Eksternal. 

**Ringkasan langkah-langkah untuk membuat cetak biru**
+ Buat atau unduh CloudFormation templat atau file konfigurasi Terraform tar.gz yang akan menjadi cetak biru akun Anda. Beberapa contoh template diberikan nanti di bagian ini.
+ Masuk ke Akun AWS tempat Anda menyimpan cetak biru Account Factory (terkadang disebut akun hub).
+ Arahkan ke AWS Service Catalog konsol. Pilih **daftar Produk**, lalu pilih **Unggah produk baru**.
+ Di panel **Detail Produk**, masukkan detail untuk produk cetak biru Anda, seperti nama dan deskripsi.
+ Pilih **Gunakan file templat** dan kemudian pilih **Pilih file**. Pilih atau tempel templat atau file konfigurasi yang telah Anda kembangkan atau unduh untuk digunakan sebagai cetak biru Anda.
+ Pilih **Buat produk** di bagian bawah halaman konsol.

 Anda dapat mengunduh CloudFormation template dari repositori arsitektur AWS Service Catalog referensi. [Salah satu contoh dari repositori itu membantu menyiapkan rencana cadangan untuk sumber daya Anda](https://github.com/aws-samples/aws-service-catalog-reference-architectures/blob/master/backup/backup-tagoptions.yml). 

Berikut adalah contoh template, untuk perusahaan fiktif bernama **Best** Pets. Ini membantu mengatur koneksi ke database hewan peliharaan mereka.

```
Resources:
  ConnectionStringGeneratorLambdaRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"		 	 	 
        Statement:
          - Effect: Allow
            Principal:
              Service:
                - lambda.amazonaws.com
            Action:
              - "sts:AssumeRole"
  ConnectionStringGeneratorLambda:
    Type: AWS::Lambda::Function
    Properties:
      FunctionName: !Join ['-', ['ConnectionStringGenerator', !Select [4, !Split ['-', !Select [2, !Split ['/', !Ref AWS::StackId]]]]]]
      Description: Retrieves the connection string for this account to access the Pet Database
      Role: !GetAtt ConnectionStringGeneratorLambdaRole.Arn
      Runtime: nodejs22.x
      Handler: index.handler
      Timeout: 5
      Code:
        ZipFile: >
           export const handler = async (event, context) => {
             const awsAccountId = context.invokedFunctionArn.split(“:”)[4]
             const connectionString= “fake connection for account ” + awsAccountId;
             const response = {
               statusCode: 200,
               body: connectionString
             };
           return response;
          };

  ConnectionString:
    Type: Custom::ConnectionStringGenerator
    Properties:
      ServiceToken: !GetAtt ConnectionStringGeneratorLambda.Arn

  PetDatabaseConnectionString:
    DependsOn: ConnectionString
    # For example purposes we're using SSM parameter store.
    # In your template, use secure alternatives to store
    # sensitive values such as connection strings.
    Type: AWS::SSM::Parameter
    Properties: 
      Name: pet-database-connection-string
      Description: Connection information for the BestPets pet database
      Type: String
      Value: !GetAtt ConnectionString.Value
```