Skip to content

Commit

Permalink
CLI examples for ec2, ecs, ivs-realtime, lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
elysahall committed Dec 30, 2024
1 parent bae9297 commit 982a9d3
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 23 deletions.
23 changes: 22 additions & 1 deletion awscli/examples/ec2/allocate-address.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,25 @@ Output::
"NetworkBorderGroup": "us-west-2",
}

For more information, see `Elastic IP addresses <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html>`__ in the *Amazon EC2 User Guide*.
For more information, see `Elastic IP addresses <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html>`__ in the *Amazon EC2 User Guide*.

**Example 4: To allocate an Elastic IP address from an IPAM pool**

The following ``allocate-address`` example allocates a specific /32 Elastic IP address from an Amazon VPC IP Address Manager (IPAM) pool. ::

aws ec2 allocate-address \
--region us-east-1 \
--ipam-pool-id ipam-pool-1234567890abcdef0 \
--address 192.0.2.0

Output::

{
"PublicIp": "192.0.2.0",
"AllocationId": "eipalloc-abcdef01234567890",
"PublicIpv4Pool": "ipam-pool-1234567890abcdef0",
"NetworkBorderGroup": "us-east-1",
"Domain": "vpc"
}

For more information, see `Allocate sequential Elastic IP addresses from an IPAM pool <https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-eip-pool.html>`__ in the *Amazon VPC IPAM User Guide*.
17 changes: 17 additions & 0 deletions awscli/examples/ecs/discover-poll-endpoint.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
**Get the endpoint for ECS agent for polling updates**

The following ``discover-poll-endpoint`` example returns the endpoint for the ECS agent to poll for the updates. You can pass container instance ID or full ARN of container instances. This example uses ID of the container instance. ::

aws ecs discover-poll-endpoint \
--container-instance d5f596ccb5794833b778c680c318ft78 \
--cluster-name MyCluster

Output::

{
"endpoint": "https://ecs-a-16.us-west-2.amazonaws.com/",
"telemetryEndpoint": "https://ecs-t-16.us-west-2.amazonaws.com/",
"serviceConnectEndpoint": "https://ecs-sc.us-west-2.api.aws"
}

For more information on Agent Endpoints, see `Create VPC Endpoints for Amazon ECS <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/vpc-endpoints.html#ecs-setting-up-vpc-create>`__ in the *Amazon ECS Developer Guide*.
9 changes: 9 additions & 0 deletions awscli/examples/ecs/wait/services-inactive.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**Wait until an ECS service becomes inactive**

The following ``service-inactive`` example waits until ECS services becomes inactive in the cluster. ::

aws ecs wait services-inactive \
--cluster MyCluster \
--services MyService

This command produces no output.
22 changes: 22 additions & 0 deletions awscli/examples/ecs/wait/task-stopped.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
**Example 1: Wait until an ECS task is in stopped state**

The following ``wait tasks-stopped`` example waits until the provided tasks in the command are in a stopped state. You can pass IDs or full ARN of the tasks. This example uses ID of the task. ::

aws ecs wait tasks-stopped \
--cluster MyCluster \
--tasks 2c196f0a00dd4f58b7c8897a5c7bce13

This command produces no output.

**Example 2: Wait until multiple ECS tasks are in stopped state**

The following ``wait tasks-stopped`` example waits until the multiple tasks provided in the command are in a stopped state. You can pass IDs or full ARN of the tasks. This example uses IDs of the tasks. ::

aws ecs wait tasks-stopped \
--cluster MyCluster \
--tasks 2c196f0a00dd4f58b7c8897a5c7bce13 4d590253bb114126b7afa7b58EXAMPLE

This command produces no output.



75 changes: 68 additions & 7 deletions awscli/examples/ivs-realtime/create-stage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,24 @@ Output::
"stage": {
"activeSessionId": "st-a1b2c3d4e5f6g",
"arn": "arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh",
"autoParticipantRecordingConfiguration": {
"storageConfigurationArn": "",
"mediaTypes": [
"AUDIO_VIDEO"
],
"thumbnailConfiguration": {
"targetIntervalSeconds": 60,
"storage": [
"SEQUENTIAL"
],
"recordingMode": "DISABLED"
}
},
"endpoints": {
"events": "wss://global.events.live-video.net",
"rtmp": "rtmp://9x0y8z7s6t5u.global-contribute-staging.live-video.net/app/",
"rtmps": "rtmps://9x0y8z7s6t5u.global-contribute-staging.live-video.net:443/app/",
"whip": "https://1a2b3c4d5e6f.global-bm.whip.live-video.net"
"whip": "https://9x0y8z7s6t5u.global-bm.whip.live-video.net"
},
"name": "stage1",
"tags": {}
Expand All @@ -47,20 +60,68 @@ Output::
"activeSessionId": "st-a1b2c3d4e5f6g",
"arn": "arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh",
"autoParticipantRecordingConfiguration": {
"mediaTypes": [
"AUDIO_VIDEO"
],
"storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh",
},
"storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh"
"mediaTypes": [
"AUDIO_VIDEO"
],
"thumbnailConfiguration": {
"targetIntervalSeconds": 60,
"storage": [
"SEQUENTIAL"
],
"recordingMode": "DISABLED"
}
},
"endpoints": {
"events": "wss://global.events.live-video.net",
"rtmp": "rtmp://9x0y8z7s6t5u.global-contribute-staging.live-video.net/app/",
"rtmps": "rtmps://9x0y8z7s6t5u.global-contribute-staging.live-video.net:443/app/",
"whip": "https://1a2b3c4d5e6f.global-bm.whip.live-video.net"
"whip": "https://9x0y8z7s6t5u.global-bm.whip.live-video.net"
},
"name": "stage1",
"tags": {}
}
}

