

Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh [SDK AWS Doc](https://github.com/awsdocs/aws-doc-sdk-examples). GitHub 

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

# Route 53 Profil contoh menggunakan AWS CLI
<a name="cli_2_route53profiles_code_examples"></a>

Contoh kode berikut menunjukkan cara melakukan tindakan dan mengimplementasikan skenario umum dengan menggunakan Profil AWS Command Line Interface with Route 53.

*Tindakan* merupakan kutipan kode dari program yang lebih besar dan harus dijalankan dalam konteks. Sementara tindakan menunjukkan cara memanggil fungsi layanan individual, Anda dapat melihat tindakan dalam konteks dalam skenario terkait.

Setiap contoh menyertakan tautan ke kode sumber lengkap, di mana Anda dapat menemukan instruksi tentang cara mengatur dan menjalankan kode dalam konteks.

**Topics**
+ [Tindakan](#actions)

## Tindakan
<a name="actions"></a>

### `associate-profile`
<a name="route53profiles_AssociateProfile_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`associate-profile`.

**AWS CLI**  
**Untuk mengaitkan Profil**  
`associate-profile`Contoh berikut mengaitkan Profil ke VPC.  

```
aws route53profiles associate-profile \
    --name test-association \
    --profile-id rp-4987774726example \
    --resource-id vpc-0af3b96b3example
```
Output:  

```
{
    "ProfileAssociation": {
        "CreationTime": 1710851336.527,
        "Id": "rpassoc-489ce212fexample",
        "ModificationTime": 1710851336.527,
        "Name": "test-association",
        "OwnerId": "123456789012",
        "ProfileId": "rp-4987774726example",
        "ResourceId": "vpc-0af3b96b3example",
        "Status": "CREATING",
        "StatusMessage": "Creating Profile Association"
    }
}
```
Untuk informasi selengkapnya, lihat [Menggunakan Profil](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/profile-high-level-steps.html) di *Panduan Pengembang Amazon Route 53*.  
+  Untuk detail API, lihat [AssociateProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/associate-profile.html)di *Referensi AWS CLI Perintah*. 

### `associate-resource-to-profile`
<a name="route53profiles_AssociateResourceToProfile_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`associate-resource-to-profile`.

**AWS CLI**  
**Untuk mengaitkan sumber daya ke Profil**  
`associate-resource-to-profile`Contoh berikut mengaitkan grup aturan DNS Firewall dengan prioritas 102 ke Profil.  

```
aws route53profiles associate-resource-to-profile \
    --name test-resource-association \
    --profile-id rp-4987774726example \
    --resource-arn arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example \
    --resource-properties "{\"priority\": 102}"
```
Output:  

```
{
    "ProfileResourceAssociation": {
        "CreationTime": 1710851216.613,
        "Id": "rpr-001913120a7example",
        "ModificationTime": 1710851216.613,
        "Name": "test-resource-association",
        "OwnerId": "123456789012",
        "ProfileId": "rp-4987774726example",
        "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example",
        "ResourceProperties": "{\"priority\":102}",
        "ResourceType": "FIREWALL_RULE_GROUP",
        "Status": "UPDATING",
        "StatusMessage": "Updating the Profile to DNS Firewall rule group association"
    }
}
```
+  Untuk detail API, lihat [AssociateResourceToProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/associate-resource-to-profile.html)di *Referensi AWS CLI Perintah*. 

### `create-profile`
<a name="route53profiles_CreateProfile_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`create-profile`.

**AWS CLI**  
**Untuk membuat Profil**  
`create-profile`Contoh berikut membuat Profil.  

```
aws route53profiles create-profile \
    --name test
```
Output:  

```
{
    "Profile": {
        "Arn": "arn:aws:route53profiles:us-east-1:123456789012:profile/rp-6ffe47d5example",
        "ClientToken": "2ca1a304-32b3-4f5f-bc4c-EXAMPLE11111",
        "CreationTime": 1710850903.578,
        "Id": "rp-6ffe47d5example",
        "ModificationTime": 1710850903.578,
        "Name": "test",
        "OwnerId": "123456789012",
        "ShareStatus": "NOT_SHARED",
        "Status": "COMPLETE",
        "StatusMessage": "Created Profile"
    }
}
```
+  Untuk detail API, lihat [CreateProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/create-profile.html)di *Referensi AWS CLI Perintah*. 

### `delete-profile`
<a name="route53profiles_DeleteProfile_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`delete-profile`.

**AWS CLI**  
**Untuk menghapus Profil**  
`delete-profile`Contoh berikut menghapus Profil.  

```
aws route53profiles delete-profile \
    --profile-id rp-6ffe47d5example
```
Output:  

```
{
    "Profile": {
        "Arn": "arn:aws:route53profiles:us-east-1:123456789012:profile/rp-6ffe47d5example",
        "ClientToken": "0a15fec0-05d9-4f78-bec0-EXAMPLE11111",
        "CreationTime": 1710850903.578,
        "Id": "rp-6ffe47d5example",
        "ModificationTime": 1710850903.578,
        "Name": "test",
        "OwnerId": "123456789012",
        "ShareStatus": "NOT_SHARED",
        "Status": "DELETED",
        "StatusMessage": "Deleted Profile"
    }
}
```
+  Untuk detail API, lihat [DeleteProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/delete-profile.html)di *Referensi AWS CLI Perintah*. 

### `disassociate-profile`
<a name="route53profiles_DisassociateProfile_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`disassociate-profile`.

**AWS CLI**  
**Untuk memisahkan Profil**  
`disassociate-profile`Contoh berikut memisahkan Profil dari VPC.  

```
aws route53profiles disassociate-profile \
    --profile-id rp-4987774726example \
    --resource-id vpc-0af3b96b3example
```
Output:  

```
{
    "ProfileAssociation": {
        "CreationTime": 1710851336.527,
        "Id": "rpassoc-489ce212fexample",
        "ModificationTime": 1710851401.362,
        "Name": "test-association",
        "OwnerId": "123456789012",
        "ProfileId": "rp-4987774726example",
        "ResourceId": "vpc-0af3b96b3example",
        "Status": "DELETING",
        "StatusMessage": "Deleting Profile Association"
    }
}
```
+  Untuk detail API, lihat [DisassociateProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/disassociate-profile.html)di *Referensi AWS CLI Perintah*. 

### `disassociate-resource-from-profile`
<a name="route53profiles_DisassociateResourceFromProfile_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`disassociate-resource-from-profile`.

**AWS CLI**  
**Untuk memisahkan sumber daya dari Profil**  
`disassociate-resource-from-profile`Contoh berikut memisahkan grup aturan DNS Firewall dari Profil.  

```
aws route53profiles disassociate-resource-from-profile \
    --profile-id rp-4987774726example \
    --resource-arn arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example
```
Output:  

```
{
    "ProfileResourceAssociation": {
        "CreationTime": 1710851216.613,
        "Id": "rpr-001913120a7example",
        "ModificationTime": 1710852624.36,
        "Name": "test-resource-association",
        "OwnerId": "123456789012",
        "ProfileId": "rp-4987774726example",
        "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example",
        "ResourceProperties": "{\"priority\":105}",
        "ResourceType": "FIREWALL_RULE_GROUP",
        "Status": "DELETING",
        "StatusMessage": "Deleting the Profile to DNS Firewall rule group association"
    }
}
```
+  Untuk detail API, lihat [DisassociateResourceFromProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/disassociate-resource-from-profile.html)di *Referensi AWS CLI Perintah*. 

### `get-profile-association`
<a name="route53profiles_GetProfileAssociation_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-profile-association`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang asosiasi Profil**  
Berikut ini `get-profile-association` mengembalikan informasi tentang asosiasi Profil tertentu.  

```
aws route53profiles get-profile-association \
    --profile-association-id rpassoc-489ce212fexample
```
Output:  

```
{
    "ProfileAssociation": {
        "CreationTime": 1709338817.148,
        "Id": "rrpassoc-489ce212fexample",
        "ModificationTime": 1709338974.772,
        "Name": "test-association",
        "OwnerId": "123456789012",
        "ProfileId": "rp-4987774726example",
        "ResourceId": "vpc-0af3b96b3example",
        "Status": "COMPLETE",
        "StatusMessage": "Created Profile Association"
    }
}
```
+  Untuk detail API, lihat [GetProfileAssociation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/get-profile-association.html)di *Referensi AWS CLI Perintah*. 

### `get-profile-resource-association`
<a name="route53profiles_GetProfileResourceAssociation_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-profile-resource-association`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang sumber daya yang terkait dengan Profil**  
Berikut ini `get-profile-resource-association` mengembalikan informasi tentang asosiasi sumber daya tertentu ke Profil.  

```
aws route53profiles get-profile-resource-association \
    --profile-resource-association-id rpr-001913120a7example
```
Output:  

```
{
    "ProfileResourceAssociation": {
        "CreationTime": 1710851216.613,
        "Id": "rpr-001913120a7example",
        "ModificationTime": 1710852303.798,
        "Name": "test-resource-association",
        "OwnerId": "123456789012",
        "ProfileId": "rp-4987774726example",
        "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example",
        "ResourceProperties": "{\"priority\":105}",
        "ResourceType": "FIREWALL_RULE_GROUP",
        "Status": "COMPLETE",
        "StatusMessage": "Completed creation of Profile to DNS Firewall rule group association"
    }
}
```
+  Untuk detail API, lihat [GetProfileResourceAssociation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/get-profile-resource-association.html)di *Referensi AWS CLI Perintah*. 

### `get-profile`
<a name="route53profiles_GetProfile_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`get-profile`.

**AWS CLI**  
**Untuk mendapatkan informasi tentang Profil**  
Berikut ini `get-profile` mengembalikan informasi tentang Profil yang ditentukan.  

```
aws route53profiles get-profile \
    --profile-id rp-4987774726example
```
Output:  

```
{
    "Profile": {
        "Arn": "arn:aws:route53profiles:us-east-1:123456789012:profile/rp-4987774726example",
        "ClientToken": "0cbc5ae7-4921-4204-bea9-EXAMPLE11111",
        "CreationTime": 1710851044.288,
        "Id": "rp-4987774726example",
        "ModificationTime": 1710851044.288,
        "Name": "test",
        "OwnerId": "123456789012",
        "ShareStatus": "NOT_SHARED",
        "Status": "COMPLETE",
        "StatusMessage": "Created Profile"
    }
}
```
+  Untuk detail API, lihat [GetProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/get-profile.html)di *Referensi AWS CLI Perintah*. 

### `list-profile-associations`
<a name="route53profiles_ListProfileAssociations_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-profile-associations`.

**AWS CLI**  
**Untuk daftar Asosiasi profil**  
Berikut ini `list-profile-associations` mencantumkan Asosiasi profil di AWS akun Anda.  

```
aws route53profiles list-profile-associations
```
Output:  

```
{
    "ProfileAssociations": [
        {
            "CreationTime": 1709338817.148,
            "Id": "rpassoc-489ce212fexample",
            "ModificationTime": 1709338974.772,
            "Name": "test-association",
            "OwnerId": "123456789012",
            "ProfileId": "rp-4987774726example",
            "ResourceId": "vpc-0af3b96b3example",
            "Status": "COMPLETE",
            "StatusMessage": "Created Profile Association"
        }
    ]
}
```
+  Untuk detail API, lihat [ListProfileAssociations](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/list-profile-associations.html)di *Referensi AWS CLI Perintah*. 

### `list-profile-resource-associations`
<a name="route53profiles_ListProfileResourceAssociations_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-profile-resource-associations`.

**AWS CLI**  
**Untuk daftar Asosiasi sumber daya Profil**  
Berikut ini `list-profile-resource-associations` mencantumkan Asosiasi sumber daya Profil untuk Profil yang ditentukan.  

```
aws route53profiles list-profile-resource-associations \
    --profile-id rp-4987774726example
```
Output:  

```
{
     "ProfileResourceAssociations": [
         {
             "CreationTime": 1710851216.613,
             "Id": "rpr-001913120a7example",
             "ModificationTime": 1710851216.613,
             "Name": "test-resource-association",
             "OwnerId": "123456789012",
             "ProfileId": "rp-4987774726example",
             "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example",
             "ResourceProperties": "{\"priority\":102}",
             "ResourceType": "FIREWALL_RULE_GROUP",
             "Status": "COMPLETE",
             "StatusMessage": "Completed creation of Profile to DNS Firewall rule group association"
         }
     ]
 }
```
+  Untuk detail API, lihat [ListProfileResourceAssociations](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/list-profile-resource-associations.html)di *Referensi AWS CLI Perintah*. 

### `list-profiles`
<a name="route53profiles_ListProfiles_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-profiles`.

**AWS CLI**  
**Untuk daftar Profil**  
Berikut ini `list-profiles` mencantumkan Profil di AWS akun Anda dan menampilkan informasi tambahan tentang mereka.  

```
aws route53profiles list-profiles
```
Output:  

```
{
     "ProfileSummaries": [
         {
             "Arn": "arn:aws:route53profiles:us-east-1:123456789012:profile/rp-4987774726example",
             "Id": "rp-4987774726example",
             "Name": "test",
             "ShareStatus": "NOT_SHARED"
         }
     ]
 }
```
+  Untuk detail API, lihat [ListProfiles](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/list-profiles.html)di *Referensi AWS CLI Perintah*. 

### `list-tags-for-resource`
<a name="route53profiles_ListTagsForResource_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`list-tags-for-resource`.

**AWS CLI**  
**Untuk membuat daftar tag untuk sumber daya**  
Berikut `list-tags-for-resource` daftar tag untuk sumber daya yang ditentukan.  

```
aws route53profiles list-tags-for-resource \
    --resource-arn arn:aws:route53profiles:us-east-1:123456789012:profile/rp-4987774726example
```
Output:  

```
{
    "Tags": {
        "my-key-2": "my-value-2",
        "my-key-1": "my-value-1"
    }
}
```
+  Untuk detail API, lihat [ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/list-tags-for-resource.html)di *Referensi AWS CLI Perintah*. 

### `update-profile-resource-association`
<a name="route53profiles_UpdateProfileResourceAssociation_cli_2_topic"></a>

Contoh kode berikut menunjukkan cara menggunakan`update-profile-resource-association`.

**AWS CLI**  
**Untuk memperbarui sumber daya yang terkait dengan Profil**  
Berikut ini `update-profile-resource-association` memperbarui prioritas grup aturan DNS Firewall yang terkait dengan Profil.  

```
aws route53profiles update-profile-resource-association \
    --profile-resource-association-id rpr-001913120a7example \
    --resource-properties "{\"priority\": 105}"
```
Output:  

```
{
    "ProfileResourceAssociation": {
        "CreationTime": 1710851216.613,
        "Id": "rpr-001913120a7example",
        "ModificationTime": 1710852303.798,
        "Name": "test-resource-association",
        "OwnerId": "123456789012",
        "ProfileId": "rp-4987774726example",
        "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example",
        "ResourceProperties": "{\"priority\":105}",
        "ResourceType": "FIREWALL_RULE_GROUP",
        "Status": "UPDATING",
        "StatusMessage": "Updating the Profile to DNS Firewall rule group association"
    }
}
```
+  Untuk detail API, lihat [UpdateProfileResourceAssociation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53profiles/update-profile-resource-association.html)di *Referensi AWS CLI Perintah*. 