Customizing the Environment
Private Container Registries
Using private AWS ECR images
Export your AWS credentials in your shell and pass the environment variable names to base_image_creds
as a list. This syntax will lookup the environment variable values for you.
image = Image(
base_image="111111111111.dkr.ecr.us-east-1.amazonaws.com/my-app:latest",
base_image_creds=[
"AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY",
"AWS_SESSION_TOKEN",
"AWS_REGION",
],
)
@endpoint(image=image)
def squared(i: int = 0) -> int:
return i**2
We also accept a dict where you can provide the values.
image = Image(
base_image="111111111111.dkr.ecr.us-east-1.amazonaws.com/my-app:latest",
base_image_creds={
"AWS_ACCESS_KEY_ID": "xxxx",
"AWS_SECRET_ACCESS_KEY": "xxxx"
"AWS_REGION": "xxxx"
},
)
You can authenticate with either your static AWS credentials or an AWS STS
token. The latter requires that the AWS_SESSION_TOKEN
key be set.
Was this page helpful?