For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream <https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/multiple-hosts.html>`__ in the *Amazon Interactive Video Service User Guide*.

**Example 3: To create a stage and configure individial participant recording with thumbnail recording enabled**

The following ``create-stage`` example creates a stage and configures individual participant recording with thumbnail recording enabled. ::

aws ivs-realtime create-stage \
--name stage1 \
--auto-participant-recording-configuration '{"mediaTypes": ["AUDIO_VIDEO"],"storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh", \
"thumbnailConfiguration": {"recordingMode": "INTERVAL","storage": ["SEQUENTIAL"],"targetIntervalSeconds": 60}}'

Output::

{
"stage": {
"activeSessionId": "st-a1b2c3d4e5f6g",
"arn": "arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh",
"autoParticipantRecordingConfiguration": {
"storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh",
"mediaTypes": [
"AUDIO_VIDEO"
],
"thumbnailConfiguration": {
"targetIntervalSeconds": 60,
"storage": [
"SEQUENTIAL"
],
"recordingMode": "INTERVAL"
}
},
"endpoints": {
"events": "wss://global.events.live-video.net",
"rtmp": "rtmp://9x0y8z7s6t5u.global-contribute-staging.live-video.net/app/",
"rtmps": "rtmps://9x0y8z7s6t5u.global-contribute-staging.live-video.net:443/app/",
"whip": "https://9x0y8z7s6t5u.global-bm.whip.live-video.net"
},
"name": "stage1",
"tags": {}
}
}

For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream <https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/multiple-hosts.html>`__ in the *Amazon Interactive Video Service User Guide*.
75 changes: 74 additions & 1 deletion awscli/examples/ivs-realtime/get-composition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Output::
"recordingConfiguration": {
"format": "HLS"
},
"storageConfigurationArn": "arn:arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE"
"storageConfigurationArn": "arn:arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE",
}
},
"detail": {
Expand Down Expand Up @@ -130,4 +130,77 @@ Output::
}
}

For more information, see `Composite Recording (Real-Time Streaming) <https://docs.aws.amazon.com/ivs/latest/RealTimeUserGuide/rt-composite-recording.html>`__ in the *Amazon Interactive Video Service User Guide*.

**Example 3: To get a composition with thumbnail recording enabled**

The following ``get-composition`` example gets the composition for the ARN (Amazon Resource Name) specified, which has thumbnail recording enabled with default settings. ::

aws ivs-realtime get-composition \
--arn "arn:aws:ivs:ap-northeast-1:123456789012:composition/abcdABCDefgh"

Output::

{
"composition": {
"arn": "arn:aws:ivs:ap-northeast-1:123456789012:composition/abcdABCDefgh",
"destinations": [
{
"configuration": {
"channel": {
"channelArn": "arn:aws:ivs:ap-northeast-1:123456789012:channel/abcABCdefDEg",
"encoderConfigurationArn": "arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef"
},
"name": ""
},
"id": "AabBCcdDEefF",
"startTime": "2023-10-16T23:26:00+00:00",
"state": "ACTIVE"
},
{
"configuration": {
"name": "",
"s3": {
"encoderConfigurationArns": [
"arn:aws:ivs:arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef"
],
"recordingConfiguration": {
"format": "HLS"
},
"storageConfigurationArn": "arn:arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE",
"thumbnailConfigurations": [
{
"targetIntervalSeconds": 60,
"storage": [
"SEQUENTIAL"
],
}
]
}
},
"detail": {
"s3": {
"recordingPrefix": "aBcDeFgHhGfE/AbCdEfGhHgFe/GHFabcgefABC/composite"
}
},
"id": "GHFabcgefABC",
"startTime": "2023-10-16T23:26:00+00:00",
"state": "STARTING"
}
],
"layout": {
"grid": {
"featuredParticipantAttribute": ""
"gridGap": 2,
"omitStoppedVideo": false,
"videoAspectRatio": "VIDEO",
"videoFillMode": "" }
},
"stageArn": "arn:aws:ivs:ap-northeast-1:123456789012:stage/defgABCDabcd",
"startTime": "2023-10-16T23:24:00+00:00",
"state": "ACTIVE",
"tags": {}
}
}

For more information, see `Composite Recording (Real-Time Streaming) <https://docs.aws.amazon.com/ivs/latest/RealTimeUserGuide/rt-composite-recording.html>`__ in the *Amazon Interactive Video Service User Guide*.
17 changes: 12 additions & 5 deletions awscli/examples/ivs-realtime/get-stage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,27 @@ Output::
"activeSessionId": "st-a1b2c3d4e5f6g",
"arn": "arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh",
"autoParticipantRecordingConfiguration": {
"storageConfigurationArn": "",
"mediaTypes": [
"AUDIO_VIDEO"
"AUDIO_VIDEO"
],
"storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh",
},
"thumbnailConfiguration": {
"targetIntervalSeconds": 60,
"storage": [
"SEQUENTIAL"
],
"recordingMode": "DISABLED",
}
},
"endpoints": {
"events": "wss://global.events.live-video.net",
"rtmp": "rtmp://9x0y8z7s6t5u.global-contribute-staging.live-video.net/app/",
"rtmps": "rtmps://9x0y8z7s6t5u.global-contribute-staging.live-video.net:443/app/",
"whip": "https://1a2b3c4d5e6f.global-bm.whip.live-video.net"
"whip": "https://9x0y8z7s6t5u.global-bm.whip.live-video.net"
},
"name": "test",
"tags": {}
}
}

For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream <https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/multiple-hosts.html>`__ in the *Amazon Interactive Video Service User Guide*.
For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream <https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/multiple-hosts.html>`__ in the *Amazon Interactive Video Service User Guide*.
77 changes: 77 additions & 0 deletions awscli/examples/ivs-realtime/start-composition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,81 @@ Output::
}
}

For more information, see `Composite Recording (Real-Time Streaming) <https://docs.aws.amazon.com/ivs/latest/RealTimeUserGuide/rt-composite-recording.html>`__ in the *Amazon Interactive Video Service User Guide*.

**Example 3: To start a composition with thubnail recording enabled**

The following ``start-composition`` example starts a composition for the specified stage to be streamed to the specified locations with thumbnail recording enabled. ::

aws ivs-realtime start-composition \
--stage-arn arn:aws:ivs:ap-northeast-1:123456789012:stage/defgABCDabcd \
--destinations '[{"channel": {"channelArn": "arn:aws:ivs:ap-northeast-1:123456789012:channel/abcABCdefDEg", \
"encoderConfigurationArn": "arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef"}}, \
{"s3": {"encoderConfigurationArns": ["arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef"], \
"storageConfigurationArn": "arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE", \
"thumbnailConfigurations": [{"storage": ["SEQUENTIAL"],"targetIntervalSeconds": 60}]}}]'

Output::

{
"composition": {
"arn": "arn:aws:ivs:ap-northeast-1:123456789012:composition/abcdABCDefgh",
"destinations": [
{
"configuration": {
"channel": {
"channelArn": "arn:aws:ivs:ap-northeast-1:123456789012:channel/abcABCdefDEg",
"encoderConfigurationArn": "arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef"
},
"name": ""
},
"id": "AabBCcdDEefF",
"state": "STARTING"
},
{
"configuration": {
"name": "",
"s3": {
"encoderConfigurationArns": [
"arn:aws:ivs:arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef"
],
"recordingConfiguration": {
"format": "HLS"
},
"storageConfigurationArn": "arn:arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE",
"thumbnailConfigurations": [
{
"targetIntervalSeconds": 60,
"storage": [
"SEQUENTIAL"
]
}
]
}
},
"detail": {
"s3": {
"recordingPrefix": "aBcDeFgHhGfE/AbCdEfGhHgFe/GHFabcgefABC/composite"
}
},
"id": "GHFabcgefABC",
"state": "STARTING"
}
],
"layout": {
"grid": {
"featuredParticipantAttribute": ""
"gridGap": 2,
"omitStoppedVideo": false,
"videoAspectRatio": "VIDEO",
"videoFillMode": ""
}
},
"stageArn": "arn:aws:ivs:ap-northeast-1:123456789012:stage/defgABCDabcd",
"startTime": "2023-10-16T23:24:00+00:00",
"state": "STARTING",
"tags": {}
}
}

For more information, see `Composite Recording (Real-Time Streaming) <https://docs.aws.amazon.com/ivs/latest/RealTimeUserGuide/rt-composite-recording.html>`__ in the *Amazon Interactive Video Service User Guide*.
Loading

0 comments on commit 982a9d3

Please sign in to comment.