Skip to content

Commit 6080e9d

Browse files
bors[bot]cole-p
andauthored
Merge #535
535: Treat 'RoleArn' as an optional field when fetching ECS credentials r=mattBrzezinski a=cole-p Port the following changes made to AWSCore.jl: JuliaCloud/AWSCore.jl#139 > The [ECS developers guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) implies that the `RoleArn` field should always be returned when querying the container's credential endpoint, however this isn't always the case for Amazon SageMaker jobs. > >Amazon avoids this in [botocore](https://github.com/boto/botocore/blob/21b06efb39da61fe4101ab9709140dc1e51dc33d/botocore/credentials.py#L1886-L1889) by not accessing the `RoleArn` field. Co-authored-by: Cole Peters <[email protected]>
2 parents cb11877 + e16bc35 commit 6080e9d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AWS"
22
uuid = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
33
license = "MIT"
4-
version = "1.74.0"
4+
version = "1.74.1"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/AWSCredentials.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ function ecs_instance_credentials()
339339
new_creds["AccessKeyId"],
340340
new_creds["SecretAccessKey"],
341341
new_creds["Token"],
342-
new_creds["RoleArn"];
342+
# The RoleArn field may not be present for Amazon SageMaker jobs
343+
get(new_creds, "RoleArn", "");
343344
expiry=expiry,
344345
renew=ecs_instance_credentials,
345346
)

0 commit comments

Comments
 (0)