James Gibbard
04/16/2021, 2:11 PMKevin Kho
James Gibbard
04/16/2021, 2:15 PMprefect register
I'd like to use a aws profile called "production", and when the Prefect Cloud runs the flow, it uses an aws profile to download the flow from S3 using the "default" aws profile.James Gibbard
04/16/2021, 2:20 PM...
with Flow(
"flow1",
executor=DaskExecutor(),
storage=S3(
bucket="<bucket>",
stored_as_script=True,
client_options={"region_name": "eu-west-1", "profile_name": "production"},
),
...
I'd like to be able to use "production" when registering the flow and "default" when the flow gets executed. Is that possible?Kevin Kho
AWS_PROFILE
for example and then load it in for the profile name.Kevin Kho
Parameters
James Gibbard
04/16/2021, 2:31 PMKevin Kho
Kevin Kho
with Flow as flow:
task()
flow.storage = S3("prod")
if __name__ == "__main__":
flow.storage = S3("default")
James Gibbard
04/16/2021, 3:25 PMprefecthq/prefect:latest-python3.8
container in AWS ECS Fargate and have provided the ESC Task the permissions to read the S3 bucket that the flow script is in. I was hoping that the perfect boto3 authentication would use the auto-discovered method of auth, assume the task role and access the flow script. But I' getting the following error: Error downloading Flow from S3: An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
The AWS docs say that:
"If your container instance is using at least version 1.11.0 of the container agent and a supported version of the AWS CLI or SDKs, then the SDK client will see that the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
variable is available, and it will use the provided credentials to make calls to the AWS APIs."
Is the prefect container and boto3 auth able to make use of this method? ThanksKevin Kho