Tomas Moreno
03/26/2024, 7:34 PMAWS_DEFAULT_REGION: "{{ prefect_aws.awscredentials.my-aws-credentials.REGION_NAME }}"
AWS_ACCESS_KEY_ID: "{{ prefect_aws.awscredentials.my-aws-credentials.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "{{ prefect_aws.awscredentials.my-aws-credentials.AWS_SECRET_ACCESS_KEY }}"
tried a few different variations of the above without much luck.Kevin Grismore
03/26/2024, 7:37 PMTomas Moreno
03/26/2024, 7:39 PMKevin Grismore
03/26/2024, 7:51 PMKevin Grismore
03/26/2024, 7:52 PMKevin Grismore
03/26/2024, 7:53 PMTomas Moreno
03/27/2024, 1:38 PMTomas Moreno
03/27/2024, 1:38 PMAlex Ilyin
04/10/2024, 9:51 PMaws-secret
block. I’ve been calling it following the syntax you shared of "{{ prefect.blocks.aws-credentials.your-block-name }}"
but I’m hitting this error:
prefect.utilities.dockerutils.BuildError: error reading build args: json: cannot unmarshal object into Go value of type string
I’m trying to pass the value of the block into the buildargs
param of a build_docker_image
step, which is expecting a string. My understanding is that the block value is returning a json. do you know of a way to get around this?Kevin Grismore
04/10/2024, 9:53 PMKevin Grismore
04/10/2024, 9:55 PMAlex Ilyin
04/10/2024, 9:55 PMAlex Ilyin
04/10/2024, 9:56 PM- prefect_docker.deployments.steps.build_docker_image:
id: build-image
requires: prefect-docker
image_name: ABC
tag: '{{ get-commit-hash.stdout }}'
platform: linux/amd64
buildargs:
GITHUB_USER: 'XYZ'
GITHUB_TOKEN: "{{ prefect.blocks.aws-secret.alex-ilyin-github-token }}"
Alex Ilyin
04/10/2024, 9:57 PMKevin Grismore
04/10/2024, 9:57 PMsecret_name
which would be the name of your secret in awsAlex Ilyin
04/10/2024, 9:57 PMKevin Grismore
04/10/2024, 9:58 PMAlex Ilyin
04/10/2024, 9:58 PMAlex Ilyin
04/10/2024, 9:58 PMKevin Grismore
04/10/2024, 10:00 PMAwsSecret
block just stores the secret's name and some credentials. the block class in python provides methods you can call that use the block's contents to go and grab the secret from AWSAlex Ilyin
04/10/2024, 10:01 PMGITHUB_TOKEN: "{{ prefect.blocks.aws-secret.alex-ilyin-github-token.read_secret() }}"
could work?Kevin Grismore
04/10/2024, 10:02 PMAlex Ilyin
04/10/2024, 10:02 PMKevin Grismore
04/10/2024, 10:02 PMKevin Grismore
04/10/2024, 10:03 PMKevin Grismore
04/10/2024, 10:04 PMKevin Grismore
04/10/2024, 10:07 PMAlex Ilyin
04/10/2024, 10:09 PMAlex Ilyin
04/10/2024, 10:10 PMKevin Grismore
04/10/2024, 10:11 PMAlex Ilyin
04/10/2024, 10:12 PMAlex Ilyin
04/10/2024, 10:12 PMAlex Ilyin
04/10/2024, 10:12 PM