Posted On March 31, 2019

AWS Autoscale with Public IP re-association

kimconnect 0 comments
blog.KimConnect.com >> Virtualization >> AWS Autoscale with Public IP re-association
Option 1:
--associate-public-ip-address command option with the as-create-launch-config command

Option 2:
Allocate an Elastic IP then adding a startup script in the Create Launch Configuration -> Configure Details -> Advanced Details -> User data:
--------------------------------------
#!/bin/bash

# configure AWS
aws configure set aws_access_key_id $accessKey
aws configure set aws_secret_access_key $secretAccessKey
aws configure set region {MY_REGION}

# associate Elastic IP
INSTANCE_ID=$(curl -s
ALLOCATION_ID={MY_EIP_ALLOC_ID}
aws ec2 associate-address --instance-id $INSTANCE_ID --allocation-id $ALLOCATION_ID --allow-reassociation
----------------------------------------

Example (SMTP01)
--------------------------------------
#!/bin/bash

# configure AWS
aws configure set aws_access_key_id $accessKey
aws configure set aws_secret_access_key $secretAccessKey
aws configure set region us-west-1b

# associate Elastic IP
INSTANCE_ID=$(curl -s
ALLOCATION_ID=i-80b45e42
aws ec2 associate-address --instance-id $INSTANCE_ID --allocation-id $ALLOCATION_ID --allow-reassociation

----------------------------------------

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Example of a HipChat Server Installation

FQDN: hipchat.kimconnect.com Internal IP: 10.10.100.205 Public IP: 12.12.12.12   Firewall configurations: inbound TCP 443 inbound…

SAN Dell Equallogic PS6100E

Per documentation: Port density requirements to support fully redundant configurations and maximum SAN throughput for…

PowerShell: Get Spectre Meltdown Patching Versions of Hyper-V Hosts

function getHyperVHostsInForest{ function includeRSAT{ $ErrorActionPreference='stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 #$rsatWindows7x32='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x86-RefreshPkg.msu' $rsatWindows7x64='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x64-RefreshPkg.msu' $rsatWindows81='https://download.microsoft.com/download/1/8/E/18EA4843-C596-4542-9236-DE46F780806E/Windows8.1-KB2693643-x64.msu' $rsat1709 = "https://download.microsoft.com/download/1/D/8/1D8B5022-5477-4B9A-8104-6A71FF9D98AB/WindowsTH-RSAT_WS_1709-x64.msu" $rsat1803…