outerbounds / terraform-aws-metaflow

Deploy production-grade Metaflow cloud infrastructure on AWS
https://registry.terraform.io/modules/outerbounds/metaflow/aws/latest
Apache License 2.0
58 stars 49 forks source link

Move database migration script to a dedicated file #63

Open CommanderK5 opened 1 year ago

CommanderK5 commented 1 year ago

Hi!

Currently, every plan (in a CI/CD run) for this module results in update even though the Terraform code hasn’t changed. This is because of the index.py migration script being generated from tf. Moving this script to a file resolve this problem.

<= data "archive_file" "db_migrate_lambda" {
      + id                  = (known after apply)
      + output_base64sha256 = (known after apply)
      + output_file_mode    = "0666"
      + output_md5          = (known after apply)
      + output_path         = ".terraform/modules/metaflow/modules/metadata-service/db_migrate_lambda.zip"
      + output_sha          = (known after apply)
      + output_size         = (known after apply)
      + source_file         = ".terraform/modules/metaflow/modules/metadata-service/index.py"
      + type                = "zip"
    }

  # module.metaflow.module.metaflow-metadata-service.aws_lambda_function.db_migrate_lambda will be updated in-place
  ~ resource "aws_lambda_function" "db_migrate_lambda" {