Skip to content

feat: include the providers block as part of tf promise init in the CLI #187

@catmo-syntasso

Description

@catmo-syntasso

Context

At present the cli's init tf-module-promise creates a resource.configure workflow which uses the terraform-module image. This image uses the user inputs to generate a terraform document that populates the configuration for the module but no other top-level fields e.g.

{
  "module": {
    "vpc_default_example-vpc": {
      "amazon_side_asn": "64512",
      "cidr": "10.0.0.0/16",
      "create_database_internet_gateway_route": false,
      "create_database_nat_gateway_route": false,
      "create_database_subnet_group": true,
...
    }
  }
}

In particular, the command never populates a provider block and if one is configured in the module, it is ignored. Some users have added this manually but this is something that could be made easier by the init.

Acceptance

Given there is a providers block defined in my module
When I run kratix init tf-module-promise eks --module-version v0.0.1  --module-source /Users/sapphire/workspace/eks  --group syntasso.io --kind EKS --version v1alpha1 --dir promise
Then that providers in declared in the generated Terraform documents(s)

Questions to answer:

  • What is the best place to configure the providers?
  • How should to providers be fetched?
  • What happens if there are multiple provider blocks? - can't have duplicates
    • Put it in the promise workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions