- Access to AWS Account with permission to create IAM role, Lambda, API Gateway, S3, and Cloudformation.
- AWS CLI Version 2
- AWS SAM CLI
- AWS-SDK-JS version 2.714.0 or greater for IVS support
Before you start, run below command to make sure you're in the correct AWS account and configured.
aws configure
For additional help on configuring, please see https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
Navigate up two directories to /serverless
. Run the following command to
create an S3 bucket.
- Replace
<my-bucket-name>
with your bucket name. - Replace
<my-region>
with your region name.
aws s3api create-bucket --bucket <my-bucket-name> --region <my-region> \
--create-bucket-configuration LocationConstraint=<my-region>
sam package \
--template-file template.yaml \
--output-template-file packaged.yaml \
--s3-bucket <my-bucket-name>
DO NOT run the output from above command, and proceed to the next step.
Replace <my-stack-name>
with your stack name.
sam deploy \
--template-file packaged.yaml \
--stack-name <my-stack-name> \
--capabilities CAPABILITY_IAM
On completion, copy the value of ApiURL
as you will need it later for
your client.
ApiURL example:
https://xxxxxxxxxx.execute-api.us-west-2.amazonaws.com/Prod/
If you need to retrieve the CloudFormation stack outputs again, run the following command:
aws cloudformation describe-stacks \
--stack-name <my-stack-name> --query 'Stacks[].Outputs'
Run the following command to create an Amazon IVS Channel for testing. You
can skip this step if you already have one or more channels in your
account. Note: by default, this will create a "Standard" channel type.
If you choose to create a "Basic" channel instead, you will need to modify
the Broadcast.jsx
component in the ui
project to account for this.
Replace <my-channel-name>
with a channel name.
aws ivs create-channel --name <my-channel-name>
Go to the ui directory for instructions on running the client application.
- Delete Cloudformation stack:
aws cloudformation delete-stack --stack-name <my-stack-name>
- Remove files in S3 bucket
aws s3 rm s3://<my-bucket-name> --recursive
- Delete S3 bucket
aws s3api delete-bucket --bucket <my-bucket-name> --region <my-region>
- Delete Demo Channel
aws ivs delete-channel --name my-channel
Endpoint: <ApiURL>send
Method: PUT
Content Type: JSON
Payload:
{
"channelArn": "arn:aws:ivs:us-east-1:...",
"metadata": "my-metadata"
}
Response Code: 200
Response Body:
{"published": true}