Skip to content

Commit

Permalink
Add Kotlin EC2 Scenario (awsdocs#3956)
Browse files Browse the repository at this point in the history
* Update Readme.md

* Add files via upload

* Update Readme.md

* Update Readme.md

* Add files via upload

* Update ec2_metadata.yaml

* Add files via upload

* Update ec2_metadata.yaml

* Update ec2_metadata.yaml

* Add files via upload

* Create EC2Test.kt

* Create config.properties

* Update Readme.md

* Update Readme.md

* Update Readme.md

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Update ec2_metadata.yaml

* Add files via upload

* Update Readme.md

* Add files via upload

* Add files via upload

* Update Readme.md

* Update Readme.md

* Add files via upload

* Add files via upload

* Update config.properties

* Update Readme.md

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Update config.properties

* Delete EC2Test.kt

* Add files via upload

* Add files via upload

* Update ec2_metadata.yaml

* Update EC2Scenario.kt

* Update ec2_metadata.yaml

* Update EC2Scenario.kt

* Add files via upload

* Delete EC2Scenario.kt

* Update EC2Scenario.kt

* Update ec2_metadata.yaml

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

Co-authored-by: Steven Meyer <[email protected]>
  • Loading branch information
scmacdon and meyertst-aws authored Nov 21, 2022
1 parent 3919380 commit 1a411a7
Show file tree
Hide file tree
Showing 12 changed files with 1,419 additions and 184 deletions.
189 changes: 189 additions & 0 deletions .doc_gen/metadata/ec2_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ ec2_Hello:
synopsis: get started using &EC2long; (&EC2;).
category: Hello
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.describe_security_groups.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -39,6 +48,15 @@ ec2_CreateKeyPair:
- description:
snippet_tags:
- EC2.dotnetv3.CreateKeyPairExample
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.create_key_pair.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -74,6 +92,24 @@ ec2_DescribeKeyPairs:
synopsis: list &EC2; security key pairs.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.describe_key_pairs.main
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.java2.describe_key_pairs.main
Python:
versions:
- sdk_version: 3
Expand Down Expand Up @@ -110,6 +146,15 @@ ec2_CreateSecurityGroup:
- description:
snippet_tags:
- EC2.dotnetv3.CreateSecurityGroupExample
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.create_security_group.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -145,6 +190,15 @@ ec2_RunInstances:
synopsis: create and run an &EC2; instance.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.create_instance.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -206,6 +260,15 @@ ec2_StartInstances:
- description:
snippet_tags:
- EC2.dotnetv3.StartInstancesExample
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.scenario.start_instance.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -258,6 +321,15 @@ ec2_StopInstances:
- description:
snippet_tags:
- EC2.dotnetv3.StopInstancesExample
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.scenario.stop_instance.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -301,6 +373,15 @@ ec2_AllocateAddress:
synopsis: allocate an Elastic IP address for &EC2;.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.allocate_address.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -336,6 +417,15 @@ ec2_AssociateAddress:
synopsis: associate an Elastic IP address with an &EC2; instance.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.associate_address.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -371,6 +461,15 @@ ec2_DisassociateAddress:
synopsis: disassociate an Elastic IP address from an &EC2; instance.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.scenario.disassociate_address.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -398,6 +497,15 @@ ec2_ReleaseAddress:
synopsis: release an Elastic IP address.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.scenario.release.address.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -433,6 +541,24 @@ ec2_AuthorizeSecurityGroupIngress:
synopsis: set inbound rules for an &EC2; security group.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.scenario_inbound_rule.main
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.java.scenario_inbound_rule.main
Python:
versions:
- sdk_version: 3
Expand All @@ -451,6 +577,15 @@ ec2_DeleteKeyPair:
synopsis: delete an &EC2; security key pair.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.delete_key_pair.main
.NET:
versions:
- sdk_version: 3
Expand Down Expand Up @@ -495,6 +630,15 @@ ec2_DescribeSecurityGroups:
synopsis: get data about an &EC2; security group.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.describe_security_groups.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -539,6 +683,15 @@ ec2_DeleteSecurityGroup:
- description:
snippet_tags:
- EC2.dotnetv3.DeleteSecurityGroupExample
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.delete_security_group.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -609,6 +762,15 @@ ec2_TerminateInstances:
synopsis: terminate an &EC2; instance.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.terminate_instance.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -636,6 +798,15 @@ ec2_DescribeInstances:
synopsis: describe &EC2; instances.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.describe_instances.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -819,6 +990,15 @@ ec2_DescribeInstanceTypes:
synopsis: get data about &EC2; instance types.
category:
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.describe_instance_type.main
Java:
versions:
- sdk_version: 2
Expand Down Expand Up @@ -890,6 +1070,15 @@ ec2_Scenario_GetStartedInstances:
- Clean up all of the resources created by this example.
category: Scenarios
languages:
Kotlin:
versions:
- sdk_version: 1
github: kotlin/services/ec2
sdkguide:
excerpts:
- description:
snippet_tags:
- ec2.kotlin.scenario.main
Java:
versions:
- sdk_version: 2
Expand Down
13 changes: 6 additions & 7 deletions javav2/example_code/ec2/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Code excerpts that show you how to call individual service functions.

Code examples that show you how to accomplish a specific task by calling multiple functions within the same service.

- [Get started with Amazon EC2 instances](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/javav2/example_code/support/src/main/javav2/example_code/ec2/src/main/java/com/example/ec2/EC2Scenario.java) (Multiple commands)
- [Get started with Amazon EC2 instances](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/javav2/example_code/ec2/src/main/java/com/example/ec2/EC2Scenario.java) (Multiple commands)

## Run the Amazon EC2 Java files

Expand Down Expand Up @@ -79,12 +79,11 @@ Define these values to successfully run the JUnit tests:
- **groupName** – A group name to use. For example, **TestSecGroup**.
- **groupDesc** – A description of the group. For example, **Test Group**.
- **vpcId** – A VPC ID. You can obtain this value from the AWS Management Console.

- **keyNameSc** - A key pair to use in the scenatio test.
- **fileNameSc** - A file name where the key information is written to and used in the scenatio test.
- **groupNameSc** - A group name that is used in the scenatio test.
- **groupDescSc** - A group name description that is used in the scenatio test.
- **vpcIdSc** – A VPC ID that is used in the scenatio test.
- **keyNameSc** - A key pair to use in the scenario test.
- **fileNameSc** - A file name where the key information is written to and used in the scenario test.
- **groupNameSc** - A group name that is used in the scenario test.
- **groupDescSc** - A group name description that is used in the scenario test.
- **vpcIdSc** – A VPC ID that is used in the scenario test.

### Command line
To run the JUnit tests from the command line, you can use the following command.
Expand Down
Loading

0 comments on commit 1a411a7

Please sign in to comment.