Skip to content

Commit cbfaa13

Browse files
authored
PHP: KMS Basics Scenario follow for PHP (#6965)
PHP: KMS Basics follow
1 parent 7714007 commit cbfaa13

File tree

14 files changed

+4083
-219
lines changed

14 files changed

+4083
-219
lines changed

.doc_gen/metadata/kms_metadata.yaml

+178-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# zexi 0.4.0
22
kms_Hello:
3-
title: Hello &kms-key;
4-
title_abbrev: Hello &kms-key;
5-
synopsis: get started using &kms-key;.
3+
title: Hello &KMSlong;
4+
title_abbrev: Hello &KMS;
5+
synopsis: get started using &KMSlong;.
66
category: Hello
77
languages:
88
Java:
@@ -14,8 +14,17 @@ kms_Hello:
1414
- description:
1515
snippet_tags:
1616
- kms.java2_list_keys.main
17+
PHP:
18+
versions:
19+
- sdk_version: 3
20+
github: php/example_code/kms
21+
sdkguide:
22+
excerpts:
23+
- description:
24+
snippet_tags:
25+
- php.example_code.kms.basics.helloService
1726
services:
18-
kms: {listKeysPaginator}
27+
kms: {ListKeys}
1928
kms_TagResource:
2029
languages:
2130
Java:
@@ -27,6 +36,15 @@ kms_TagResource:
2736
- description:
2837
snippet_tags:
2938
- kms.java2_tag.main
39+
PHP:
40+
versions:
41+
- sdk_version: 3
42+
github: php/example_code/kms
43+
sdkguide:
44+
excerpts:
45+
- description:
46+
snippet_tags:
47+
- php.example_code.kms.service.tagResource
3048
services:
3149
kms: {TagResource}
3250
kms_Sign:
@@ -40,6 +58,15 @@ kms_Sign:
4058
- description:
4159
snippet_tags:
4260
- kms.java2_sign.main
61+
PHP:
62+
versions:
63+
- sdk_version: 3
64+
github: php/example_code/kms
65+
sdkguide:
66+
excerpts:
67+
- description:
68+
snippet_tags:
69+
- php.example_code.kms.service.sign
4370
services:
4471
kms: {Sign}
4572
kms_CreateKey:
@@ -62,6 +89,15 @@ kms_CreateKey:
6289
- description:
6390
snippet_tags:
6491
- kms.java2_create_key.main
92+
PHP:
93+
versions:
94+
- sdk_version: 3
95+
github: php/example_code/kms
96+
sdkguide:
97+
excerpts:
98+
- description:
99+
snippet_tags:
100+
- php.example_code.kms.service.createKey
65101
Python:
66102
versions:
67103
- sdk_version: 3
@@ -118,6 +154,15 @@ kms_Decrypt:
118154
- description:
119155
snippet_tags:
120156
- kms.java2_decrypt_data.main
157+
PHP:
158+
versions:
159+
- sdk_version: 3
160+
github: php/example_code/kms
161+
sdkguide:
162+
excerpts:
163+
- description:
164+
snippet_tags:
165+
- php.example_code.kms.service.decrypt
121166
Python:
122167
versions:
123168
- sdk_version: 3
@@ -165,6 +210,15 @@ kms_Encrypt:
165210
- description:
166211
snippet_tags:
167212
- kms.java2_encrypt_data.main
213+
PHP:
214+
versions:
215+
- sdk_version: 3
216+
github: php/example_code/kms
217+
sdkguide:
218+
excerpts:
219+
- description:
220+
snippet_tags:
221+
- php.example_code.kms.service.encrypt
168222
Python:
169223
versions:
170224
- sdk_version: 3
@@ -266,6 +320,15 @@ kms_ListKeys:
266320
- description:
267321
snippet_tags:
268322
- KMS.dotnetv3.ListKeysExample
323+
PHP:
324+
versions:
325+
- sdk_version: 3
326+
github: php/example_code/kms
327+
sdkguide:
328+
excerpts:
329+
- description:
330+
snippet_tags:
331+
- php.example_code.kms.service.listKeys
269332
Python:
270333
versions:
271334
- sdk_version: 3
@@ -343,6 +406,15 @@ kms_CreateAlias:
343406
- description:
344407
snippet_tags:
345408
- kms.dotnetv3.CreateAliasExample
409+
PHP:
410+
versions:
411+
- sdk_version: 3
412+
github: php/example_code/kms
413+
sdkguide:
414+
excerpts:
415+
- description:
416+
snippet_tags:
417+
- php.example_code.kms.service.createAlias
346418
Python:
347419
versions:
348420
- sdk_version: 3
@@ -383,6 +455,15 @@ kms_CreateGrant:
383455
- description:
384456
snippet_tags:
385457
- KMS.dotnetv3.CreateGrantExample
458+
PHP:
459+
versions:
460+
- sdk_version: 3
461+
github: php/example_code/kms
462+
sdkguide:
463+
excerpts:
464+
- description:
465+
snippet_tags:
466+
- php.example_code.kms.service.createGrant
386467
Python:
387468
versions:
388469
- sdk_version: 3
@@ -423,6 +504,15 @@ kms_DescribeKey:
423504
- description:
424505
snippet_tags:
425506
- KMS.dotnetv3.DescribeKeyExample
507+
PHP:
508+
versions:
509+
- sdk_version: 3
510+
github: php/example_code/kms
511+
sdkguide:
512+
excerpts:
513+
- description:
514+
snippet_tags:
515+
- php.example_code.kms.service.describeKey
426516
Python:
427517
versions:
428518
- sdk_version: 3
@@ -463,6 +553,15 @@ kms_DisableKey:
463553
- description:
464554
snippet_tags:
465555
- KMS.dotnetv3.DisableKeyExample
556+
PHP:
557+
versions:
558+
- sdk_version: 3
559+
github: php/example_code/kms
560+
sdkguide:
561+
excerpts:
562+
- description:
563+
snippet_tags:
564+
- php.example_code.kms.service.disableKey
466565
Python:
467566
versions:
468567
- sdk_version: 3
@@ -503,6 +602,15 @@ kms_EnableKey:
503602
- description:
504603
snippet_tags:
505604
- KMS.dotnetv3.EnableKeyExample
605+
PHP:
606+
versions:
607+
- sdk_version: 3
608+
github: php/example_code/kms
609+
sdkguide:
610+
excerpts:
611+
- description:
612+
snippet_tags:
613+
- php.example_code.kms.service.enableKey
506614
Python:
507615
versions:
508616
- sdk_version: 3
@@ -525,6 +633,15 @@ kms_ScheduleKeyDeletion:
525633
- description:
526634
snippet_tags:
527635
- kms.java2_delete_key.main
636+
PHP:
637+
versions:
638+
- sdk_version: 3
639+
github: php/example_code/kms
640+
sdkguide:
641+
excerpts:
642+
- description:
643+
snippet_tags:
644+
- php.example_code.kms.service.scheduleKeyDeletion
528645
Python:
529646
versions:
530647
- sdk_version: 3
@@ -566,6 +683,15 @@ kms_ListAliases:
566683
- description:
567684
snippet_tags:
568685
- KMS.dotnetv3.ListAliasesExample
686+
PHP:
687+
versions:
688+
- sdk_version: 3
689+
github: php/example_code/kms
690+
sdkguide:
691+
excerpts:
692+
- description:
693+
snippet_tags:
694+
- php.example_code.kms.service.listAliases
569695
Python:
570696
versions:
571697
- sdk_version: 3
@@ -602,6 +728,15 @@ kms_DeleteAlias:
602728
- description:
603729
snippet_tags:
604730
- kms.java2_delete_alias.main
731+
PHP:
732+
versions:
733+
- sdk_version: 3
734+
github: php/example_code/kms
735+
sdkguide:
736+
excerpts:
737+
- description:
738+
snippet_tags:
739+
- php.example_code.kms.service.deleteAlias
605740
Python:
606741
versions:
607742
- sdk_version: 3
@@ -643,6 +778,15 @@ kms_ListGrants:
643778
- description:
644779
snippet_tags:
645780
- KMS.dotnetv3.ListGrantsExample
781+
PHP:
782+
versions:
783+
- sdk_version: 3
784+
github: php/example_code/kms
785+
sdkguide:
786+
excerpts:
787+
- description:
788+
snippet_tags:
789+
- php.example_code.kms.service.listGrants
646790
Python:
647791
versions:
648792
- sdk_version: 3
@@ -679,6 +823,15 @@ kms_RevokeGrant:
679823
- description:
680824
snippet_tags:
681825
- kms.java2_revoke_grant.main
826+
PHP:
827+
versions:
828+
- sdk_version: 3
829+
github: php/example_code/kms
830+
sdkguide:
831+
excerpts:
832+
- description:
833+
snippet_tags:
834+
- php.example_code.kms.service.revokeGrant
682835
Python:
683836
versions:
684837
- sdk_version: 3
@@ -730,6 +883,15 @@ kms_GetKeyPolicy:
730883
kms: {GetKeyPolicy}
731884
kms_PutKeyPolicy:
732885
languages:
886+
PHP:
887+
versions:
888+
- sdk_version: 3
889+
github: php/example_code/kms
890+
sdkguide:
891+
excerpts:
892+
- description:
893+
snippet_tags:
894+
- php.example_code.kms.service.putKeyPolicy
733895
Python:
734896
versions:
735897
- sdk_version: 3
@@ -743,7 +905,7 @@ kms_PutKeyPolicy:
743905
services:
744906
kms: {PutKeyPolicy}
745907
kms_Scenario_KeyEncryption:
746-
title: Encrypt and decrypt text with &kms-keys-long; using an &AWS; SDK
908+
title: Encrypt and decrypt text with &KMSlong; using an &AWS; SDK
747909
title_abbrev: Encrypt and decrypt text
748910
synopsis_list:
749911
- Encrypt plain text by using a &kms-key;.
@@ -785,8 +947,6 @@ kms_Scenario_KeyManagement:
785947
services:
786948
kms: {CreateKey, ListKeys, DescribeKey, GenerateDataKey, EnableKey, DisableKey, ScheduleKeyDeletion}
787949
kms_Scenario_Basics:
788-
title: Learn core operations for &kms-key; using an &AWS; SDK
789-
title_abbrev: Learn &kms-key; core operations
790950
synopsis_list:
791951
- Create a &kms-key;.
792952
- List &kms-keys; for your account and get details about them.
@@ -809,6 +969,15 @@ kms_Scenario_Basics:
809969
- description: Define a class that wraps KMS actions.
810970
snippet_tags:
811971
- kms.java2_actions.main
972+
PHP:
973+
versions:
974+
- sdk_version: 3
975+
github: php/example_code/kms
976+
sdkguide:
977+
excerpts:
978+
- description:
979+
snippet_tags:
980+
- php.example_code.kms.Basics
981+
- php.example_code.kms.service.KmsService
812982
services:
813-
kms: {CreateKey, ListKeys, DescribeKey, GenerateDataKey, EnableKey, Sign, DisableKey, ScheduleKeyDeletion}
814-
983+
kms: {CreateKey, Decrypt, Encrypt, ListAliases, CreateAlias, CreateGrant, DescribeKey, DisableKey, EnableKey, ListKeys, ListGrants, GetKeyPolicy, RevokeGrant, ListGrants, ScheduleKeyDeletion, TagResource, Sign}

javav2/example_code/kms/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav
3131

3232
### Get started
3333

34-
- [Hello KMS key](src/main/java/com/example/kms/HelloKMS.java#L6) (`listKeysPaginator`)
34+
- [Hello AWS KMS](src/main/java/com/example/kms/HelloKMS.java#L6) (`ListKeys`)
3535

3636

3737
### Basics
3838

3939
Code examples that show you how to perform the essential operations within a service.
4040

41-
- [Learn KMS key core operations](src/main/java/com/example/kms/scenario/KMSScenario.java)
41+
- [Learn the basics](src/main/java/com/example/kms/scenario/KMSScenario.java)
4242

4343

4444
### Single actions
@@ -75,12 +75,12 @@ Code excerpts that show you how to call individual service functions.
7575
<!--custom.instructions.start-->
7676
<!--custom.instructions.end-->
7777

78-
#### Hello KMS key
78+
#### Hello AWS KMS
7979

80-
This example shows you how to get started using KMS key.
80+
This example shows you how to get started using AWS Key Management Service (AWS KMS).
8181

8282

83-
#### Learn KMS key core operations
83+
#### Learn the basics
8484

8585
This example shows you how to do the following:
8686

php/composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"require": {
33
"aws/aws-sdk-php": "^3.209",
4-
"ext-zip": "*"
4+
"ext-zip": "*",
5+
"ext-readline": "*"
56
},
67
"require-dev": {
78
"phpunit/phpunit": "^9.5",

php/example_code/composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"DynamoDb\\PartiQL_Basics\\": "dynamodb/partiql_basics",
2424
"Glue\\": "glue/",
2525
"Iam\\": "iam/",
26+
"Kms\\": "kms/",
2627
"Lambda\\": "lambda/",
2728
"S3\\": "s3/"
2829
},

0 commit comments

Comments
 (0)