A stack is usually designed to fit with the config and require the minimum number of files. But Cycloid doesn’t impose a specific behavior. You can define or override everything with the config.

To give an example, we will use the public Magento stack and override a Terraform file (ami.tf) https://github.com/cycloid-community-catalog/stack-magento/blob/master/terraform/module-magento/ami.tf

As briefly described in Working with private stacks, the following behavior is not linked to Terraform or overriding files, you can create new files or use it with Ansible.

To achieve this, simply go in the config repository and create the same relative path as the stack.

  • Path in the stack: <stack repository>/terraform/module-magento/ami.tf
  • Expected path in config: <config repository>/terraform/<env>/module-magento/ami.tf

Sample of the new file <config repository>/terraform/<env>/module-magento/ami.tf

data "aws_ami" "debian_jessie" {
  most_recent = false
  filter {
    name   = "name"
    values = ["overrided …. "]
  }
1
2
3
4
5
6

To get more details of the merge, see the merge-catalog-and-config task in the pipeline.

The path could differ between stacks, as it’s related to the pipeline design. For private stack this path usually contain a sub-directory with the project name : ex with a stack called infrastructure implemented by an env called infra :

Stack path: <stack repository>/stack-infrastructure/terraform/foo.ft

Config path: <config repository>/infrastructure/terraform/infra/foo.ft