PowerDataHub / terraform-aws-airflow

Terraform module to deploy an Apache Airflow cluster on AWS, backed by RDS PostgreSQL for metadata, S3 for logs and SQS as message broker with CeleryExecutor
Apache License 2.0
84 stars 40 forks source link

Add custom tags #24

Closed fmunteanu closed 4 years ago

fmunteanu commented 4 years ago

At Expedia we tag resources with specific tags related to project, etc. If these tags are not present, resources will be automatically deleted. Therefore, I implemented the missing tags into terraform-terraform-label modules.

I also added a specific version for the terraform-terraform-label source. With the cluster in production, using master will definitely introduce a risk factor, as mentioned into their documentation. Unfortunately, we cannot use variables into source.

From their documentation:

IMPORTANT: The master branch is used in source just as an example. In your code, do not pin to master because there may be breaking changes between releases. Instead pin to the release tag (e.g. ?ref=tags/x.y.z) of one of our latest releases.

edbizarro commented 4 years ago

Hi @fmunteanu

Would you mind including an example of use in the example folder?

Thanks!

fmunteanu commented 4 years ago

Good morning @edbizarro, let me know if is satisfactory. This is an example, while planning:

  # module.airflow_cluster.module.sg_airflow.aws_security_group.this_name_prefix[0] will be created
  + resource "aws_security_group" "this_name_prefix" {
      + arn                    = (known after apply)
      + description            = "Security group for floren-dev-airflow machines"
      + egress                 = (known after apply)
      + id                     = (known after apply)
      + ingress                = (known after apply)
      + name                   = (known after apply)
      + name_prefix            = "floren-dev-airflow-sg-"
      + owner_id               = (known after apply)
      + revoke_rules_on_delete = false
      + tags                   = {
          + "Name"      = "floren-dev-airflow-sg"
          + "Namespace" = "floren"
          + "Role"      = "airflow-infrastructure"
          + "Stage"     = "dev"
          + "Team"      = "AI Labs"
        }
      + vpc_id                 = "vpc-08269f58d24108b45"
    }