How do use renovate (or similar) to keep cloudposs...
# atmos
r
How do use renovate (or similar) to keep cloudposse vendored components up to date? Looking for something that would 1. Set the version to be the latest github-release 2. Run atmos vendor pull and commit any additional files
✅ 1
I’m thinking maybe a reusable renovate comment
Copy code
- component: "aws-account-settings"
      source: "<http://github.com/cloudposse-terraform-components/aws-account-settings//src?ref=v{{.Version}}|github.com/cloudposse-terraform-components/aws-account-settings//src?ref=v{{.Version}}>"
      version: "2.1.0" # renovate: datasource=github-releases depName=cloudposse-terraform-components/aws-account-settings
      targets:
        - "components/terraform/{{.Component}}"
and a renovate postUpgradeTasks
Copy code
{
  "postUpgradeTasks": {
    "commands": [
      "atmos vendor pull"
    ],
    "fileFilters": [
      "vendor.yaml"
    ],
    "executionMode": "update"
  }
}
But im trying not to reinvent the wheel so if something is already available, I’d rather reuse it
m
r
ah ok gotcha ty
e
Yes, so using
renovate
by itself won't work if you need vendored copies
However, using renovate with source provisioning should work: https://atmos.tools/examples/source-provisioning
Renovate and the Atmos component updater solve related but slightly different problems. Historically with Atmos vendoring, you have a local copy of all remote component dependencies (i.e. Terraform root modules) checked into the repo. Renovate doesn’t really understand that model. It can bump versions in config files, but it can’t then fetch the dependency, vendor it locally, and commit the result. (Full transparency: it can do this if you run Renovate as a GitHub Action instead of the SaaS integration—but that’s kind of beside the point.) The Atmos component updater was built specifically to understand Atmos components and vendoring. It’s a GitHub Action that: • updates the vendoring config, • pulls down the latest component versions, • and opens a PR you can review, merge, or close.
Looking ahead: we’re actively working on pulling all of this GitHub Action functionality directly into the *Atmos core*—including updating vendoring config and pulling sources. I can’t commit to timing yet, but the direction is to make this workflow much simpler and more native. The interesting side effect: with using
source
in stack configs, you can use Renovate alongside vendoring, since it’s just updating source references instead of managing local copies. Happy to go deeper on any of this if useful. https://atmos.tools/changelog/terraform-source-provisioner#automatic-provisioning-default Using this, it should be possible to:
Copy code
components:
  terraform:
    vpc:
      source:
        uri: <http://github.com/cloudposse-terraform-components/aws-vpc//modules/vpc|github.com/cloudposse-terraform-components/aws-vpc//modules/vpc>
        # renovate: datasource=github-tags depName=cloudposse-terraform-components/aws-vpc versioning=semver
        version: 1.450.0
Then with your rennovate configuration do something like:
Copy code
{
  "$schema": "<https://docs.renovatebot.com/renovate-schema.json>",
  "customManagers": [
    {
      "customType": "regex",
      "fileMatch": [
        "^stacks/.*\\.ya?ml$"
      ],
      "matchStrings": [
        "#\\s*renovate:\\s*datasource=(?<datasource>\\S+)\\s+depName=(?<depName>\\S+)(?:\\s+versioning=(?<versioning>\\S+))?(?:\\s+extractVersion=(?<extractVersion>\\S+))?\\s*\\n\\s*version:\\s*(?<currentValue>[^\\s#]+)"
      ]
    }
  ]
}
r
Thanks, the component updater works really well. I'll stick with that instead of renovate for now
👍 1