Skip to content

Latest commit

 

History

History
145 lines (113 loc) · 7.74 KB

README.md

File metadata and controls

145 lines (113 loc) · 7.74 KB

AWS Spirent TestCenter Virtual Terraform

Description

Spirent TestCenter Virtual (STCv) is a traffic generator used to verify network operation and performance. This Terraform module will deploy instances of a Spirent TestCenter Virtual AMI to AWS EC2 for VPC testing.

A controller application like the Spirent TestCenter Application is needed to run traffic tests. Log on to support.spirent.com to download the application installer. On the Downloads page set the filter to Product Line=Spirent TestCenter, Categories=Applications, and Operating System=Windows 64-bit to find a Spirent TestCenter Application download link. Install on your local PC or in the cloud (see terraform-aws-stc-gui). Please ensure that the application and AMI version match.

For additional AWS testing information see Spirent Knowledge Base article "Spirent TestCenter Virtual AWS Machine Image Quick Start Guide".

Prerequisites

  • AWS user credentials (environment variables AWS_ACCESS_KEY_ID & AWS_SECRET_ACCESS_KEY)
  • Accept Spirent TestCenter Virtual AMI product subscription on AWS Marketplace
  • Create an EC2 key pair on AWS for SSH access
  • Create a cloud-init user-data file

Terraform examples

Terraform examples are located in the examples folder.

Basic usage

module "stcv" {
  source = "git::https://github.com/Spirent-Terraform-Modules/terraform-aws-stcv"

  vpc_id         = "vpc-123456789"
  instance_count = 2

  mgmt_plane_subnet_id  = "subnet-123456789"
  test_plane_subnet_ids = ["subnet-234567891"]

  ingress_cidr_blocks = ["0.0.0.0/0"]

  key_name       = "bootstrap_key"
  user_data_file = "./cloud-init.yaml"
}

Requirements

Name Version
terraform >= 0.13.0
aws >= 2.65

Providers

Name Version
aws >= 2.65
random n/a
template n/a

Modules

No Modules.

Resources

Name
aws_ami
aws_eip_association
aws_instance
aws_network_interface
aws_security_group
random_id
template_file

Inputs

Name Description Type Default Required
ami The Spirent TestCenter Virtual AMI. When not specified, the latest marketplace image will be used. string "" no
ingress_cidr_blocks List of management interface ingress IPv4/IPv6 CIDR ranges. Set to empty list when using mgmt_plane_security_group_ids. list(string) n/a yes
instance_count Number of instances to create number 2 no
instance_name_prefix Name assigned to the instance. An instance number will be appended to the name. string "stcv-" no
instance_type AWS instance type string "m5.large" no
key_name AWS SSH key name to assign to each instance string n/a yes
mgmt_plane_eips List of management plane elastic IP IDs. Leave empty if subnet auto assigns IPs. list(string) [] no
mgmt_plane_security_group_ids List of management plane security group IDs. Leave empty to create a default security group using ingress_cidr_blocks. list(string) [] no
mgmt_plane_subnet_id Management public AWS subnet ID string n/a yes
root_block_device Customize details about the root block device of the instance. See Block Devices below for details. list(map(string)) [] no
test_plane_security_group_ids List of test plane security group IDs. Leave empty to create a default security group. list(string) [] no
test_plane_subnet_ids Test plane AWS subnet ID list. Each instance will have a network interface on each subnet. list(string) n/a yes
user_data_file File path name containing AWS user data for the instance. Spirent TestCenter Virtual cloud-init configuration parameters are supported. string n/a yes
vpc_id AWS VPC ID string n/a yes

Outputs

Name Description
instance_ids List of instance IDs
instance_private_ips List of private IP addresses assigned to the instances, if applicable
instance_public_ips List of public IP addresses assigned to the instances, if applicable
stcv_ami Latest Sprient TestCenter Virtual public AMI
test_plane_private_ips List of private IP addresses assigned to the test interface eth1 of instances, if applicable

User Data (cloud-init)

Example

#cloud-config
spirent:
  driver: dpdk
  speed: 10G

Parameters

Name Description Type Default
speed Maximum network interface speed 1G, 5G, 10G, 25G, 50G, 100G 1G
driver Network driver interface sockets, dpdk dpdk (for supported cloud provider instances)
rxq RX queue size for dpdk driver 1-N 1
benchmark Turn benchmark rate mode on or off for dpdk driver off, on off
ntp NTP server IP address x.x.x.x (cloud provider recommended)
ipv4mode IPv4 address mode none, static, dhcp dhcp
ipaddress IPv4 address (static mode) IPv4 address -
netmask IPv4 netmask (static mode) IPv4 netmask -
gwaddress IPv4 gateway address (static mode) IPv4 gateway address -
ipv6mode IPv6 address mode none, static, dhcp none
ipv6address IPv6 address (static mode) IPv6 address -
ipv6prefixlen IPv6 prefix length (static mode) IPv6 prefix length -
ipv6gwaddress IPv6 gateway address (static mode) IPv6 gateway address -
gvtap Turn Gigamon gvtap agent on or off off, on off

Block Devices

Root Block Device

The root_block_device mapping supports the following:

Name Description Type Default Required
delete_on_termination Whether the volume should be destroyed on instance termination. string true no
encrypted Whether to enable volume encryption. Must be configured to perform drift detection. bool false no
iops Amount of provisioned IOPS. Only valid for volume_type of io1, io2 or gp3. number n/a no
kms_key_id Amazon Resource Name (ARN) of the KMS Key to use when encrypting the volume. Must be configured to perform drift detection. string n/a no
tags A map of tags to assign to the device. map(string) {} no
throughput Throughput to provision for a volume in mebibytes per second (MiB/s). This is only valid for volume_type of gp3. number n/a no
volume_size Size of the volume in gibibytes (GiB). number n/a no
volume_type Type of volume. Valid values include standard, gp2, gp3, io1, io2, sc1, or st1. string gp2 no