EC2-ASSOCIATE-ADDRESS(1)

πŸ“¦ version 1.6.14.1, in ubuntu jammy, ubuntu noble

πŸ’– 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 the AWS_ACCESS_KEY environment variable is set to (if it's set, obviously πŸ™ˆ).
  • -W, --aws-secret-key KEY β€” your AWS Secret Access Key. defaults to the AWS_SECRET_KEY environment variable (if set).
  • -T, --security-token TOKEN β€” the AWS delegation token. defaults to the AWS_DELEGATION_TOKEN environment variable (if set).
  • -K, --private-key KEY β€” [DEPRECATED] use KEY as the private key. defaults to the value of the EC2_PRIVATE_KEY environment variable (if set). overrides the default. (deprecated bestie, just so you know πŸ’€)
  • -C, --cert CERT β€” [DEPRECATED] use CERT as the X509 certificate. defaults to the value of the EC2_CERT environment variable (if set). overrides the default. (also deprecated, okurrr)
  • -U, --url URL β€” use URL as the web service URL. defaults to https://ec2.amazonaws.com (that's us-east-1) or to whatever EC2_URL is set to (if set). overrides the default.
  • --region REGION β€” use REGION as the web service region. this one overrides the URL you gave with -U URL and the EC2_URL environment variable. it defaults to the region from the EC2_URL environment variable, or us-east-1 if 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 timeout TIMEOUT, in seconds.
  • --request-timeout TIMEOUT β€” set a request timeout TIMEOUT, in seconds.

πŸŽ€ SPECIFIC OPTIONS πŸŽ€

the ones that are literally just for this command:

  • -a, --allocation-id β€” the ALLOCATION_ID to 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 πŸ”₯


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