Skip to content

Commit

Permalink
[Develop] Get region from Identity Document instead of AZ (aws#2812)
Browse files Browse the repository at this point in the history
* Fix an issue in the way we get region when manage volumes so that it can correctly handle local zone.
  • Loading branch information
hehe7318 authored Oct 21, 2024
1 parent 1ce7079 commit f75d84c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ aws-parallelcluster-cookbook CHANGELOG

This file is used to list changes made in each version of the AWS ParallelCluster cookbook.

3.12.0
------

**CHANGES**

**BUG FIXES**
- Fix an issue in the way we get region when manage volumes so that it can correctly handle local zone.

3.11.1
------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ def handle_volume(volume_id, attach, detach):

instance_id = get_metadata_value(token, "http://169.254.169.254/latest/meta-data/instance-id")

region = get_metadata_value(token, "http://169.254.169.254/latest/meta-data/placement/availability-zone")
region = region[:-1]
identity_document = get_metadata_value(token, "http://169.254.169.254/latest/dynamic/instance-identity/document")
identity = json.loads(identity_document)
region = identity["region"]

proxy_config = parse_proxy_config()

Expand Down

0 comments on commit f75d84c

Please sign in to comment.