Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
AWS AppConfig contoh menggunakan AWS CLI
Contoh kode berikut menunjukkan cara melakukan tindakan dan menerapkan skenario umum dengan menggunakan AWS Command Line Interface with AWS AppConfig.
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.
Topik
Tindakan
Contoh kode berikut menunjukkan cara menggunakancreate-application.
- AWS CLI
-
Untuk membuat aplikasi
create-applicationContoh berikut membuat aplikasi di AWS AppConfig.aws appconfig create-application \ --name"example-application"\ --description"An application used for creating an example."Output:
{ "Description": "An application used for creating an example.", "Id": "339ohji", "Name": "example-application" }Untuk informasi selengkapnya, lihat Langkah 1: Membuat AWS AppConfig aplikasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat CreateApplication
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakancreate-configuration-profile.
- AWS CLI
-
Untuk membuat profil konfigurasi
create-configuration-profileContoh berikut membuat profil konfigurasi menggunakan konfigurasi yang disimpan di Parameter Store, kemampuan Manajer Sistem.aws appconfig create-configuration-profile \ --application-id"339ohji"\ --name"Example-Configuration-Profile"\ --location-uri"ssm-parameter://Example-Parameter"\ --retrieval-role-arn"arn:aws:iam::111122223333:role/Example-App-Config-Role"Output:
{ "ApplicationId": "339ohji", "Description": null, "Id": "ur8hx2f", "LocationUri": "ssm-parameter://Example-Parameter", "Name": "Example-Configuration-Profile", "RetrievalRoleArn": "arn:aws:iam::111122223333:role/Example-App-Config-Role", "Type": null, "Validators": null }Untuk informasi selengkapnya, lihat Langkah 3: Membuat konfigurasi dan profil konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat CreateConfigurationProfile
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakancreate-environment.
- AWS CLI
-
Untuk menciptakan lingkungan
create-environmentContoh berikut membuat AWS AppConfig lingkungan bernama Example-Environment menggunakan aplikasi yang Anda buat menggunakan create-application.aws appconfig create-environment \ --application-id"339ohji"\ --name"Example-Environment"Output:
{ "ApplicationId": "339ohji", "Description": null, "Id": "54j1r29", "Monitors": null, "Name": "Example-Environment", "State": "ReadyForDeployment" }Untuk informasi selengkapnya, lihat Langkah 2: Membuat lingkungan di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat CreateEnvironment
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakancreate-extension-association.
- AWS CLI
-
Untuk membuat asosiasi ekstensi
create-extension-associationContoh berikut membuat asosiasi ekstensi baru di AWS AppConfig.aws appconfig create-extension-association \ --regionus-west-2\ --extension-identifierS3-backup-extension\ --resource-identifier"arn:aws:appconfig:us-west-2:123456789012:application/Finance"\ --parametersS3bucket=FinanceConfigurationBackupOutput:
{ "Id": "a1b2c3d4", "ExtensionArn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "ResourceArn": "arn:aws:appconfig:us-west-2:123456789012:application/Finance", "Parameters": { "S3bucket": "FinanceConfigurationBackup" }, "ExtensionVersionNumber": 1 }Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat CreateExtensionAssociation
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakancreate-extension.
- AWS CLI
-
Untuk membuat ekstensi
create-extensionContoh berikut membuat ekstensi baru di AWS AppConfig.aws appconfig create-extension \ --regionus-west-2\ --nameS3-backup-extension\ --actionsPRE_CREATE_HOSTED_CONFIGURATION_VERSION=[{Name=S3backup,Uri=arn:aws:lambda:us-west-2:123456789012:function:s3backupfunction,RoleArn=arn:aws:iam::123456789012:role/appconfigextensionrole}]\ --parametersS3bucket={Required=true}Output:
{ "Id": "1A2B3C4D", "Name": "S3-backup-extension", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2:123456789012:extension/1A2B3C4D/1", "Actions": { "PRE_CREATE_HOSTED_CONFIGURATION_VERSION": [ { "Name": "S3backup", "Uri": "arn:aws:lambda:us-west-2:123456789012:function:s3backupfunction", "RoleArn": "arn:aws:iam::123456789012:role/appconfigextensionrole" } ] }, "Parameters": { "S3bucket": { "Required": true } } }Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat CreateExtension
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakancreate-hosted-configuration-version.
- AWS CLI
-
Untuk membuat versi konfigurasi yang dihosting
create-hosted-configuration-versionContoh berikut membuat konfigurasi baru di penyimpanan konfigurasi yang di AWS AppConfig hosting. Konten konfigurasi harus dikonversi terlebih dahulu ke base64.aws appconfig create-hosted-configuration-version \ --application-id"339ohji"\ --configuration-profile-id"ur8hx2f"\ --contenteyAiTmFtZSI6ICJFeGFtcGxlQXBwbGljYXRpb24iLCAiSWQiOiBFeGFtcGxlSUQsICJSYW5rIjogNyB9\ --content-type"application/json"\configuration_version_output_fileIsi dari
configuration_version_output_file:{ "Name": "ExampleApplication", "Id": ExampleID, "Rank": 7 }Output:
{ "ApplicationId": "339ohji", "ConfigurationProfileId": "ur8hx2f", "VersionNumber": "1", "ContentType": "application/json" }Untuk informasi selengkapnya, lihat Tentang AWS AppConfig penyimpanan konfigurasi yang di hosting di Panduan AWS Pengguna Appconfig.
-
Untuk detail API, lihat CreateHostedConfigurationVersion
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakandelete-application.
- AWS CLI
-
Untuk menghapus aplikasi
delete-applicationContoh berikut menghapus aplikasi yang ditentukan.aws appconfig delete-application \ --application-id339ohjiPerintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Langkah 1: Membuat AWS AppConfig aplikasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat DeleteApplication
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakandelete-configuration-profile.
- AWS CLI
-
Untuk menghapus profil konfigurasi
delete-configuration-profileContoh berikut menghapus profil konfigurasi yang ditentukan.aws appconfig delete-configuration-profile \ --application-id339ohji\ --configuration-profile-idur8hx2fPerintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Langkah 3: Membuat konfigurasi dan profil konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat DeleteConfigurationProfile
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakandelete-deployment-strategy.
- AWS CLI
-
Untuk menghapus strategi penerapan
delete-deployment-strategyContoh berikut menghapus strategi penerapan yang ditentukan.aws appconfig delete-deployment-strategy \ --deployment-strategy-id1225qzkPerintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Langkah 4: Membuat strategi pener apan di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat DeleteDeploymentStrategy
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakandelete-environment.
- AWS CLI
-
Untuk menghapus lingkungan
delete-environmentContoh berikut menghapus lingkungan aplikasi yang ditentukan.aws appconfig delete-environment \ --application-id339ohji\ --environment-id54j1r29Perintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Langkah 2: Membuat lingkungan di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat DeleteEnvironment
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakandelete-extension-association.
- AWS CLI
-
Untuk menghapus asosiasi ekstensi
delete-extension-associationContoh berikut menghapus asosiasi ekstensi dari AWS AppConfig.aws appconfig delete-extension-association \ --regionus-west-2\ --extension-association-ida1b2c3d4Perintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat DeleteExtensionAssociation
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakandelete-extension.
- AWS CLI
-
Untuk menghapus ekstensi
delete-extensionContoh berikut menghapus ekstensi dari AWS AppConfig.aws appconfig delete-extension \ --regionus-west-2\ --extension-identifierS3-backup-extensionPerintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat DeleteExtension
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakandelete-hosted-configuration-version.
- AWS CLI
-
Untuk menghapus versi konfigurasi yang dihosting
delete-hosted-configuration-versionContoh berikut menghapus versi konfigurasi yang dihosting di penyimpanan konfigurasi yang AWS AppConfig dihosting.aws appconfig delete-hosted-configuration-version \ --application-id339ohji\ --configuration-profile-idur8hx2f\ --version-number1Output:: Perintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Langkah 3: Membuat konfigurasi dan profil konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat DeleteHostedConfigurationVersion
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-application.
- AWS CLI
-
Untuk membuat daftar detail aplikasi
get-applicationContoh berikut mencantumkan rincian aplikasi yang ditentukan.aws appconfig get-application \ --application-id339ohjiOutput:
{ "Description": "An application used for creating an example.", "Id": "339ohji", "Name": "example-application" }Untuk informasi selengkapnya, lihat Cara AWS AppConfig kerja di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat GetApplication
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-configuration-profile.
- AWS CLI
-
Untuk mengambil detail profil konfigurasi
get-configuration-profileContoh berikut mengembalikan detail profil konfigurasi yang ditentukan.aws appconfig get-configuration-profile \ --application-id339ohji\ --configuration-profile-idur8hx2fOutput:
{ "ApplicationId": "339ohji", "Id": "ur8hx2f", "Name": "Example-Configuration-Profile", "LocationUri": "ssm-parameter://Example-Parameter", "RetrievalRoleArn": "arn:aws:iam::111122223333:role/Example-App-Config-Role" }Untuk informasi selengkapnya, lihat Langkah 3: Membuat konfigurasi dan profil konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat GetConfigurationProfile
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-configuration.
- AWS CLI
-
Untuk mengambil detail konfigurasi
get-configurationContoh berikut mengembalikan detail konfigurasi aplikasi contoh. Pada panggilan berikutnya untuk get-configuration gunakanclient-configuration-versionparameter untuk hanya memperbarui konfigurasi aplikasi Anda jika versi telah berubah. Hanya memperbarui konfigurasi ketika versi telah berubah menghindari biaya berlebih yang dikeluarkan dengan memanggil get-configuration.aws appconfig get-configuration \ --application"example-application"\ --environment"Example-Environment"\ --configuration"Example-Configuration-Profile"\ --client-id"test-id"\configuration-output-fileIsi dari
configuration-output-file:{ "Name": "ExampleApplication", "Id": ExampleID, "Rank": 7 }Output:
{ "ConfigurationVersion": "1", "ContentType": "application/json" }Untuk informasi selengkapnya, lihat Langkah 6: Mener ima konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat GetConfiguration
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-deployment-strategy.
- AWS CLI
-
Untuk mengambil rincian strategi penerapan
get-deployment-strategyContoh berikut mencantumkan rincian strategi penerapan yang ditentukan.aws appconfig get-deployment-strategy \ --deployment-strategy-id1225qzkOutput:
{ "Id": "1225qzk", "Name": "Example-Deployment", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "ReplicateTo": "SSM_DOCUMENT" }Untuk informasi selengkapnya, lihat Langkah 4: Membuat strategi pener apan di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat GetDeploymentStrategy
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-deployment.
- AWS CLI
-
Untuk mengambil detail penerapan
get-deploymentContoh berikut mencantumkan rincian penerapan ke aplikasi di lingkungan dan penerapan yang ditentukan.aws appconfig get-deployment \ --application-id339ohji\ --environment-id54j1r29\ --deployment-number1Output:
{ "ApplicationId": "339ohji", "EnvironmentId": "54j1r29", "DeploymentStrategyId": "1225qzk", "ConfigurationProfileId": "ur8hx2f", "DeploymentNumber": 1, "ConfigurationName": "Example-Configuration-Profile", "ConfigurationLocationUri": "ssm-parameter://Example-Parameter", "ConfigurationVersion": "1", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "State": "COMPLETE", "EventLog": [ { "EventType": "DEPLOYMENT_COMPLETED", "TriggeredBy": "APPCONFIG", "Description": "Deployment completed", "OccurredAt": "2021-09-17T21:59:03.888000+00:00" }, { "EventType": "BAKE_TIME_STARTED", "TriggeredBy": "APPCONFIG", "Description": "Deployment bake time started", "OccurredAt": "2021-09-17T21:58:57.722000+00:00" }, { "EventType": "PERCENTAGE_UPDATED", "TriggeredBy": "APPCONFIG", "Description": "Configuration available to 100.00% of clients", "OccurredAt": "2021-09-17T21:55:56.816000+00:00" }, { "EventType": "PERCENTAGE_UPDATED", "TriggeredBy": "APPCONFIG", "Description": "Configuration available to 75.00% of clients", "OccurredAt": "2021-09-17T21:52:56.567000+00:00" }, { "EventType": "PERCENTAGE_UPDATED", "TriggeredBy": "APPCONFIG", "Description": "Configuration available to 50.00% of clients", "OccurredAt": "2021-09-17T21:49:55.737000+00:00" }, { "EventType": "PERCENTAGE_UPDATED", "TriggeredBy": "APPCONFIG", "Description": "Configuration available to 25.00% of clients", "OccurredAt": "2021-09-17T21:46:55.187000+00:00" }, { "EventType": "DEPLOYMENT_STARTED", "TriggeredBy": "USER", "Description": "Deployment started", "OccurredAt": "2021-09-17T21:43:54.205000+00:00" } ], "PercentageComplete": 100.0, "StartedAt": "2021-09-17T21:43:54.205000+00:00", "CompletedAt": "2021-09-17T21:59:03.888000+00:00" }Untuk informasi selengkapnya, lihat Langkah 5: Menyebarkan konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat GetDeployment
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-environment.
- AWS CLI
-
Untuk mengambil detail lingkungan
get-environmentContoh berikut mengembalikan detail dan keadaan lingkungan yang ditentukan.aws appconfig get-environment \ --application-id339ohji\ --environment-id54j1r29Output:
{ "ApplicationId": "339ohji", "Id": "54j1r29", "Name": "Example-Environment", "State": "ReadyForDeployment" }Untuk informasi selengkapnya, lihat Langkah 2: Membuat lingkungan di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat GetEnvironment
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-extension-association.
- AWS CLI
-
Untuk mendapatkan detail asosiasi ekstensi
get-extension-associationContoh berikut menampilkan informasi tentang asosiasi ekstensi.aws appconfig get-extension-association \ --regionus-west-2\ --extension-association-ida1b2c3d4Output:
{ "Id": "a1b2c3d4", "ExtensionArn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "ResourceArn": "arn:aws:appconfig:us-west-2:123456789012:application/Finance", "Parameters": { "S3bucket": "FinanceConfigurationBackup" }, "ExtensionVersionNumber": 1 }Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat GetExtensionAssociation
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-extension.
- AWS CLI
-
Untuk mendapatkan detail ekstensi
get-extensionContoh berikut menampilkan informasi tentang ekstensi.aws appconfig get-extension \ --regionus-west-2\ --extension-identifierS3-backup-extensionOutput:
{ "Id": "1A2B3C4D", "Name": "S3-backup-extension", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "Actions": { "PRE_CREATE_HOSTED_CONFIGURATION_VERSION": [ { "Name": "S3backup", "Uri": "arn:aws:lambda:us-west-2:123456789012:function:S3backupfunction", "RoleArn": "arn:aws:iam::123456789012:role/appconfigextensionrole" } ] }, "Parameters": { "S3bucket": { "Required": true } } }Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat GetExtension
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-hosted-configuration-version.
- AWS CLI
-
Untuk mengambil detail konfigurasi yang dihosting
get-hosted-configuration-versionContoh berikut mengambil detail konfigurasi konfigurasi yang di AWS AppConfig hosting.aws appconfig get-hosted-configuration-version \ --application-id339ohji\ --configuration-profile-idur8hx2f\ --version-number1\hosted-configuration-version-outputIsi dari
hosted-configuration-version-output:{ "Name": "ExampleApplication", "Id": ExampleID, "Rank": 7 }Output:
{ "ApplicationId": "339ohji", "ConfigurationProfileId": "ur8hx2f", "VersionNumber": "1", "ContentType": "application/json" }Untuk informasi selengkapnya, lihat Tentang AWS AppConfig penyimpanan konfigurasi yang dihosting di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat GetHostedConfigurationVersion
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-applications.
- AWS CLI
-
Untuk membuat daftar aplikasi yang tersedia
list-applicationsContoh berikut mencantumkan aplikasi yang tersedia di AWS akun Anda.aws appconfig list-applicationsOutput:
{ "Items": [ { "Id": "339ohji", "Name": "test-application", "Description": "An application used for creating an example." }, { "Id": "rwalwu7", "Name": "Test-Application" } ] }Untuk informasi selengkapnya, lihat Langkah 1: Membuat AWS AppConfig aplikasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ListApplications
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-configuration-profiles.
- AWS CLI
-
Untuk membuat daftar profil konfigurasi yang tersedia
list-configuration-profilesContoh berikut mencantumkan profil konfigurasi yang tersedia untuk aplikasi yang ditentukan.aws appconfig list-configuration-profiles \ --application-id339ohjiOutput:
{ "Items": [ { "ApplicationId": "339ohji", "Id": "ur8hx2f", "Name": "Example-Configuration-Profile", "LocationUri": "ssm-parameter://Example-Parameter" } ] }Untuk informasi selengkapnya, lihat Langkah 3: Membuat konfigurasi dan profil konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ListConfigurationProfiles
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-deployment-strategies.
- AWS CLI
-
Untuk membuat daftar strategi penerapan yang tersedia
list-deployment-strategiesContoh berikut mencantumkan strategi penerapan yang tersedia di AWS akun Anda.aws appconfig list-deployment-strategiesOutput:
{ "Items": [ { "Id": "1225qzk", "Name": "Example-Deployment", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "ReplicateTo": "SSM_DOCUMENT" }, { "Id": "AppConfig.AllAtOnce", "Name": "AppConfig.AllAtOnce", "Description": "Quick", "DeploymentDurationInMinutes": 0, "GrowthType": "LINEAR", "GrowthFactor": 100.0, "FinalBakeTimeInMinutes": 10, "ReplicateTo": "NONE" }, { "Id": "AppConfig.Linear50PercentEvery30Seconds", "Name": "AppConfig.Linear50PercentEvery30Seconds", "Description": "Test/Demo", "DeploymentDurationInMinutes": 1, "GrowthType": "LINEAR", "GrowthFactor": 50.0, "FinalBakeTimeInMinutes": 1, "ReplicateTo": "NONE" }, { "Id": "AppConfig.Canary10Percent20Minutes", "Name": "AppConfig.Canary10Percent20Minutes", "Description": "AWS Recommended", "DeploymentDurationInMinutes": 20, "GrowthType": "EXPONENTIAL", "GrowthFactor": 10.0, "FinalBakeTimeInMinutes": 10, "ReplicateTo": "NONE" } ] }Untuk informasi selengkapnya, lihat Langkah 4: Membuat strategi pener apan di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ListDeploymentStrategies
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-deployments.
- AWS CLI
-
Untuk membuat daftar penerapan yang tersedia
list-deploymentsContoh berikut mencantumkan penerapan yang tersedia di AWS akun Anda untuk aplikasi dan lingkungan yang ditentukan.aws appconfig list-deployments \ --application-id339ohji\ --environment-id54j1r29Output:
{ "Items": [ { "DeploymentNumber": 1, "ConfigurationName": "Example-Configuration-Profile", "ConfigurationVersion": "1", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "State": "COMPLETE", "PercentageComplete": 100.0, "StartedAt": "2021-09-17T21:43:54.205000+00:00", "CompletedAt": "2021-09-17T21:59:03.888000+00:00" } ] }Untuk informasi selengkapnya, lihat Langkah 5: Menyebarkan konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ListDeployments
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-environments.
- AWS CLI
-
Untuk membuat daftar lingkungan yang tersedia
list-environmentsContoh berikut mencantumkan lingkungan yang tersedia di AWS akun Anda untuk aplikasi yang ditentukan.aws appconfig list-environments \ --application-id339ohjiOutput:
{ "Items": [ { "ApplicationId": "339ohji", "Id": "54j1r29", "Name": "Example-Environment", "State": "ReadyForDeployment" } ] }Untuk informasi selengkapnya, lihat Langkah 2: Membuat lingkungan di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ListEnvironments
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-extension-associations.
- AWS CLI
-
Untuk membuat daftar semua asosiasi AWS AppConfig ekstensi di AWS akun Anda untuk Wil AWS ayah
list-extension-associationsContoh berikut mencantumkan semua asosiasi AWS AppConfig ekstensi untuk AWS akun saat ini di Wil AWS ayah tertentu.aws appconfig list-extension-associations \ --regionus-west-2Output:
{ "Items": [ { "Id": "a1b2c3d4", "ExtensionArn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "ResourceArn": "arn:aws:appconfig:us-west-2:123456789012:application/Finance" } ] }Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ListExtensionAssociations
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-extensions.
- AWS CLI
-
Untuk mencantumkan semua AWS AppConfig ekstensi di AWS akun Anda untuk Wil AWS ayah
list-extensionsContoh berikut mencantumkan semua AWS AppConfig ekstensi untuk AWS akun saat ini di Wil AWS ayah tertentu. Perintah mengembalikan ekstensi khusus dan AWS ditulis.aws appconfig list-extensions \ --regionus-west-2Output:
{ "Items": [ { "Id": "1A2B3C4D", "Name": "S3-backup-extension", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2:123456789012:extension/1A2B3C4D/1" }, { "Id": "AWS.AppConfig.FeatureFlags", "Name": "AppConfig Feature Flags Helper", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2::extension/AWS.AppConfig.FeatureFlags/1", "Description": "Validates AppConfig feature flag data automatically against a JSON schema that includes structure and constraints. Also transforms feature flag data prior to sending to the client. This extension is automatically associated to configuration profiles with type \"AWS.AppConfig.FeatureFlags\"." }, { "Id": "AWS.AppConfig.JiraIntegration", "Name": "AppConfig integration with Atlassian Jira", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2::extension/AWS.AppConfig.JiraIntegration/1", "Description": "Exports feature flag data from AWS AppConfig into Jira. The lifecycle of each feature flag in AppConfig is tracked in Jira as an individual issue. Customers can see in Jira when flags are updated, turned on or off. Works in conjunction with the AppConfig app in the Atlassian Marketplace and is automatically associated to configuration profiles configured within that app." }, { "Id": "AWS.AppConfig.DeploymentNotificationsToEventBridge", "Name": "AppConfig deployment events to Amazon EventBridge", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2::extension/AWS.AppConfig.DeploymentNotificationsToEventBridge/1", "Description": "Sends events to Amazon EventBridge when a deployment of configuration data in AppConfig is started, completed, or rolled back. Can be associated to the following resources in AppConfig: Application, Environment, Configuration Profile." }, { "Id": "AWS.AppConfig.DeploymentNotificationsToSqs", "Name": "AppConfig deployment events to Amazon SQS", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2::extension/AWS.AppConfig.DeploymentNotificationsToSqs/1", "Description": "Sends messages to the configured Amazon SQS queue when a deployment of configuration data in AppConfig is started, completed, or rolled back. Can be associated to the following resources in AppConfig: Application, Environment, Configuration Profile." }, { "Id": "AWS.AppConfig.DeploymentNotificationsToSns", "Name": "AppConfig deployment events to Amazon SNS", "VersionNumber": 1, "Description": "Sends events to the configured Amazon SNS topic when a deployment of configuration data in AppConfig is started, completed, or rolled back. Can be associated to the following resources in AppConfig: Application, Environment, Configuration Profile." } ] }Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ListExtensions
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-hosted-configuration-versions.
- AWS CLI
-
Untuk membuat daftar versi konfigurasi yang dihosting yang tersedia
list-hosted-configuration-versionsContoh berikut mencantumkan versi konfigurasi yang di AWS AppConfig hosting di penyimpanan konfigurasi yang dihosting untuk aplikasi dan profil konfigurasi yang ditentukan.aws appconfig list-hosted-configuration-versions \ --application-id339ohji\ --configuration-profile-idur8hx2fOutput:
{ "Items": [ { "ApplicationId": "339ohji", "ConfigurationProfileId": "ur8hx2f", "VersionNumber": 1, "ContentType": "application/json" } ] }Untuk informasi selengkapnya, lihat Tentang AWS AppConfig penyimpanan konfigurasi yang dihosting di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ListHostedConfigurationVersions
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-tags-for-resource.
- AWS CLI
-
Untuk membuat daftar tag aplikasi
list-tags-for-resourceContoh berikut mencantumkan tag dari aplikasi tertentu.aws appconfig list-tags-for-resource \ --resource-arnarn:aws:appconfig:us-east-1:682428703967:application/339ohjiOutput:
{ "Tags": { "group1": "1" } }Untuk informasi selengkapnya, lihat Langkah 1: Membuat AWS AppConfig aplikasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ListTagsForResource
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanstart-deployment.
- AWS CLI
-
Untuk memulai penyebaran konfigurasi
start-deploymentContoh berikut memulai penerapan ke aplikasi menggunakan lingkungan yang ditentukan, strategi penerapan, dan profil konfigurasi.aws appconfig start-deployment \ --application-id339ohji\ --environment-id54j1r29\ --deployment-strategy-id1225qzk\ --configuration-profile-idur8hx2f\ --configuration-version1Output:
{ "ApplicationId": "339ohji", "EnvironmentId": "54j1r29", "DeploymentStrategyId": "1225qzk", "ConfigurationProfileId": "ur8hx2f", "DeploymentNumber": 1, "ConfigurationName": "Example-Configuration-Profile", "ConfigurationLocationUri": "ssm-parameter://Example-Parameter", "ConfigurationVersion": "1", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 0, "State": "DEPLOYING", "EventLog": [ { "EventType": "DEPLOYMENT_STARTED", "TriggeredBy": "USER", "Description": "Deployment started", "OccurredAt": "2021-09-17T21:43:54.205000+00:00" } ], "PercentageComplete": 0.0, "StartedAt": "2021-09-17T21:43:54.205000+00:00" }Untuk informasi selengkapnya, lihat Langkah 5: Menyebarkan konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat StartDeployment
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanstop-deployment.
- AWS CLI
-
Untuk menghentikan penyebaran konfigurasi
stop-deploymentContoh berikut menghentikan penyebaran konfigurasi aplikasi ke lingkungan yang ditentukan.aws appconfig stop-deployment \ --application-id339ohji\ --environment-id54j1r29\ --deployment-number2Output:
{ "DeploymentNumber": 0, "DeploymentDurationInMinutes": 0, "GrowthFactor": 0.0, "FinalBakeTimeInMinutes": 0, "PercentageComplete": 0.0 }Untuk informasi selengkapnya, lihat Langkah 5: Menyebarkan konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat StopDeployment
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakantag-resource.
- AWS CLI
-
Untuk menandai aplikasi
tag-resourceContoh berikut menandai sumber daya aplikasi.aws appconfig tag-resource \ --resource-arnarn:aws:appconfig:us-east-1:682428703967:application/339ohji\ --tags '{"group1" : "1"}'Perintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Langkah 1: Membuat AWS AppConfig aplikasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat TagResource
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanuntag-resource.
- AWS CLI
-
Untuk menghapus tag dari aplikasi
untag-resourceContoh berikut menghapus tag group1 dari aplikasi yang ditentukan.aws appconfig untag-resource \ --resource-arnarn:aws:appconfig:us-east-1:111122223333:application/339ohji\ --tag-keys '["group1"]'Perintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Langkah 1: Membuat AWS AppConfig aplikasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat UntagResource
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanupdate-application.
- AWS CLI
-
Untuk memperbarui aplikasi
update-applicationContoh berikut memperbarui nama aplikasi yang ditentukan.aws appconfig update-application \ --application-id339ohji\ --name"Example-Application"Output:
{ "Id": "339ohji", "Name": "Example-Application", "Description": "An application used for creating an example." }Untuk informasi selengkapnya, lihat Langkah 1: Membuat AWS AppConfig aplikasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat UpdateApplication
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanupdate-configuration-profile.
- AWS CLI
-
Untuk memperbarui profil konfigurasi
update-configuration-profileContoh berikut memperbarui deskripsi profil konfigurasi yang ditentukan.aws appconfig update-configuration-profile \ --application-id339ohji\ --configuration-profile-idur8hx2f\ --description"Configuration profile used for examples."Output:
{ "ApplicationId": "339ohji", "Id": "ur8hx2f", "Name": "Example-Configuration-Profile", "Description": "Configuration profile used for examples.", "LocationUri": "ssm-parameter://Example-Parameter", "RetrievalRoleArn": "arn:aws:iam::111122223333:role/Example-App-Config-Role" }Untuk informasi selengkapnya, lihat Langkah 3: Membuat konfigurasi dan profil konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat UpdateConfigurationProfile
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanupdate-deployment-strategy.
- AWS CLI
-
Untuk memperbarui strategi penerapan
update-deployment-strategyContoh berikut memperbarui waktu memanggang akhir menjadi 20 menit dalam strategi penerapan yang ditentukan.aws appconfig update-deployment-strategy \ --deployment-strategy-id1225qzk\ --final-bake-time-in-minutes20Output:
{ "Id": "1225qzk", "Name": "Example-Deployment", "DeploymentDurationInMinutes": 15, "GrowthType": "LINEAR", "GrowthFactor": 25.0, "FinalBakeTimeInMinutes": 20, "ReplicateTo": "SSM_DOCUMENT" }Untuk informasi selengkapnya, lihat Langkah 4: Membuat strategi pener apan di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat UpdateDeploymentStrategy
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanupdate-environment.
- AWS CLI
-
Untuk memperbarui lingkungan
update-environmentContoh berikut memperbarui deskripsi lingkungan.aws appconfig update-environment \ --application-id339ohji\ --environment-id54j1r29\ --description"An environment for examples."Output:
{ "ApplicationId": "339ohji", "Id": "54j1r29", "Name": "Example-Environment", "Description": "An environment for examples.", "State": "RolledBack" }Untuk informasi selengkapnya, lihat Langkah 2: Membuat lingkungan di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat UpdateEnvironment
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanupdate-extension-association.
- AWS CLI
-
Untuk memperbarui asosiasi AWS AppConfig ekstensi
update-extension-associationContoh berikut menambahkan nilai parameter baru ke asosiasi ekstensi di AWS AppConfig.aws appconfig update-extension-association \ --regionus-west-2\ --extension-association-ida1b2c3d4\ --parametersS3bucket=FinanceMobileAppOutput:
{ "Id": "a1b2c3d4", "ExtensionArn": "arn:aws:appconfig:us-west-2:123456789012:extension/S3-backup-extension/1", "ResourceArn": "arn:aws:appconfig:us-west-2:123456789012:application/Finance", "Parameters": { "S3bucket": "FinanceMobileApp" }, "ExtensionVersionNumber": 1 }Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat UpdateExtensionAssociation
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanupdate-extension.
- AWS CLI
-
Untuk memperbarui AWS AppConfig ekstensi
update-extensionContoh berikut menambahkan parameter tambahan Kunci ke ekstensi di AWS AppConfig.aws appconfig update-extension \ --regionus-west-2\ --extension-identifierS3-backup-extension\ --parametersS3bucket={Required=true},CampaignID={Required=false}Output:
{ "Id": "1A2B3C4D", "Name": "S3-backup-extension", "VersionNumber": 1, "Arn": "arn:aws:appconfig:us-west-2:123456789012:extension/1A2B3C4D/1", "Actions": { "PRE_CREATE_HOSTED_CONFIGURATION_VERSION": [ { "Name": "S3backup", "Uri": "arn:aws:lambda:us-west-2:123456789012:function:S3backupfunction", "RoleArn": "arn:aws:iam::123456789012:role/appconfigextensionrole" } ] }, "Parameters": { "CampaignID": { "Required": false }, "S3bucket": { "Required": true } } }Untuk informasi selengkapnya, lihat Bekerja dengan AWS AppConfig ekstensi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat UpdateExtension
di Refer AWS CLI ensi Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanvalidate-configuration.
- AWS CLI
-
Untuk memvalidasi konfigurasi
validate-configurationContoh berikut menggunakan validator dalam profil konfigurasi untuk memvalidasi konfigurasi.aws appconfig validate-configuration \ --application-idabc1234\ --configuration-profile-idur8hx2f\ --configuration-version1Perintah tidak menghasilkan output.
Untuk informasi selengkapnya, lihat Langkah 3: Membuat konfigurasi dan profil konfigurasi di Panduan AWS AppConfig Pengguna.
-
Untuk detail API, lihat ValidateConfiguration
di Refer AWS CLI ensi Perintah.
-