EC2-ASSOCIATE-ADDRESS(1)
π EC2-ASSOCIATE-ADDRESS π
okay bestie, welcome to EC2-ASSOCIATE-ADDRESS(1), part of the User Commands section, and honestly? she's a whole vibe. this is the little tool that goes "here, have a public IP" and hands an Elastic IP to an instance or a network interface. no cap.
β¨ NAME β¨
ec2-associate-address β Associate a public address with an instance π«Ά
πΈ SYNOPSIS πΈ
ec2assocaddr ([ec2-associate-address])
ec2assocaddr [GENERAL OPTIONS] { IP | -a ALLOCATION_ID } { -i INSTANCE | -n NETWORK_INTERFACE }
π GENERAL NOTES π
so, the iconic little trick: any command option or parameter can be handed a value of -, and that means "hey, read the values for this option from stdin instead." that's it. that's the note. chef's kiss.
π¦ DESCRIPTION π¦
we're associating a public address with an instance or a network interface. slay.
here's the tea on the IP parameter: that's the address you associate for non-VPC instances. but if you're dealing with VPC instances, bestie, you gotta specify an allocation ID instead, or a private IP address. the IP route is not the move there. periodt.
π GENERAL OPTIONS π
everybody's shared faves, coming through:
-O,--aws-access-key KEYβ your AWS Access Key ID. defaults to whatever theAWS_ACCESS_KEYenvironment variable is set to (if it's set, obviously π).-W,--aws-secret-key KEYβ your AWS Secret Access Key. defaults to theAWS_SECRET_KEYenvironment variable (if set).-T,--security-token TOKENβ the AWS delegation token. defaults to theAWS_DELEGATION_TOKENenvironment variable (if set).-K,--private-key KEYβ [DEPRECATED] useKEYas the private key. defaults to the value of theEC2_PRIVATE_KEYenvironment variable (if set). overrides the default. (deprecated bestie, just so you know π)-C,--cert CERTβ [DEPRECATED] useCERTas the X509 certificate. defaults to the value of theEC2_CERTenvironment variable (if set). overrides the default. (also deprecated, okurrr)-U,--url URLβ useURLas the web service URL. defaults tohttps://ec2.amazonaws.com(that's us-east-1) or to whateverEC2_URLis set to (if set). overrides the default.--region REGIONβ useREGIONas the web service region. this one overrides the URL you gave with-U URLand theEC2_URLenvironment variable. it defaults to the region from theEC2_URLenvironment variable, orus-east-1if that variable isn't set.-D,--auth-dry-runβ checks whether you could do the thing instead of actually doing the thing. window shopping energy β¨-v,--verboseβ verbose output. she's chatty.-?,--helpβ display this help.-H,--headersβ display column headers.--debugβ display extra debugging information.--show-empty-fieldsβ indicate empty fields.--hide-tagsβ do not display tags for tagged resources. bye tags π--connection-timeout TIMEOUTβ set a connection timeoutTIMEOUT, in seconds.--request-timeout TIMEOUTβ set a request timeoutTIMEOUT, in seconds.
π SPECIFIC OPTIONS π
the ones that are literally just for this command:
-a,--allocation-idβ theALLOCATION_IDto use for the operation. used for VPC elastic IP addresses.-i,--instanceβ the instance to associate an EIP with.-n,--network-interfaceβ the network interface to associate an EIP with.-p,--private-ip-addressβ the private IP address to associate an EIP with.--allow-reassociationβ lets an Elastic IP that's already associated with an instance or a network interface get re-associated with the instance or network interface you specified. otherwise? the operation just fails. so if you want the glow-up, you need this flag. π
heads up bestie: without --allow-reassociation, moving an already-associated EIP is a hard no β the operation fails. don't say i didn't warn you. π
π₯ SEE ALSO π₯
http://docs.amazonwebservices.com/AWSEC2/2014-05-01/CommandLineReferencehttp://docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference
and that's the whole page, bestie!! this was EC2 API command line tools, version 1.6.14.1, api=2014-05-01 β go forth and associate those addresses, you absolute icon ππβ¨
π¦ where this page comes from
- ubuntu jammy: ec2-api-tools 1.6.14.1-0ubuntu1
- ubuntu noble: ec2-api-tools 1.6.14.1-0ubuntu2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms