From 680d69aa217df80dedfacc127741f25c8e45672c Mon Sep 17 00:00:00 2001 From: iolesyk Date: Fri, 26 Apr 2024 14:09:09 -0400 Subject: [PATCH] Add example and updated documentation for vpc only mode --- README.md | 34 ++++++- examples/autoscaling/main.tf | 158 +++++++++++++++---------------- examples/cluster/main.tf | 166 ++++++++++++++++----------------- examples/single/main.tf | 106 ++++++++++----------- examples/vpc-only/README.md | 64 +++++++++++++ examples/vpc-only/main.tf | 29 ++++++ examples/vpc-only/outputs.tf | 12 +++ examples/vpc-only/variables.tf | 0 8 files changed, 353 insertions(+), 216 deletions(-) create mode 100644 examples/vpc-only/README.md create mode 100644 examples/vpc-only/main.tf create mode 100644 examples/vpc-only/outputs.tf create mode 100644 examples/vpc-only/variables.tf diff --git a/README.md b/README.md index 4da42c1..f12e0d5 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,12 @@ Terraform Red5 Pro AWS module which create Red5 Pro resources on AWS. -## This module has 3 variants of Red5 Pro deployments +## This module has 4 variants of Red5 Pro deployments * **single** - Single EC2 instance with installed and configured Red5 Pro server * **cluster** - Stream Manager cluster (MySQL DB + Stream Manager instance + Autoscaling Node group with Origin, Edge, Transcoder, Relay instances) * **autoscaling** - Autoscaling Stream Managers (MySQL RDS + Load Balancer + Autoscaling Stream Managers + Autoscaling Node group with Origin, Edge, Transcoder, Relay instances) +* **vpc** - VPC only (VPC, Sunbets, Route table, Internet Gateway) - this option is useful if you need to create VPC separately and after that use this VPC to deploy Red5 Pro resources --- @@ -402,6 +403,37 @@ module "red5pro" { } ``` +## AWS VPC create only (vpc) - [Example](https://github.com/red5pro/terraform-aws-red5pro/tree/master/examples/vpc) + +* VPC create + +## Usage (vpc) +``` +provider "aws" { + region = "us-west-1" # AWS region + access_key = "" # AWS IAM Access key + secret_key = "" # AWS IAM Secret key +} + +module "red5pro_vpc" { + source = "red5pro/red5pro/aws" + + type = "vpc" # Deployment type: single, cluster, autoscaling, vpc + name = "red5pro-vpc" # Name to be used on all the resources as identifier + + # VPC configuration + vpc_create = true # true - create new VPC, false - use existing VPC + vpc_cidr_block = "10.105.0.0/16" + vpc_public_subnets = ["10.105.0.0/24", "10.105.1.0/24", "10.105.2.0/24", "10.105.3.0/24"] # Public subnets for Stream Manager and Red5 Pro server instances + + # Red5 Pro tags configuration - it will be added to all Red5 Pro resources + tags = { + Terraform = "true" + Environment = "dev" + Project = "red5pro" + } +} +``` --- **NOTES** diff --git a/examples/autoscaling/main.tf b/examples/autoscaling/main.tf index 12a8002..279a9d6 100644 --- a/examples/autoscaling/main.tf +++ b/examples/autoscaling/main.tf @@ -3,111 +3,111 @@ #################################################################################### provider "aws" { - region = "us-west-1" # AWS region - access_key = "" # AWS IAM Access key - secret_key = "" # AWS IAM Secret key + region = "us-west-1" # AWS region + access_key = "" # AWS IAM Access key + secret_key = "" # AWS IAM Secret key } module "red5pro" { - source = "../../" + source = "../../" - type = "autoscaling" # Deployment type: single, cluster, autoscaling - name = "red5pro-auto" # Name to be used on all the resources as identifier + type = "autoscaling" # Deployment type: single, cluster, autoscaling, vpc + name = "red5pro-auto" # Name to be used on all the resources as identifier - ubuntu_version = "22.04" # Ubuntu version for Red5 Pro servers - path_to_red5pro_build = "./red5pro-server-0.0.0.b0-release.zip" # Absolute path or relative path to Red5 Pro server ZIP file - path_to_aws_cloud_controller = "./aws-cloud-controller-0.0.0.jar" # Absolute path or relative path to AWS Cloud Controller JAR file + ubuntu_version = "22.04" # Ubuntu version for Red5 Pro servers + path_to_red5pro_build = "./red5pro-server-0.0.0.b0-release.zip" # Absolute path or relative path to Red5 Pro server ZIP file + path_to_aws_cloud_controller = "./aws-cloud-controller-0.0.0.jar" # Absolute path or relative path to AWS Cloud Controller JAR file # AWS authetification variables it use for Stream Manager autoscaling configuration - aws_region = "us-west-1" # AWS region - aws_access_key = "" # AWS IAM Access key - aws_secret_key = "" # AWS IAM Secret key + aws_region = "us-west-1" # AWS region + aws_access_key = "" # AWS IAM Access key + aws_secret_key = "" # AWS IAM Secret key # SSH key configuration - ssh_key_create = true # true - create new SSH key, false - use existing SSH key - ssh_key_name = "example_key" # Name for new SSH key or for existing SSH key - ssh_private_key_path = "/PATH/TO/EXISTING/SSH/PRIVATE/KEY/example_key.pem" # Path to existing SSH private key - + ssh_key_create = true # true - create new SSH key, false - use existing SSH key + ssh_key_name = "example_key" # Name for new SSH key or for existing SSH key + ssh_private_key_path = "/PATH/TO/EXISTING/SSH/PRIVATE/KEY/example_key.pem" # Path to existing SSH private key + # VPC configuration - vpc_create = true # true - create new VPC, false - use existing VPC - vpc_id_existing = "vpc-12345" # VPC ID for existing VPC + vpc_create = true # true - create new VPC, false - use existing VPC + vpc_id_existing = "vpc-12345" # VPC ID for existing VPC # MySQL DB configuration - mysql_rds_instance_type = "db.t2.micro" # Instance type for RDS instance - mysql_user_name = "exampleuser" # MySQL user name - mysql_password = "examplepass" # MySQL password - mysql_port = 3306 # MySQL port + mysql_rds_instance_type = "db.t2.micro" # Instance type for RDS instance + mysql_user_name = "exampleuser" # MySQL user name + mysql_password = "examplepass" # MySQL password + mysql_port = 3306 # MySQL port # Load Balancer HTTPS/SSL certificate configuration - https_certificate_manager_use_existing = true # If you want to use SSL certificate set it to true - https_certificate_manager_certificate_name = "red5pro.example.com" # Domain name for your SSL certificate + https_certificate_manager_use_existing = true # If you want to use SSL certificate set it to true + https_certificate_manager_certificate_name = "red5pro.example.com" # Domain name for your SSL certificate # Stream Manager configuration - stream_manager_instance_type = "t3.medium" # Instance type for Stream Manager - stream_manager_volume_size = 20 # Volume size for Stream Manager - stream_manager_api_key = "examplekey" # API key for Stream Manager - stream_manager_autoscaling_desired_capacity = 1 # Desired capacity for Stream Manager autoscaling group - stream_manager_autoscaling_minimum_capacity = 1 # Minimum capacity for Stream Manager autoscaling group - stream_manager_autoscaling_maximum_capacity = 1 # Maximum capacity for Stream Manager autoscaling group - stream_manager_coturn_enable = false # true - enable customized Coturn configuration for Stream Manager, false - disable customized Coturn configuration for Stream Manager (https://www.red5.net/docs/installation/turn-stun/turnstun/) - stream_manager_coturn_address = "stun:1.2.3.4:3478" # Customized coturn address for Stream Manager (https://www.red5.net/docs/installation/turn-stun/turnstun/) + stream_manager_instance_type = "t3.medium" # Instance type for Stream Manager + stream_manager_volume_size = 20 # Volume size for Stream Manager + stream_manager_api_key = "examplekey" # API key for Stream Manager + stream_manager_autoscaling_desired_capacity = 1 # Desired capacity for Stream Manager autoscaling group + stream_manager_autoscaling_minimum_capacity = 1 # Minimum capacity for Stream Manager autoscaling group + stream_manager_autoscaling_maximum_capacity = 1 # Maximum capacity for Stream Manager autoscaling group + stream_manager_coturn_enable = false # true - enable customized Coturn configuration for Stream Manager, false - disable customized Coturn configuration for Stream Manager (https://www.red5.net/docs/installation/turn-stun/turnstun/) + stream_manager_coturn_address = "stun:1.2.3.4:3478" # Customized coturn address for Stream Manager (https://www.red5.net/docs/installation/turn-stun/turnstun/) # Red5 Pro general configuration - red5pro_license_key = "1111-2222-3333-4444" # Red5 Pro license key (https://account.red5.net/login) - red5pro_cluster_key = "examplekey" # Red5 Pro cluster key - red5pro_api_enable = true # true - enable Red5 Pro server API, false - disable Red5 Pro server API (https://www.red5.net/docs/development/api/overview/) - red5pro_api_key = "examplekey" # Red5 Pro server API key (https://www.red5.net/docs/development/api/overview/) + red5pro_license_key = "1111-2222-3333-4444" # Red5 Pro license key (https://account.red5.net/login) + red5pro_cluster_key = "examplekey" # Red5 Pro cluster key + red5pro_api_enable = true # true - enable Red5 Pro server API, false - disable Red5 Pro server API (https://www.red5.net/docs/development/api/overview/) + red5pro_api_key = "examplekey" # Red5 Pro server API key (https://www.red5.net/docs/development/api/overview/) # Red5 Pro autoscaling Origin node image configuration - origin_image_create = true # Default: true for Autoscaling and Cluster, true - create new Origin node image, false - not create new Origin node image - origin_image_instance_type = "t3.medium" # Instance type for Origin node image - origin_image_volume_size = 8 # Volume size for Origin node image - origin_image_red5pro_inspector_enable = false # true - enable Red5 Pro server inspector, false - disable Red5 Pro server inspector (https://www.red5.net/docs/troubleshooting/inspector/overview/) - origin_image_red5pro_restreamer_enable = false # true - enable Red5 Pro server restreamer, false - disable Red5 Pro server restreamer (https://www.red5.net/docs/special/restreamer/overview/) - origin_image_red5pro_socialpusher_enable = false # true - enable Red5 Pro server socialpusher, false - disable Red5 Pro server socialpusher (https://www.red5.net/docs/special/social-media-plugin/overview/) - origin_image_red5pro_suppressor_enable = false # true - enable Red5 Pro server suppressor, false - disable Red5 Pro server suppressor - origin_image_red5pro_hls_enable = false # true - enable Red5 Pro server HLS, false - disable Red5 Pro server HLS (https://www.red5.net/docs/protocols/hls-plugin/hls-vod/) - origin_image_red5pro_webhooks_enable = false # true - enable Red5 Pro server webhooks, false - disable Red5 Pro server webhooks (https://www.red5.net/docs/special/webhooks/overview/) - origin_image_red5pro_webhooks_endpoint = "https://example.com/red5/status" # Red5 Pro server webhooks endpoint - origin_image_red5pro_round_trip_auth_enable = false # true - enable Red5 Pro server round trip authentication, false - disable Red5 Pro server round trip authentication (https://www.red5.net/docs/special/round-trip-auth/overview/) - origin_image_red5pro_round_trip_auth_host = "round-trip-auth.example.com" # Round trip authentication server host - origin_image_red5pro_round_trip_auth_port = 3000 # Round trip authentication server port - origin_image_red5pro_round_trip_auth_protocol = "http" # Round trip authentication server protocol - origin_image_red5pro_round_trip_auth_endpoint_validate = "/validateCredentials" # Round trip authentication server endpoint for validate - origin_image_red5pro_round_trip_auth_endpoint_invalidate = "/invalidateCredentials" # Round trip authentication server endpoint for invalidate - origin_image_red5pro_cloudstorage_enable = false # true - enable Red5 Pro server cloud storage, false - disable Red5 Pro server cloud storage (https://www.red5.net/docs/special/cloudstorage-plugin/aws-s3-cloud-storage/) - origin_image_red5pro_cloudstorage_aws_access_key = "" # AWS access key for Red5 Pro cloud storage (S3 Bucket) - origin_image_red5pro_cloudstorage_aws_secret_key = "" # AWS secret key for Red5 Pro cloud storage (S3 Bucket) - origin_image_red5pro_cloudstorage_aws_bucket_name = "s3-bucket-example-name" # AWS bucket name for Red5 Pro cloud storage (S3 Bucket) - origin_image_red5pro_cloudstorage_aws_region = "us-west-1" # AWS region for Red5 Pro cloud storage (S3 Bucket) - origin_image_red5pro_cloudstorage_postprocessor_enable = false # true - enable Red5 Pro server postprocessor, false - disable Red5 Pro server postprocessor (https://www.red5.net/docs/special/cloudstorage-plugin/server-configuration/) - origin_image_red5pro_cloudstorage_aws_bucket_acl_policy = "public-read" # AWS bucket ACL policy for Red5 Pro cloud storage (S3 Bucket) Example: none, public-read, authenticated-read, private, public-read-write - origin_image_red5pro_efs_enable = false # enable/disable EFS mount to record streams - origin_image_red5pro_efs_dns_name = "example.efs.region.amazonaws.com" # EFS DNS name + origin_image_create = true # Default: true for Autoscaling and Cluster, true - create new Origin node image, false - not create new Origin node image + origin_image_instance_type = "t3.medium" # Instance type for Origin node image + origin_image_volume_size = 8 # Volume size for Origin node image + origin_image_red5pro_inspector_enable = false # true - enable Red5 Pro server inspector, false - disable Red5 Pro server inspector (https://www.red5.net/docs/troubleshooting/inspector/overview/) + origin_image_red5pro_restreamer_enable = false # true - enable Red5 Pro server restreamer, false - disable Red5 Pro server restreamer (https://www.red5.net/docs/special/restreamer/overview/) + origin_image_red5pro_socialpusher_enable = false # true - enable Red5 Pro server socialpusher, false - disable Red5 Pro server socialpusher (https://www.red5.net/docs/special/social-media-plugin/overview/) + origin_image_red5pro_suppressor_enable = false # true - enable Red5 Pro server suppressor, false - disable Red5 Pro server suppressor + origin_image_red5pro_hls_enable = false # true - enable Red5 Pro server HLS, false - disable Red5 Pro server HLS (https://www.red5.net/docs/protocols/hls-plugin/hls-vod/) + origin_image_red5pro_webhooks_enable = false # true - enable Red5 Pro server webhooks, false - disable Red5 Pro server webhooks (https://www.red5.net/docs/special/webhooks/overview/) + origin_image_red5pro_webhooks_endpoint = "https://example.com/red5/status" # Red5 Pro server webhooks endpoint + origin_image_red5pro_round_trip_auth_enable = false # true - enable Red5 Pro server round trip authentication, false - disable Red5 Pro server round trip authentication (https://www.red5.net/docs/special/round-trip-auth/overview/) + origin_image_red5pro_round_trip_auth_host = "round-trip-auth.example.com" # Round trip authentication server host + origin_image_red5pro_round_trip_auth_port = 3000 # Round trip authentication server port + origin_image_red5pro_round_trip_auth_protocol = "http" # Round trip authentication server protocol + origin_image_red5pro_round_trip_auth_endpoint_validate = "/validateCredentials" # Round trip authentication server endpoint for validate + origin_image_red5pro_round_trip_auth_endpoint_invalidate = "/invalidateCredentials" # Round trip authentication server endpoint for invalidate + origin_image_red5pro_cloudstorage_enable = false # true - enable Red5 Pro server cloud storage, false - disable Red5 Pro server cloud storage (https://www.red5.net/docs/special/cloudstorage-plugin/aws-s3-cloud-storage/) + origin_image_red5pro_cloudstorage_aws_access_key = "" # AWS access key for Red5 Pro cloud storage (S3 Bucket) + origin_image_red5pro_cloudstorage_aws_secret_key = "" # AWS secret key for Red5 Pro cloud storage (S3 Bucket) + origin_image_red5pro_cloudstorage_aws_bucket_name = "s3-bucket-example-name" # AWS bucket name for Red5 Pro cloud storage (S3 Bucket) + origin_image_red5pro_cloudstorage_aws_region = "us-west-1" # AWS region for Red5 Pro cloud storage (S3 Bucket) + origin_image_red5pro_cloudstorage_postprocessor_enable = false # true - enable Red5 Pro server postprocessor, false - disable Red5 Pro server postprocessor (https://www.red5.net/docs/special/cloudstorage-plugin/server-configuration/) + origin_image_red5pro_cloudstorage_aws_bucket_acl_policy = "public-read" # AWS bucket ACL policy for Red5 Pro cloud storage (S3 Bucket) Example: none, public-read, authenticated-read, private, public-read-write + origin_image_red5pro_efs_enable = false # enable/disable EFS mount to record streams + origin_image_red5pro_efs_dns_name = "example.efs.region.amazonaws.com" # EFS DNS name # Red5 Pro autoscaling Node group - (Optional) - node_group_create = true # Linux or Mac OS only. true - create new Node group, false - not create new Node group - node_group_name = "terraform-node-group" # Node group name + node_group_create = true # Linux or Mac OS only. true - create new Node group, false - not create new Node group + node_group_name = "terraform-node-group" # Node group name # Origin node configuration - node_group_origins_min = 1 # Number of minimum Origins - node_group_origins_max = 20 # Number of maximum Origins - node_group_origins_instance_type = "t3.medium" # Instance type for Origins - node_group_origins_capacity = 20 # Connections capacity for Origins + node_group_origins_min = 1 # Number of minimum Origins + node_group_origins_max = 20 # Number of maximum Origins + node_group_origins_instance_type = "t3.medium" # Instance type for Origins + node_group_origins_capacity = 20 # Connections capacity for Origins # Edge node configuration - node_group_edges_min = 1 # Number of minimum Edges - node_group_edges_max = 40 # Number of maximum Edges - node_group_edges_instance_type = "t3.medium" # Instance type for Edges - node_group_edges_capacity = 200 # Connections capacity for Edges + node_group_edges_min = 1 # Number of minimum Edges + node_group_edges_max = 40 # Number of maximum Edges + node_group_edges_instance_type = "t3.medium" # Instance type for Edges + node_group_edges_capacity = 200 # Connections capacity for Edges # Transcoder node configuration - node_group_transcoders_min = 0 # Number of minimum Transcoders - node_group_transcoders_max = 20 # Number of maximum Transcoders - node_group_transcoders_instance_type = "t3.medium" # Instance type for Transcoders - node_group_transcoders_capacity = 20 # Connections capacity for Transcoders + node_group_transcoders_min = 0 # Number of minimum Transcoders + node_group_transcoders_max = 20 # Number of maximum Transcoders + node_group_transcoders_instance_type = "t3.medium" # Instance type for Transcoders + node_group_transcoders_capacity = 20 # Connections capacity for Transcoders # Relay node configuration - node_group_relays_min = 0 # Number of minimum Relays - node_group_relays_max = 20 # Number of maximum Relays - node_group_relays_instance_type = "t3.medium" # Instance type for Relays - node_group_relays_capacity = 20 # Connections capacity for Relays + node_group_relays_min = 0 # Number of minimum Relays + node_group_relays_max = 20 # Number of maximum Relays + node_group_relays_instance_type = "t3.medium" # Instance type for Relays + node_group_relays_capacity = 20 # Connections capacity for Relays # Red5 Pro tags configuration - it will be added to all Red5 Pro resources tags = { diff --git a/examples/cluster/main.tf b/examples/cluster/main.tf index 3797904..5e2a1a9 100644 --- a/examples/cluster/main.tf +++ b/examples/cluster/main.tf @@ -3,117 +3,117 @@ ########################################################## provider "aws" { - region = "us-west-1" # AWS region - access_key = "" # AWS IAM Access key - secret_key = "" # AWS IAM Secret key + region = "us-west-1" # AWS region + access_key = "" # AWS IAM Access key + secret_key = "" # AWS IAM Secret key } module "red5pro" { - source = "../../" + source = "../../" - type = "cluster" # Deployment type: single, cluster, autoscaling - name = "red5pro-cluster" # Name to be used on all the resources as identifier + type = "cluster" # Deployment type: single, cluster, autoscaling, vpc + name = "red5pro-cluster" # Name to be used on all the resources as identifier - ubuntu_version = "22.04" # Ubuntu version for Red5 Pro servers - path_to_red5pro_build = "./red5pro-server-0.0.0.b0-release.zip" # Absolute path or relative path to Red5 Pro server ZIP file - path_to_aws_cloud_controller = "./aws-cloud-controller-0.0.0.jar" # Absolute path or relative path to AWS Cloud Controller JAR file + ubuntu_version = "22.04" # Ubuntu version for Red5 Pro servers + path_to_red5pro_build = "./red5pro-server-0.0.0.b0-release.zip" # Absolute path or relative path to Red5 Pro server ZIP file + path_to_aws_cloud_controller = "./aws-cloud-controller-0.0.0.jar" # Absolute path or relative path to AWS Cloud Controller JAR file # AWS authetification variables it use for Stream Manager autoscaling configuration - aws_region = "us-west-1" # AWS region - aws_access_key = "" # AWS IAM Access key - aws_secret_key = "" # AWS IAM Secret key + aws_region = "us-west-1" # AWS region + aws_access_key = "" # AWS IAM Access key + aws_secret_key = "" # AWS IAM Secret key # SSH key configuration - ssh_key_create = true # true - create new SSH key, false - use existing SSH key - ssh_key_name = "example_key" # Name for new SSH key or for existing SSH key - ssh_private_key_path = "/PATH/TO/EXISTING/SSH/PRIVATE/KEY/example_key.pem" # Path to existing SSH private key - + ssh_key_create = true # true - create new SSH key, false - use existing SSH key + ssh_key_name = "example_key" # Name for new SSH key or for existing SSH key + ssh_private_key_path = "/PATH/TO/EXISTING/SSH/PRIVATE/KEY/example_key.pem" # Path to existing SSH private key + # VPC configuration - vpc_create = true # true - create new VPC, false - use existing VPC - vpc_id_existing = "vpc-12345" # VPC ID for existing VPC + vpc_create = true # true - create new VPC, false - use existing VPC + vpc_id_existing = "vpc-12345" # VPC ID for existing VPC # MySQL DB configuration - mysql_rds_create = false # true - create new RDS instance, false - install local MySQL server on the Stream Manager EC2 instance - mysql_rds_instance_type = "db.t2.micro" # Instance type for RDS instance - mysql_user_name = "exampleuser" # MySQL user name - mysql_password = "examplepass" # MySQL password - mysql_port = 3306 # MySQL port + mysql_rds_create = false # true - create new RDS instance, false - install local MySQL server on the Stream Manager EC2 instance + mysql_rds_instance_type = "db.t2.micro" # Instance type for RDS instance + mysql_user_name = "exampleuser" # MySQL user name + mysql_password = "examplepass" # MySQL password + mysql_port = 3306 # MySQL port # Stream Manager Elastic IP configuration - elastic_ip_create = true # true - create new elastic IP, false - use existing elastic IP - elastic_ip_existing = "1.2.3.4" # Elastic IP for existing elastic IP + elastic_ip_create = true # true - create new elastic IP, false - use existing elastic IP + elastic_ip_existing = "1.2.3.4" # Elastic IP for existing elastic IP # Stream Manager HTTPS/SSL certificate configuration - https_letsencrypt_enable = true # true - create new Let's Encrypt HTTPS/SSL certificate, false - use Red5 Pro server without HTTPS/SSL certificate - https_letsencrypt_certificate_domain_name = "red5pro.example.com" # Domain name for Let's Encrypt SSL certificate - https_letsencrypt_certificate_email = "email@example.com" # Email for Let's Encrypt SSL certificate - https_letsencrypt_certificate_password = "examplepass" # Password for Let's Encrypt SSL certificate + https_letsencrypt_enable = true # true - create new Let's Encrypt HTTPS/SSL certificate, false - use Red5 Pro server without HTTPS/SSL certificate + https_letsencrypt_certificate_domain_name = "red5pro.example.com" # Domain name for Let's Encrypt SSL certificate + https_letsencrypt_certificate_email = "email@example.com" # Email for Let's Encrypt SSL certificate + https_letsencrypt_certificate_password = "examplepass" # Password for Let's Encrypt SSL certificate # Stream Manager configuration - stream_manager_instance_type = "t3.medium" # Instance type for Stream Manager - stream_manager_volume_size = 20 # Volume size for Stream Manager - stream_manager_api_key = "examplekey" # API key for Stream Manager - stream_manager_coturn_enable = false # true - enable customized Coturn configuration for Stream Manager, false - disable customized Coturn configuration for Stream Manager (https://www.red5.net/docs/installation/turn-stun/turnstun/) - stream_manager_coturn_address = "stun:1.2.3.4:3478" # Customized coturn address for Stream Manager (https://www.red5.net/docs/installation/turn-stun/turnstun/) + stream_manager_instance_type = "t3.medium" # Instance type for Stream Manager + stream_manager_volume_size = 20 # Volume size for Stream Manager + stream_manager_api_key = "examplekey" # API key for Stream Manager + stream_manager_coturn_enable = false # true - enable customized Coturn configuration for Stream Manager, false - disable customized Coturn configuration for Stream Manager (https://www.red5.net/docs/installation/turn-stun/turnstun/) + stream_manager_coturn_address = "stun:1.2.3.4:3478" # Customized coturn address for Stream Manager (https://www.red5.net/docs/installation/turn-stun/turnstun/) # Red5 Pro general configuration - red5pro_license_key = "1111-2222-3333-4444" # Red5 Pro license key (https://account.red5.net/login) - red5pro_cluster_key = "examplekey" # Red5 Pro cluster key - red5pro_api_enable = true # true - enable Red5 Pro server API, false - disable Red5 Pro server API (https://www.red5.net/docs/development/api/overview/) - red5pro_api_key = "examplekey" # Red5 Pro server API key (https://www.red5.net/docs/development/api/overview/) + red5pro_license_key = "1111-2222-3333-4444" # Red5 Pro license key (https://account.red5.net/login) + red5pro_cluster_key = "examplekey" # Red5 Pro cluster key + red5pro_api_enable = true # true - enable Red5 Pro server API, false - disable Red5 Pro server API (https://www.red5.net/docs/development/api/overview/) + red5pro_api_key = "examplekey" # Red5 Pro server API key (https://www.red5.net/docs/development/api/overview/) # Red5 Pro autoscaling Origin node image configuration - origin_image_create = true # Default: true for Autoscaling and Cluster, true - create new Origin node image, false - not create new Origin node image - origin_image_instance_type = "t3.medium" # Instance type for Origin node image - origin_image_volume_size = 8 # Volume size for Origin node image - origin_image_red5pro_inspector_enable = false # true - enable Red5 Pro server inspector, false - disable Red5 Pro server inspector (https://www.red5.net/docs/troubleshooting/inspector/overview/) - origin_image_red5pro_restreamer_enable = false # true - enable Red5 Pro server restreamer, false - disable Red5 Pro server restreamer (https://www.red5.net/docs/special/restreamer/overview/) - origin_image_red5pro_socialpusher_enable = false # true - enable Red5 Pro server socialpusher, false - disable Red5 Pro server socialpusher (https://www.red5.net/docs/special/social-media-plugin/overview/) - origin_image_red5pro_suppressor_enable = false # true - enable Red5 Pro server suppressor, false - disable Red5 Pro server suppressor - origin_image_red5pro_hls_enable = false # true - enable Red5 Pro server HLS, false - disable Red5 Pro server HLS (https://www.red5.net/docs/protocols/hls-plugin/hls-vod/) - origin_image_red5pro_webhooks_enable = false # true - enable Red5 Pro server webhooks, false - disable Red5 Pro server webhooks (https://www.red5.net/docs/special/webhooks/overview/) - origin_image_red5pro_webhooks_endpoint = "https://example.com/red5/status" # Red5 Pro server webhooks endpoint - origin_image_red5pro_round_trip_auth_enable = false # true - enable Red5 Pro server round trip authentication, false - disable Red5 Pro server round trip authentication (https://www.red5.net/docs/special/round-trip-auth/overview/) - origin_image_red5pro_round_trip_auth_host = "round-trip-auth.example.com" # Round trip authentication server host - origin_image_red5pro_round_trip_auth_port = 3000 # Round trip authentication server port - origin_image_red5pro_round_trip_auth_protocol = "http" # Round trip authentication server protocol - origin_image_red5pro_round_trip_auth_endpoint_validate = "/validateCredentials" # Round trip authentication server endpoint for validate - origin_image_red5pro_round_trip_auth_endpoint_invalidate = "/invalidateCredentials" # Round trip authentication server endpoint for invalidate - origin_image_red5pro_cloudstorage_enable = false # true - enable Red5 Pro server cloud storage, false - disable Red5 Pro server cloud storage (https://www.red5.net/docs/special/cloudstorage-plugin/aws-s3-cloud-storage/) - origin_image_red5pro_cloudstorage_aws_access_key = "" # AWS access key for Red5 Pro cloud storage (S3 Bucket) - origin_image_red5pro_cloudstorage_aws_secret_key = "" # AWS secret key for Red5 Pro cloud storage (S3 Bucket) - origin_image_red5pro_cloudstorage_aws_bucket_name = "s3-bucket-example-name" # AWS bucket name for Red5 Pro cloud storage (S3 Bucket) - origin_image_red5pro_cloudstorage_aws_region = "us-west-1" # AWS region for Red5 Pro cloud storage (S3 Bucket) - origin_image_red5pro_cloudstorage_postprocessor_enable = false # true - enable Red5 Pro server postprocessor, false - disable Red5 Pro server postprocessor (https://www.red5.net/docs/special/cloudstorage-plugin/server-configuration/) - origin_image_red5pro_cloudstorage_aws_bucket_acl_policy = "public-read" # AWS bucket ACL policy for Red5 Pro cloud storage (S3 Bucket) Example: none, public-read, authenticated-read, private, public-read-write - origin_image_red5pro_efs_enable = false # enable/disable EFS mount to record streams - origin_image_red5pro_efs_dns_name = "example.efs.region.amazonaws.com" # EFS DNS name + origin_image_create = true # Default: true for Autoscaling and Cluster, true - create new Origin node image, false - not create new Origin node image + origin_image_instance_type = "t3.medium" # Instance type for Origin node image + origin_image_volume_size = 8 # Volume size for Origin node image + origin_image_red5pro_inspector_enable = false # true - enable Red5 Pro server inspector, false - disable Red5 Pro server inspector (https://www.red5.net/docs/troubleshooting/inspector/overview/) + origin_image_red5pro_restreamer_enable = false # true - enable Red5 Pro server restreamer, false - disable Red5 Pro server restreamer (https://www.red5.net/docs/special/restreamer/overview/) + origin_image_red5pro_socialpusher_enable = false # true - enable Red5 Pro server socialpusher, false - disable Red5 Pro server socialpusher (https://www.red5.net/docs/special/social-media-plugin/overview/) + origin_image_red5pro_suppressor_enable = false # true - enable Red5 Pro server suppressor, false - disable Red5 Pro server suppressor + origin_image_red5pro_hls_enable = false # true - enable Red5 Pro server HLS, false - disable Red5 Pro server HLS (https://www.red5.net/docs/protocols/hls-plugin/hls-vod/) + origin_image_red5pro_webhooks_enable = false # true - enable Red5 Pro server webhooks, false - disable Red5 Pro server webhooks (https://www.red5.net/docs/special/webhooks/overview/) + origin_image_red5pro_webhooks_endpoint = "https://example.com/red5/status" # Red5 Pro server webhooks endpoint + origin_image_red5pro_round_trip_auth_enable = false # true - enable Red5 Pro server round trip authentication, false - disable Red5 Pro server round trip authentication (https://www.red5.net/docs/special/round-trip-auth/overview/) + origin_image_red5pro_round_trip_auth_host = "round-trip-auth.example.com" # Round trip authentication server host + origin_image_red5pro_round_trip_auth_port = 3000 # Round trip authentication server port + origin_image_red5pro_round_trip_auth_protocol = "http" # Round trip authentication server protocol + origin_image_red5pro_round_trip_auth_endpoint_validate = "/validateCredentials" # Round trip authentication server endpoint for validate + origin_image_red5pro_round_trip_auth_endpoint_invalidate = "/invalidateCredentials" # Round trip authentication server endpoint for invalidate + origin_image_red5pro_cloudstorage_enable = false # true - enable Red5 Pro server cloud storage, false - disable Red5 Pro server cloud storage (https://www.red5.net/docs/special/cloudstorage-plugin/aws-s3-cloud-storage/) + origin_image_red5pro_cloudstorage_aws_access_key = "" # AWS access key for Red5 Pro cloud storage (S3 Bucket) + origin_image_red5pro_cloudstorage_aws_secret_key = "" # AWS secret key for Red5 Pro cloud storage (S3 Bucket) + origin_image_red5pro_cloudstorage_aws_bucket_name = "s3-bucket-example-name" # AWS bucket name for Red5 Pro cloud storage (S3 Bucket) + origin_image_red5pro_cloudstorage_aws_region = "us-west-1" # AWS region for Red5 Pro cloud storage (S3 Bucket) + origin_image_red5pro_cloudstorage_postprocessor_enable = false # true - enable Red5 Pro server postprocessor, false - disable Red5 Pro server postprocessor (https://www.red5.net/docs/special/cloudstorage-plugin/server-configuration/) + origin_image_red5pro_cloudstorage_aws_bucket_acl_policy = "public-read" # AWS bucket ACL policy for Red5 Pro cloud storage (S3 Bucket) Example: none, public-read, authenticated-read, private, public-read-write + origin_image_red5pro_efs_enable = false # enable/disable EFS mount to record streams + origin_image_red5pro_efs_dns_name = "example.efs.region.amazonaws.com" # EFS DNS name # Red5 Pro autoscaling Node group - (Optional) - node_group_create = true # Linux or Mac OS only. true - create new Node group, false - not create new Node group - node_group_name = "terraform-node-group" # Node group name + node_group_create = true # Linux or Mac OS only. true - create new Node group, false - not create new Node group + node_group_name = "terraform-node-group" # Node group name # Origin node configuration - node_group_origins_min = 1 # Number of minimum Origins - node_group_origins_max = 20 # Number of maximum Origins - node_group_origins_instance_type = "t3.medium" # Instance type for Origins - node_group_origins_capacity = 20 # Connections capacity for Origins + node_group_origins_min = 1 # Number of minimum Origins + node_group_origins_max = 20 # Number of maximum Origins + node_group_origins_instance_type = "t3.medium" # Instance type for Origins + node_group_origins_capacity = 20 # Connections capacity for Origins # Edge node configuration - node_group_edges_min = 1 # Number of minimum Edges - node_group_edges_max = 40 # Number of maximum Edges - node_group_edges_instance_type = "t3.medium" # Instance type for Edges - node_group_edges_capacity = 200 # Connections capacity for Edges + node_group_edges_min = 1 # Number of minimum Edges + node_group_edges_max = 40 # Number of maximum Edges + node_group_edges_instance_type = "t3.medium" # Instance type for Edges + node_group_edges_capacity = 200 # Connections capacity for Edges # Transcoder node configuration - node_group_transcoders_min = 0 # Number of minimum Transcoders - node_group_transcoders_max = 20 # Number of maximum Transcoders - node_group_transcoders_instance_type = "t3.medium" # Instance type for Transcoders - node_group_transcoders_capacity = 20 # Connections capacity for Transcoders + node_group_transcoders_min = 0 # Number of minimum Transcoders + node_group_transcoders_max = 20 # Number of maximum Transcoders + node_group_transcoders_instance_type = "t3.medium" # Instance type for Transcoders + node_group_transcoders_capacity = 20 # Connections capacity for Transcoders # Relay node configuration - node_group_relays_min = 0 # Number of minimum Relays - node_group_relays_max = 20 # Number of maximum Relays - node_group_relays_instance_type = "t3.medium" # Instance type for Relays - node_group_relays_capacity = 20 # Connections capacity for Relays - + node_group_relays_min = 0 # Number of minimum Relays + node_group_relays_max = 20 # Number of maximum Relays + node_group_relays_instance_type = "t3.medium" # Instance type for Relays + node_group_relays_capacity = 20 # Connections capacity for Relays + # Red5 Pro tags configuration - it will be added to all Red5 Pro resources tags = { @@ -121,4 +121,4 @@ module "red5pro" { Environment = "dev" Project = "red5pro" } -} \ No newline at end of file +} diff --git a/examples/single/main.tf b/examples/single/main.tf index 0c6dc8f..370f233 100644 --- a/examples/single/main.tf +++ b/examples/single/main.tf @@ -3,75 +3,75 @@ ################################################# provider "aws" { - region = "us-west-1" # AWS region - access_key = "" # AWS IAM Access key - secret_key = "" # AWS IAM Secret key + region = "us-west-1" # AWS region + access_key = "" # AWS IAM Access key + secret_key = "" # AWS IAM Secret key } module "red5pro" { - source = "../../" + source = "../../" - type = "single" # Deployment type: single, cluster, autoscaling - name = "red5pro-single" # Name to be used on all the resources as identifier + type = "single" # Deployment type: single, cluster, autoscaling, vpc + name = "red5pro-single" # Name to be used on all the resources as identifier - ubuntu_version = "22.04" # Ubuntu version for Red5 Pro servers - path_to_red5pro_build = "./red5pro-server-0.0.0.b0-release.zip" # Absolute path or relative path to Red5 Pro server ZIP file + ubuntu_version = "22.04" # Ubuntu version for Red5 Pro servers + path_to_red5pro_build = "./red5pro-server-0.0.0.b0-release.zip" # Absolute path or relative path to Red5 Pro server ZIP file + + # SSH key configuration + ssh_key_create = true # true - create new SSH key, false - use existing SSH key + ssh_key_name = "example_key" # Name for new SSH key or for existing SSH key + ssh_private_key_path = "/PATH/TO/EXISTING/SSH/PRIVATE/KEY/example_key.pem" # Path to existing SSH private key - # SSH key configuration - ssh_key_create = true # true - create new SSH key, false - use existing SSH key - ssh_key_name = "example_key" # Name for new SSH key or for existing SSH key - ssh_private_key_path = "/PATH/TO/EXISTING/SSH/PRIVATE/KEY/example_key.pem" # Path to existing SSH private key - # VPC configuration - vpc_create = true # true - create new VPC, false - use existing VPC - vpc_id_existing = "vpc-12345" # VPC ID for existing VPC + vpc_create = true # true - create new VPC, false - use existing VPC + vpc_id_existing = "vpc-12345" # VPC ID for existing VPC # Security group configuration - security_group_create = true # true - create new security group, false - use existing security group - security_group_id_existing = "sg-12345" # Security group ID for existing security group + security_group_create = true # true - create new security group, false - use existing security group + security_group_id_existing = "sg-12345" # Security group ID for existing security group # Elastic IP configuration - elastic_ip_create = true # true - create new elastic IP, false - use existing elastic IP - elastic_ip_existing = "1.2.3.4" # Elastic IP for existing elastic IP + elastic_ip_create = true # true - create new elastic IP, false - use existing elastic IP + elastic_ip_existing = "1.2.3.4" # Elastic IP for existing elastic IP # Single Red5 Pro server HTTPS/SSL certificate configuration - https_letsencrypt_enable = true # true - create new Let's Encrypt HTTPS/SSL certificate, false - use Red5 Pro server without HTTPS/SSL certificate - https_letsencrypt_certificate_domain_name = "red5pro.example.com" # Domain name for Let's Encrypt SSL certificate - https_letsencrypt_certificate_email = "email@example.com" # Email for Let's Encrypt SSL certificate - https_letsencrypt_certificate_password = "examplepass" # Password for Let's Encrypt SSL certificate - + https_letsencrypt_enable = true # true - create new Let's Encrypt HTTPS/SSL certificate, false - use Red5 Pro server without HTTPS/SSL certificate + https_letsencrypt_certificate_domain_name = "red5pro.example.com" # Domain name for Let's Encrypt SSL certificate + https_letsencrypt_certificate_email = "email@example.com" # Email for Let's Encrypt SSL certificate + https_letsencrypt_certificate_password = "examplepass" # Password for Let's Encrypt SSL certificate + # Single Red5 Pro server EC2 instance configuration - single_instance_type = "t3.medium" # Instance type for Red5 Pro server - single_volume_size = 8 # Volume size for Red5 Pro server + single_instance_type = "t3.medium" # Instance type for Red5 Pro server + single_volume_size = 8 # Volume size for Red5 Pro server # Red5Pro server configuration - red5pro_license_key = "1111-2222-3333-4444" # Red5 Pro license key (https://account.red5.net/login) - red5pro_api_enable = true # true - enable Red5 Pro server API, false - disable Red5 Pro server API (https://www.red5.net/docs/development/api/overview/) - red5pro_api_key = "examplekey" # Red5 Pro server API key (https://www.red5.net/docs/development/api/overview/) - red5pro_inspector_enable = false # true - enable Red5 Pro server inspector, false - disable Red5 Pro server inspector (https://www.red5.net/docs/troubleshooting/inspector/overview/) - red5pro_restreamer_enable = false # true - enable Red5 Pro server restreamer, false - disable Red5 Pro server restreamer (https://www.red5.net/docs/special/restreamer/overview/) - red5pro_socialpusher_enable = false # true - enable Red5 Pro server socialpusher, false - disable Red5 Pro server socialpusher (https://www.red5.net/docs/special/social-media-plugin/overview/) - red5pro_suppressor_enable = false # true - enable Red5 Pro server suppressor, false - disable Red5 Pro server suppressor - red5pro_hls_enable = false # true - enable Red5 Pro server HLS, false - disable Red5 Pro server HLS (https://www.red5.net/docs/protocols/hls-plugin/hls-vod/) - red5pro_webhooks_enable = false # true - enable Red5 Pro server webhooks, false - disable Red5 Pro server webhooks (https://www.red5.net/docs/special/webhooks/overview/) - red5pro_webhooks_endpoint = "https://example.com/red5/status" # Red5 Pro server webhooks endpoint - red5pro_round_trip_auth_enable = false # true - enable Red5 Pro server round trip authentication, false - disable Red5 Pro server round trip authentication (https://www.red5.net/docs/special/round-trip-auth/overview/) - red5pro_round_trip_auth_host = "round-trip-auth.example.com" # Round trip authentication server host - red5pro_round_trip_auth_port = 3000 # Round trip authentication server port - red5pro_round_trip_auth_protocol = "http" # Round trip authentication server protocol - red5pro_round_trip_auth_endpoint_validate = "/validateCredentials" # Round trip authentication server endpoint for validate - red5pro_round_trip_auth_endpoint_invalidate = "/invalidateCredentials" # Round trip authentication server endpoint for invalidate - red5pro_cloudstorage_enable = false # true - enable Red5 Pro server cloud storage, false - disable Red5 Pro server cloud storage (https://www.red5.net/docs/special/cloudstorage-plugin/aws-s3-cloud-storage/) - red5pro_cloudstorage_aws_access_key = "" # AWS access key for Red5 Pro cloud storage (S3 Bucket) - red5pro_cloudstorage_aws_secret_key = "" # AWS secret key for Red5 Pro cloud storage (S3 Bucket) - red5pro_cloudstorage_aws_bucket_name = "s3-bucket-example-name" # AWS bucket name for Red5 Pro cloud storage (S3 Bucket) - red5pro_cloudstorage_aws_region = "us-west-1" # AWS region for Red5 Pro cloud storage (S3 Bucket) - red5pro_cloudstorage_postprocessor_enable = false # true - enable Red5 Pro server postprocessor, false - disable Red5 Pro server postprocessor (https://www.red5.net/docs/special/cloudstorage-plugin/server-configuration/) - red5pro_cloudstorage_aws_bucket_acl_policy = "public-read" # AWS bucket ACL policy for Red5 Pro cloud storage (S3 Bucket) Example: none, public-read, authenticated-read, private, public-read-write - red5pro_coturn_enable = false # true - enable customized Coturn configuration for Red5Pro server, false - disable customized Coturn configuration for Red5Pro server (https://www.red5.net/docs/installation/turn-stun/turnstun/) - red5pro_coturn_address = "stun:1.2.3.4:3478" # Customized coturn address for Red5Pro server (https://www.red5.net/docs/installation/turn-stun/turnstun/) - red5pro_efs_enable = false # enable/disable EFS mount to record streams - red5pro_efs_dns_name = "example.efs.region.amazonaws.com" # EFS DNS name + red5pro_license_key = "1111-2222-3333-4444" # Red5 Pro license key (https://account.red5.net/login) + red5pro_api_enable = true # true - enable Red5 Pro server API, false - disable Red5 Pro server API (https://www.red5.net/docs/development/api/overview/) + red5pro_api_key = "examplekey" # Red5 Pro server API key (https://www.red5.net/docs/development/api/overview/) + red5pro_inspector_enable = false # true - enable Red5 Pro server inspector, false - disable Red5 Pro server inspector (https://www.red5.net/docs/troubleshooting/inspector/overview/) + red5pro_restreamer_enable = false # true - enable Red5 Pro server restreamer, false - disable Red5 Pro server restreamer (https://www.red5.net/docs/special/restreamer/overview/) + red5pro_socialpusher_enable = false # true - enable Red5 Pro server socialpusher, false - disable Red5 Pro server socialpusher (https://www.red5.net/docs/special/social-media-plugin/overview/) + red5pro_suppressor_enable = false # true - enable Red5 Pro server suppressor, false - disable Red5 Pro server suppressor + red5pro_hls_enable = false # true - enable Red5 Pro server HLS, false - disable Red5 Pro server HLS (https://www.red5.net/docs/protocols/hls-plugin/hls-vod/) + red5pro_webhooks_enable = false # true - enable Red5 Pro server webhooks, false - disable Red5 Pro server webhooks (https://www.red5.net/docs/special/webhooks/overview/) + red5pro_webhooks_endpoint = "https://example.com/red5/status" # Red5 Pro server webhooks endpoint + red5pro_round_trip_auth_enable = false # true - enable Red5 Pro server round trip authentication, false - disable Red5 Pro server round trip authentication (https://www.red5.net/docs/special/round-trip-auth/overview/) + red5pro_round_trip_auth_host = "round-trip-auth.example.com" # Round trip authentication server host + red5pro_round_trip_auth_port = 3000 # Round trip authentication server port + red5pro_round_trip_auth_protocol = "http" # Round trip authentication server protocol + red5pro_round_trip_auth_endpoint_validate = "/validateCredentials" # Round trip authentication server endpoint for validate + red5pro_round_trip_auth_endpoint_invalidate = "/invalidateCredentials" # Round trip authentication server endpoint for invalidate + red5pro_cloudstorage_enable = false # true - enable Red5 Pro server cloud storage, false - disable Red5 Pro server cloud storage (https://www.red5.net/docs/special/cloudstorage-plugin/aws-s3-cloud-storage/) + red5pro_cloudstorage_aws_access_key = "" # AWS access key for Red5 Pro cloud storage (S3 Bucket) + red5pro_cloudstorage_aws_secret_key = "" # AWS secret key for Red5 Pro cloud storage (S3 Bucket) + red5pro_cloudstorage_aws_bucket_name = "s3-bucket-example-name" # AWS bucket name for Red5 Pro cloud storage (S3 Bucket) + red5pro_cloudstorage_aws_region = "us-west-1" # AWS region for Red5 Pro cloud storage (S3 Bucket) + red5pro_cloudstorage_postprocessor_enable = false # true - enable Red5 Pro server postprocessor, false - disable Red5 Pro server postprocessor (https://www.red5.net/docs/special/cloudstorage-plugin/server-configuration/) + red5pro_cloudstorage_aws_bucket_acl_policy = "public-read" # AWS bucket ACL policy for Red5 Pro cloud storage (S3 Bucket) Example: none, public-read, authenticated-read, private, public-read-write + red5pro_coturn_enable = false # true - enable customized Coturn configuration for Red5Pro server, false - disable customized Coturn configuration for Red5Pro server (https://www.red5.net/docs/installation/turn-stun/turnstun/) + red5pro_coturn_address = "stun:1.2.3.4:3478" # Customized coturn address for Red5Pro server (https://www.red5.net/docs/installation/turn-stun/turnstun/) + red5pro_efs_enable = false # enable/disable EFS mount to record streams + red5pro_efs_dns_name = "example.efs.region.amazonaws.com" # EFS DNS name # Red5 Pro tags configuration - it will be added to all Red5 Pro resources tags = { diff --git a/examples/vpc-only/README.md b/examples/vpc-only/README.md new file mode 100644 index 0000000..f1e777f --- /dev/null +++ b/examples/vpc-only/README.md @@ -0,0 +1,64 @@ +# AWS Red5 VPC only + +This example illustrates how to create a VPC using red5pro module + +* VPC create +* Subnets create +* Route table +* Internet Gateway + +## Preparation + +* Install **terraform** https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli +* Get AWS Access key and AWS Secret key or use existing (AWS IAM - EC2 full access, VPC full access) + +## Usage + +To run this example you need to execute: + +```bash +$ terraform init +$ terraform plan +$ terraform apply +``` + +## Notes + +* To activate HTTPS/SSL you need to add DNS A record for Elastic IP of Red5 Pro server +* Note that this example may create resources which can cost money. Run `terraform destroy` when you don't need these resources. + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0 | +| [aws](#requirement\_aws) | >= 5.0 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 5.0 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [red5pro\_vpc](#module\_red5pro\_vpc) | ../../ | n/a | + +## Resources + +No resources. + +## Inputs + +No inputs. + +## Outputs + +| Name | Description | +|------|-------------| +| [subnet\_ids](#output\_subnet\_ids) | Subnet IDs | +| [vpc\_id](#output\_vpc\_id) | VPC ID | +| [vpc\_name](#output\_vpc\_name) | VPC Name | diff --git a/examples/vpc-only/main.tf b/examples/vpc-only/main.tf new file mode 100644 index 0000000..1a3c381 --- /dev/null +++ b/examples/vpc-only/main.tf @@ -0,0 +1,29 @@ +#################################################################################### +# Create new VPC using red5pro module +#################################################################################### + +provider "aws" { + region = "us-west-1" # AWS region + access_key = "" # AWS IAM Access key + secret_key = "" # AWS IAM Secret key +} + +module "red5pro_vpc" { + source = "../../" + + type = "vpc" # Deployment type: single, cluster, autoscaling, vpc + name = "red5pro-vpc" # Name to be used on all the resources as identifier + + # VPC configuration + vpc_create = true # true - create new VPC, false - use existing VPC + vpc_cidr_block = "10.105.0.0/16" + vpc_public_subnets = ["10.105.0.0/24", "10.105.1.0/24", "10.105.2.0/24", "10.105.3.0/24"] # Public subnets for Stream Manager and Red5 Pro server instances + + # Red5 Pro tags configuration - it will be added to all Red5 Pro resources + tags = { + Terraform = "true" + Environment = "dev" + Project = "red5pro" + } +} + diff --git a/examples/vpc-only/outputs.tf b/examples/vpc-only/outputs.tf new file mode 100644 index 0000000..cc8e787 --- /dev/null +++ b/examples/vpc-only/outputs.tf @@ -0,0 +1,12 @@ +output "vpc_id" { + description = "VPC ID" + value = module.red5pro_vpc.vpc_id +} +output "vpc_name" { + description = "VPC Name" + value = module.red5pro_vpc.vpc_name +} +output "subnet_ids" { + description = "Subnet IDs" + value = module.red5pro_vpc.subnet_ids +} diff --git a/examples/vpc-only/variables.tf b/examples/vpc-only/variables.tf new file mode 100644 index 0000000..e69de29