Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
idanovinda committed Jan 29, 2024
1 parent 06fc26d commit b6a1320
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion postgres-appliance/scripts/callback_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ def wrapped(*args, **kwargs):

return wrapped


def get_instance_metadata():
response = requests.put('http://169.254.169.254/latest/api/token', headers={'X-aws-ec2-metadata-token-ttl-seconds': '60'})
response = requests.put(
url='http://169.254.169.254/latest/api/token',
headers={'X-aws-ec2-metadata-token-ttl-seconds': '60'}
)
token = response.text
headers = {'X-aws-ec2-metadata-token': token}

instance_id = requests.get('http://169.254.169.254/latest/dynamic/instance-identity/document', headers=headers)
return instance_id.json()


@retry
def associate_address(ec2, allocation_id, instance_id):
return ec2.associate_address(instance_id=instance_id, allocation_id=allocation_id, allow_reassociation=True)
Expand Down

0 comments on commit b6a1320

Please sign in to comment.