Patricio Navarro
07/25/2024, 10:41 AMMarvin
07/25/2024, 10:42 AMhcl
# Define the AWS credentials block
resource "prefect_aws_credentials" "aws_creds" {
name = "my-aws-credentials"
access_key_id = var.aws_access_key_id # Ensure you have these variables defined elsewhere
secret_access_key = var.aws_secret_access_key # Ensure you have these variables defined elsewhere
region = var.aws_region # Ensure you have these variables defined elsewhere
}
# Optional: Define a block to utilize AWS S3 storage
resource "prefect_s3_bucket_storage" "s3_storage" {
name = "my-s3-storage"
bucket_name = var.s3_bucket_name # Ensure you have these variables defined elsewhere
aws_credentials = prefect_aws_credentials.aws_creds.name
}
Here's what this configuration does:
- Defines an aws_creds
resource of type prefect_aws_credentials
.
- Uses the variables aws_access_key_id
, aws_secret_access_key
, and aws_region
which should be defined in your Terraform variables.
For further guidance, you can reference the Prefect documentation and the Terraform provider for Prefect here (Note that links are provided as a source but might not directly contain Terraform specifics).
If you need an example of how to create AWS credentials within Prefect documentation or code examples, you might need to adapt based on the specifics of your Prefect setup. You can always refer to Prefect and Terraform documentation for more specific use cases.