AWS
14 TopicsAWS S3 Proxy: JavaScript iRuleLX
Problem this snippet solves: Create a secure proxy to AWS S3 via iRule/IRuleLX Related Article: Creating a Secure AWS S3 Proxy with F5 iRulesLX How to use this snippet: Install iRule via iRulesLX Workspace Create iRulesLX plugin Create AWS role or IAM credentials Create FQDN pool to AWS S3 Create Virtual Server Enable OneConnect and WebAcceleration profiles Assign iRule to Virtual Server Code : var f5 = require('f5-nodejs'); var ilx = new f5.ILXServer(); var url = require('url'); var URI = require('urijs'); var AWS = require('aws-sdk'); // optionally use config.json with stored credentials or assign Role when running in AWS //AWS.config.loadFromPath('./config.json'); var s3 = new AWS.S3(); ilx.addMethod('aws_s3_rpc_add_creds', function(req, res) { var path = req.params()[0]; var params = {Bucket:"secure-bucket", Key: path }; var signed_url = s3.getSignedUrl('getObject',params); var parsedUrl = new URI(signed_url); var q = parsedUrl.search(true); var expires = parseInt(q['Expires']); var expire_after = Math.round(expires - (new Date() / 1000)); res.reply([parsedUrl.query(),expires, expire_after]); }); ilx.listen(); Tested this on version: 13.01.1KViews1like6CommentsBIGIP VE SR-IOV 10G xml template
Problem this snippet solves: mapping SR-IOV VF to guest can be confusing, especially when using command line like virsh to create BIGIP VE on KVM hypvervisor, following is a snippet example for defining Intel 82599 VF in xml for reference. change the bus, slot, function accordingly in your environment How to use this snippet: virsh define virsh start Code : 69849 Tested this on version: 12.0346Views0likes1CommentIPSec Tunnel Endpoint iApp
Problem this snippet solves: This iAPP template creates a complete configuration for establishing an IPSec tunnel between a Windows Azure virtual network and your F5 protected corporate network. Additionally, this iApp may be utilized for establishing site-2-site VPN between any compatible IPSec device. The BIG-IP supports both policy and route-based VPNs. Contributed by: Gregory Coward, Solution Architect Code : 75380 Tested this on version: 12.0720Views0likes4CommentsAWS S3 Proxy: TCL iRule
Problem this snippet solves: Create a secure proxy to AWS S3 via iRule/IRuleLX Related Article: Creating a Secure AWS S3 Proxy with F5 iRulesLX How to use this snippet: Install iRule via iRulesLX Workspace Create iRulesLX plugin Create AWS role or IAM credentials Create FQDN pool to AWS S3 Create Virtual Server Enable OneConnect and WebAcceleration profiles Assign iRule to Virtual Server Code : when HTTP_REQUEST { set orig_path [string trimleft [HTTP::path] "/"] set key "s3:$orig_path" set data [table lookup -notouch $key] if { $data eq "" } { set RPC_HANDLE [ILX::init aws_s3_rpc_plugin aws_s3_rpc_ext] set rpc_response [ILX::call $RPC_HANDLE aws_s3_rpc_add_creds $orig_path] set qs [ lindex $rpc_response 0] set expires [lindex $rpc_response 1] set time_to_expires [lindex $rpc_response 2] # save value in cache table set $key $qs $time_to_expires $time_to_expires } else { # use cached value set qs $data } } when HTTP_REQUEST_SEND { clientside { HTTP::header replace Host "secure-bucket.s3.amazonaws.com" # specify bucket HTTP::uri "/$orig_path?$qs" #log local0. "https://secure-bucket.s3.amazonaws.com[HTTP::uri]" } } when HTTP_RESPONSE { # remove identifying data HTTP::header remove "Server" HTTP::header remove "x-amz-id-2" HTTP::header remove "x-amz-request-id" if { [HTTP::status] contains "403"} { HTTP::respond 404 content "not found" } } Tested this on version: 13.0678Views0likes0CommentsChecksums for F5 Supported Cloud templates on GitHub
Problem this snippet solves: Checksums for F5 supported cloud templates F5 Networks provides checksums for all of our supported Amazon Web Services CloudFormation, Microsoft Azure ARM, Google Deployment Manager, and OpenStack Heat Orchestration templates. See the README files on GitHub for information on individual templates. You can find the templates in the appropriate supported directory on GitHub: Amazon CloudFormation templates: https://github.com/F5Networks/f5-aws-cloudformation/tree/master/supported Microsoft ARM Templates: https://github.com/F5Networks/f5-azure-arm-templates/tree/master/supported Google Templates: https://github.com/F5Networks/f5-google-gdm-templates VMware vCenter Templates: https://github.com/F5Networks/f5-vmware-vcenter-templates OpenStack Heat Orchestration Templates: https://github.com/F5Networks/f5-openstack-hot F5 Ansible Modules: http://docs.ansible.com/ansible/latest/list_of_network_modules.html#f5 Because this page was getting much too long to host all the checksums for all Cloud platforms, we now have individual pages for the checksums: Amazon AWS checksums Microsoft Azure checksums Google Cloud checksums VMware vCenter checksums OpenStack Heat Orchestration checksums F5 Ansible Module checksums Code : You can get a checksum for a particular template by running one of the following commands depending on your operating system: * **Linux**: `sha512sum ` * **Windows using CertUtil**: `CertUtil –hashfile SHA512`4.5KViews0likes0CommentsTerraform template - AWS variables
Problem this snippet solves: Terraform template - AWS variables Code : variable "ha_enabled" { default = "0" } variable "region" { default = "us-east-1" } provider "aws" { access_key = "access" secret_key = "secret" region = "${var.region}" } variable "dut-ami" { default = { us-east-1 = "ami-key" } }274Views0likes0CommentsTerraform template - AWS autoscaling
Problem this snippet solves: Terraform template - AWS autoscaling Code : resource "aws_launch_configuration" "lc_conf" { name_prefix = "lc-example-" image_id = "ami-id" instance_type = "t2.micro" lifecycle { create_before_destroy = false } } resource "aws_autoscaling_group" "asg_group" { name = "asg_group" launch_configuration = "${aws_launch_configuration.lc_conf.name}" max_size = 2 min_size = 0 desired_capacity = 0 vpc_zone_identifier = ["${aws_subnet.internal.id}"] availability_zones = ["${aws_subnet.management.availability_zone}"] wait_for_capacity_timeout = 0 lifecycle { create_before_destroy = false } }251Views0likes0CommentsTerraform template - AWS Cloud-Init
Problem this snippet solves: Terraform template - AWS Cloud-Init Code : #cloud-config # vim: syntax=yaml # # This is the configuration syntax that the write_files module # will know how to understand. encoding can be given b64 or gzip or (gz+b64). # The content will be decoded accordingly and then written to the path that is # provided. # # Note: Content strings here are truncated for example purposes. write_files: - content: | /usr/bin/tmsh modify auth user admin shell bash echo "Executed!" >> /root/example path: /root/example runcmd: - chmod 755 /root/example - /root/example - [ /root/example ]297Views0likes0CommentsTerraform template - AWS instance
Problem this snippet solves: Terraform template - AWS instance Code : resource "aws_instance" "f5" { ami = "ami-id" instance_type = "m3.xlarge" associate_public_ip_address = true private_ip = "10.0.0.21" availability_zone = "${aws_subnet.management.availability_zone}" subnet_id = "${aws_subnet.management.id}" security_groups = ["${aws_security_group.allow_all.id}"] vpc_security_group_ids = ["${aws_security_group.allow_all.id}"] #user_data = "${file("cloud-config.yaml")}" key_name = "key-name" root_block_device { delete_on_termination = true } tags { Name = "f5" License = "License" } }244Views0likes0Comments